Bagit log4j error

110 views
Skip to first unread message

caosbo...@gmail.com

unread,
Dec 11, 2018, 6:16:16 PM12/11/18
to archivematica
We're seeing an error on our CentOs installation of Archivematica 1.7 when we try to use the bagit install:
$ /usr/share/bagit/bin/bag verifyvalid --verbose --noresultfile /qnas-amatica/sharedDirectory/failed/azu_MS592_20180425-2-dbec1ed3-84c9-44c9-abeb-c3347edd9e86/
log4j:WARN No appenders could be found for logger (gov.loc.repository.bagit.driver.CommandLineBagDriver).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
An error occurred. Check the ../logs/bag-null.log for more details.

Any ideas on how to fix this?

rspe...@artefactual.com

unread,
Jan 14, 2019, 5:30:44 AM1/14/19
to archivematica
Hi there, 

Apologies for the delay replying. Are you still having a problem with this? There are a few things to try if so:

* Try running the same command from /usr/share/bagit/bin/ directly
* Have a look at the log output in the log directory suggested by the output, and see if there is anything obvious there

There is a chance that the bagit command cannot find the log4j configuration from the CLASSPATH, but it'd be useful to see what the result of above is, or also, to hear from others using the bagit command installed with Archivematica this way.

The Java version of Bagit is used in Archivematica in a number of client scripts, I would need to look in more detail to see how those scripts counter this issue. 

There may also be more information on the Library of Congress website, https://github.com/LibraryOfCongress/bagit-java the version installed with Archivematica should be 4.12.3.

Please let us know,
Regards,
Ross

caosbo...@gmail.com

unread,
Jan 16, 2019, 9:54:07 AM1/16/19
to archivematica
Running bag from /usr/share/bagit/bin/ resulted int he same error. And the log that the error references doesn't actually exist. 

[cao89@preservation bin]$ ./bag verifyvalid --verbose --noresultfile /qnas-amatica/sharedDirectory/failed/azu_MS592_20180425-2-dbec1ed3-84c9-44c9-abeb-c3347edd9e86/
log4j:WARN No appenders could be found for logger (gov.loc.repository.bagit.driver.CommandLineBagDriver).
log4j:WARN Please initialize the log4j system properly.
An error occurred. Check the ../logs/bag-null.log for more details.

 From what we can tell Bagit is being packaged differently on the CentOs install of Archivematica than it is on the Ubuntu version. We were able to fix this on one of our environments by grabbing the contents of the .deb package of Bagit and manually installing it on our CentOs server with Archivematica installed. 

rspe...@artefactual.com

unread,
Jan 22, 2019, 10:23:35 AM1/22/19
to archivematica
Hi Andy,

Are the problems with Bagit affecting Archivematica at all, i.e. is it just because of the way it is being invoked, vs. Archivematica not being able to invoke it. I think that would be a bigger concern. If so, it would also be useful to hear from other CentOS users on the forum that this might be happening for.

Otherwise, you could consider using the check_fixity endpoint as that  uses a bag checker to validate integrity (this example using httpie):

http -v --pretty=format \
    GET "http://127.0.0.1:62081/api/v2/file/<uuid>/check_fixity/" \
    Authorization:"ApiKey test:test" 

You could also consider running Bagit 4.x on another machine. Using it like this on the Archivematica server would not normally be our recommended approach.

Please let us know how it goes.

All the best
Ross

caosbo...@gmail.com

unread,
Jan 30, 2019, 9:51:50 AM1/30/19
to archivematica
Hi Ross,
This is effecting Archivematica. When you transfer a bag using the dashboard you don't get any logging that should be showing up. So, say there's  a bag that fails during transfer due to incorrect bag structure, the "Job Verify bag, and restructure for compliance" task will fail and you should be able to go to "Tasks" for that job and see output to standard error and standard output, but because Bagit is not configured correctly you just see the error about missing Log4j configurations. This makes it difficult for non system admins to troubleshoot issues with their Bags that they are trying to ingest. 

rspe...@artefactual.com

unread,
Feb 5, 2019, 2:41:46 AM2/5/19
to archivematica
Hi Andy,

I apologize I didn't think i had a CentOS install to verify this against. I tested the problem using one our test deployments and I can both verify it, and I have a workaround for it as well. 

I have logged this all here for you: https://github.com/archivematica/Issues/issues/475 

Please let us know if that works for you - it will be a useful workaround for those who rely on this functionality. We will need to investigate the CentOS packages in more detail. 

We really appreciate you bringing this to our attention. Sorry it took a bit of a while to resolve. 
All the best,
Ross

Ross Spencer

unread,
Sep 3, 2019, 9:17:01 AM9/3/19
to archivematica
I have posted follow-up notes for this in the Github issue associated with this forum-post: https://github.com/archivematica/Issues/issues/475#issuecomment-527452344 

Hopefully that will help folks out. Please let us know if there are any other follow-up questions we can help you with. 

Best,
Ross
Reply all
Reply to author
Forward
0 new messages