TinyCat: ERROR: 'NoneType' object has no attribute 'get_fields'
Talk Bug Collectors
Join LibraryThing to post.
1bnielsen
Looking at this book in TinyCat everything seems fine
https://www.librarycat.org/lib/bnielsen/item/25714274#
but clicking on MarcView gives a pretty weird error:
ERROR: 'NoneType' object has no attribute 'get_fields'
ETA: I found one more:
https://www.librarycat.org/lib/bnielsen/item/211898383#
I personally think this error message would do a great job as an inscription on a tombstone on a programmer's grave somewhere :-)
https://www.librarycat.org/lib/bnielsen/item/25714274#
but clicking on MarcView gives a pretty weird error:
ERROR: 'NoneType' object has no attribute 'get_fields'
ETA: I found one more:
https://www.librarycat.org/lib/bnielsen/item/211898383#
I personally think this error message would do a great job as an inscription on a tombstone on a programmer's grave somewhere :-)
2bnielsen
I found 17 of my records that trigger this bug (most likely a Python function that for some reason doesn't return a value).
I've put a note in the Comments field:
so searching for
missingtinycatmarcview
in my library will find them (except that it's not indexed yet).
@ZephCraven might want to take a look? And maybe push a reindex of my library?
Ah, searching for
21509496 OR 22822016 OR 24280072 OR 25714229 OR 25714256 OR 25714274 OR 31705281 OR 32991035 OR 106541139 OR 124490847 OR 208053158 OR 211898383 OR 246571382 OR 260395180 OR 287483634 OR 288550128 OR 288651484
also find them.
I've put a note in the Comments field:
so searching for
missingtinycatmarcview
in my library will find them (except that it's not indexed yet).
@ZephCraven might want to take a look? And maybe push a reindex of my library?
Ah, searching for
21509496 OR 22822016 OR 24280072 OR 25714229 OR 25714256 OR 25714274 OR 31705281 OR 32991035 OR 106541139 OR 124490847 OR 208053158 OR 211898383 OR 246571382 OR 260395180 OR 287483634 OR 288550128 OR 288651484
also find them.
3kristilabrie
Noting the source data for these missing MARC views: most are from Det Kongelige Bibliotek, others include Gemeinsamer Bibliotheksverbund (GBV), Bibliotek.dk, amazon.co.uk, amazon.ca, manual entry, and Anet (UAntwerpen, UHasselt, EHC, etc.).
https://www.librarything.com/catalog/bnielsen?&deepsearch=missingtinycatmarc...
https://www.librarything.com/catalog/bnielsen?&deepsearch=missingtinycatmarc...
4kristilabrie
NB: I tried running a filtered MARC export on those records and MarcBreaker is giving me a "Error Number: -100 Malformed process. Format or object undefined." error.
5kristilabrie
Troubleshooting summary: Here's what I attempted to do.
- bnielsen reported a MARC View error in TinyCat: "'NoneType' object has no attribute 'get_fields'" on 17 records.
- I extracted those records into a MARC export file and attempted to run a cleaning script to identify and sanitize problematic MARC data.
- The cleaning script processed only 2 out of the 17 records; the rest were skipped due to None records or missing leaders, indicating possible malformed or incomplete MARC records.
- Many records in the export either are missing leaders or are unreadable by pymarc.
- Exporting these records from MarcBreaker triggers an “Error Number: -100 Malformed process. Format or object undefined” error, suggesting the source data or export process may be corrupt or incompatible.
What to look into next:
- Examine the original MARC records from the source systems (Det Kongelige Bibliotek, GBV, Bibliotek.dk, etc.) to verify their integrity and completeness.
- Check the MARC export process for errors or malformed output causing unreadable records.
- Investigate how TinyCat parses these MARC records and why it results in None or missing leader fields, leading to the get_fields attribute error.
- Consider adding more robust error handling around MARC record parsing in TinyCat to gracefully handle or report malformed records.
- Possibly reindex or refresh the affected records after fixing source/export issues.
- bnielsen reported a MARC View error in TinyCat: "'NoneType' object has no attribute 'get_fields'" on 17 records.
- I extracted those records into a MARC export file and attempted to run a cleaning script to identify and sanitize problematic MARC data.
- The cleaning script processed only 2 out of the 17 records; the rest were skipped due to None records or missing leaders, indicating possible malformed or incomplete MARC records.
- Many records in the export either are missing leaders or are unreadable by pymarc.
- Exporting these records from MarcBreaker triggers an “Error Number: -100 Malformed process. Format or object undefined” error, suggesting the source data or export process may be corrupt or incompatible.
What to look into next:
- Examine the original MARC records from the source systems (Det Kongelige Bibliotek, GBV, Bibliotek.dk, etc.) to verify their integrity and completeness.
- Check the MARC export process for errors or malformed output causing unreadable records.
- Investigate how TinyCat parses these MARC records and why it results in None or missing leader fields, leading to the get_fields attribute error.
- Consider adding more robust error handling around MARC record parsing in TinyCat to gracefully handle or report malformed records.
- Possibly reindex or refresh the affected records after fixing source/export issues.
6bnielsen
Time (or @kristilabrie) seems to have healed some of this. I can find the 17 books by searching for missingtinycatmarcview now and only 9 of them gives this error.
(I think the 8 others maybe just returned an emply record due to a time out?)
So the current nine errors can be found by searching for this
106541139 OR 124490847 OR 211898383 OR 246571382 OR 25714229 OR 25714256 OR 25714274 OR 31705281 OR 32991035
(I think the 8 others maybe just returned an emply record due to a time out?)
So the current nine errors can be found by searching for this
106541139 OR 124490847 OR 211898383 OR 246571382 OR 25714229 OR 25714256 OR 25714274 OR 31705281 OR 32991035
7jjwilson61
>5 kristilabrie: Another thing you could do is to validate the MARC records when they're imported from the source
8kristilabrie
>6 bnielsen: Interesting. I did clear your caches and reindex your catalog, just in case that triggered anything.
9kristilabrie
>7 jjwilson61: Yes, thanks!
10bnielsen
Thanks. Now searching for missingtinycatmarcview finds 12 books, including https://www.librarything.com/work/191660/details/208053158 which doesn't have that phrase any more, so indexing seems a bit unreliable :-)
11bnielsen
>9 kristilabrie: Yes, besides the records that triggered my bug report here, there are loads of character set issues in some of the other records.
https://www.librarycat.org/lib/bnielsen/item/208053158#
has 020 $c ... Gevinst til en trols̜
which should be 020 $c ... Gevinst til en troløs
and
260 $bSpn̆dende Bg̜er
which should be 260 Spændende Bøger
FWIW I can fix most of these by a script like:
...
sed 's/\(.\)\o314\o234/ø\1/g' | \
sed 's/\(.\)\o314\o204/å\1/g' | \
sed 's/\(.\)\o314\o206/æ\1/g' | \
...
So the text is garbled, but not completely destroyed :-)
https://www.librarycat.org/lib/bnielsen/item/208053158#
has 020 $c ... Gevinst til en trols̜
which should be 020 $c ... Gevinst til en troløs
and
260 $bSpn̆dende Bg̜er
which should be 260 Spændende Bøger
FWIW I can fix most of these by a script like:
...
sed 's/\(.\)\o314\o234/ø\1/g' | \
sed 's/\(.\)\o314\o204/å\1/g' | \
sed 's/\(.\)\o314\o206/æ\1/g' | \
...
So the text is garbled, but not completely destroyed :-)
12kristilabrie
>10 bnielsen: Huh, I hadn't touched your reindexing from your last post. I tried it yesterday while testing. Let me try reindexing, now.
13kristilabrie
Now I'm getting 11 results for https://www.librarything.com/catalog/bnielsen?&deepsearch=%22missingtinycatm..., including the book you removed that string from: https://www.librarything.com/work/191660/details/208053158
Let's give it a day to see if it resolves itself.
Let's give it a day to see if it resolves itself.
14bnielsen
>13 kristilabrie: Yes, sure. It's no big deal.
15kristilabrie
>14 bnielsen: It's back down to 10, now, which is accurate. So, good!
16bnielsen
Something changed so the nine left (i.e. https://www.librarycat.org/lib/bnielsen/item/124490847# and 8 more)
gives an empty view rather than the
ERROR: 'NoneType' object has no attribute 'get_fields'
so technically the bug is fixed (or more accurate: replaced by another)
The nine affected records are these.
106541139 OR 124490847 OR 211898383 OR 246571382 OR 25714229 OR 25714256 OR 25714274 OR 31705281 OR 32991035
(I.e. the same mentioned in >6 bnielsen:).
gives an empty view rather than the
ERROR: 'NoneType' object has no attribute 'get_fields'
so technically the bug is fixed (or more accurate: replaced by another)
The nine affected records are these.
106541139 OR 124490847 OR 211898383 OR 246571382 OR 25714229 OR 25714256 OR 25714274 OR 31705281 OR 32991035
(I.e. the same mentioned in >6 bnielsen:).
17bnielsen
Just an update:
For some reason it is back to the
ERROR: 'NoneType' object has no attribute 'get_fields'
message.
The nine can be found in my TinyCat catalog by searching for
106541139 OR 124490847 OR 211898383 OR 246571382 OR 25714229 OR 25714256 OR 25714274 OR 31705281 OR 32991035
Maybe they are disguised as riders in black?
For some reason it is back to the
ERROR: 'NoneType' object has no attribute 'get_fields'
message.
The nine can be found in my TinyCat catalog by searching for
106541139 OR 124490847 OR 211898383 OR 246571382 OR 25714229 OR 25714256 OR 25714274 OR 31705281 OR 32991035
Maybe they are disguised as riders in black?
18bnielsen
The nine that can be found by search my TinyCat library for
missingtinycatmarcview
are still giving
ERROR: 'NoneType' object has no attribute 'get_fields'
but I'm just using this feature in a script, so I've taken to creating some ersatz records for the nine.
I.e. this bug doesn't annoy me much. I'll just let the records stay as they are in case @kristilabrie can use them for debugging.
missingtinycatmarcview
are still giving
ERROR: 'NoneType' object has no attribute 'get_fields'
but I'm just using this feature in a script, so I've taken to creating some ersatz records for the nine.
I.e. this bug doesn't annoy me much. I'll just let the records stay as they are in case @kristilabrie can use them for debugging.
19bnielsen
Bump? >18 bnielsen: is a good description of the current state of affairs.
I wonder if any others have run into the same error, but probably I'm the only one looking at the MarcView.
I wonder if any others have run into the same error, but probably I'm the only one looking at the MarcView.

