Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix exception starting DecideRuleSequence logging #210

Merged
merged 1 commit into from
Jul 27, 2018

Conversation

nlevitt
Copy link
Contributor

@nlevitt nlevitt commented Jul 23, 2018

I don't know why we've never seen this before, and now we suddenly have
a case of it, but this is the exception:

2018-07-23 17:47:01.123 SEVERE thread-2875088 org.archive.crawler.framework.CrawlJob.beansException() Failed to start bean 'scope'; nested exception is java.lang.IllegalStateException: java.nio.file.NoSuchFileException: /1/ait-h3-jobs/8144-20180723162745141/20180723174701/logs/scope.log.lck
org.springframework.context.ApplicationContextException: Failed to start bean 'scope'; nested exception is java.lang.IllegalStateException: java.nio.file.NoSuchFileException: /1/ait-h3-jobs/8144-20180723162745141/20180723174701/logs/scope.log.lck
at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:169)
at org.springframework.context.support.DefaultLifecycleProcessor.access$1(DefaultLifecycleProcessor.java:154)
at org.springframework.context.support.DefaultLifecycleProcessor$LifecycleGroup.start(DefaultLifecycleProcessor.java:335)
at org.springframework.context.support.DefaultLifecycleProcessor.startBeans(DefaultLifecycleProcessor.java:143)
at org.springframework.context.support.DefaultLifecycleProcessor.start(DefaultLifecycleProcessor.java:89)
at org.springframework.context.support.AbstractApplicationContext.start(AbstractApplicationContext.java:1236)
at org.archive.spring.PathSharingContext.start(PathSharingContext.java:115)
at org.archive.crawler.framework.CrawlJob.startContext(CrawlJob.java:455)
at org.archive.crawler.framework.CrawlJob$1.run(CrawlJob.java:428)
Caused by: java.lang.IllegalStateException: java.nio.file.NoSuchFileException: /1/ait-h3-jobs/8144-20180723162745141/20180723174701/logs/scope.log.lck
at org.archive.crawler.reporting.CrawlerLoggerModule.setupSimpleLog(CrawlerLoggerModule.java:298)
at org.archive.modules.deciderules.DecideRuleSequence.start(DecideRuleSequence.java:174)
at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:166)
... 8 more
Caused by: java.nio.file.NoSuchFileException: /1/ait-h3-jobs/8144-20180723162745141/20180723174701/logs/scope.log.lck
at sun.nio.fs.UnixException.translateToIOException(UnixException.java:86)
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
at sun.nio.fs.UnixFileSystemProvider.newFileChannel(UnixFileSystemProvider.java:177)
at java.nio.channels.FileChannel.open(FileChannel.java:287)
at java.nio.channels.FileChannel.open(FileChannel.java:335)
at java.util.logging.FileHandler.openFiles(FileHandler.java:478)
at java.util.logging.FileHandler.(FileHandler.java:344)
at org.archive.io.GenerationFileHandler.(GenerationFileHandler.java:63)
at org.archive.io.GenerationFileHandler.makeNew(GenerationFileHandler.java:158)
at org.archive.crawler.reporting.CrawlerLoggerModule.setupLogFile(CrawlerLoggerModule.java:275)
at org.archive.crawler.reporting.CrawlerLoggerModule.setupSimpleLog(CrawlerLoggerModule.java:296)
... 10 more

I don't know why we've never seen this before, and now we suddenly have
a case of it, but this is the exception:

2018-07-23 17:47:01.123 SEVERE thread-2875088 org.archive.crawler.framework.CrawlJob.beansException() Failed to start bean 'scope'; nested exception is java.lang.IllegalStateException: java.nio.file.NoSuchFileException: /1/ait-h3-jobs/8144-20180723162745141/20180723174701/logs/scope.log.lck
org.springframework.context.ApplicationContextException: Failed to start bean 'scope'; nested exception is java.lang.IllegalStateException: java.nio.file.NoSuchFileException: /1/ait-h3-jobs/8144-20180723162745141/20180723174701/logs/scope.log.lck
        at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:169)
        at org.springframework.context.support.DefaultLifecycleProcessor.access$1(DefaultLifecycleProcessor.java:154)
        at org.springframework.context.support.DefaultLifecycleProcessor$LifecycleGroup.start(DefaultLifecycleProcessor.java:335)
        at org.springframework.context.support.DefaultLifecycleProcessor.startBeans(DefaultLifecycleProcessor.java:143)
        at org.springframework.context.support.DefaultLifecycleProcessor.start(DefaultLifecycleProcessor.java:89)
        at org.springframework.context.support.AbstractApplicationContext.start(AbstractApplicationContext.java:1236)
        at org.archive.spring.PathSharingContext.start(PathSharingContext.java:115)
        at org.archive.crawler.framework.CrawlJob.startContext(CrawlJob.java:455)
        at org.archive.crawler.framework.CrawlJob$1.run(CrawlJob.java:428)
Caused by: java.lang.IllegalStateException: java.nio.file.NoSuchFileException: /1/ait-h3-jobs/8144-20180723162745141/20180723174701/logs/scope.log.lck
        at org.archive.crawler.reporting.CrawlerLoggerModule.setupSimpleLog(CrawlerLoggerModule.java:298)
        at org.archive.modules.deciderules.DecideRuleSequence.start(DecideRuleSequence.java:174)
        at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:166)
        ... 8 more
Caused by: java.nio.file.NoSuchFileException: /1/ait-h3-jobs/8144-20180723162745141/20180723174701/logs/scope.log.lck
        at sun.nio.fs.UnixException.translateToIOException(UnixException.java:86)
        at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
        at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
        at sun.nio.fs.UnixFileSystemProvider.newFileChannel(UnixFileSystemProvider.java:177)
        at java.nio.channels.FileChannel.open(FileChannel.java:287)
        at java.nio.channels.FileChannel.open(FileChannel.java:335)
        at java.util.logging.FileHandler.openFiles(FileHandler.java:478)
        at java.util.logging.FileHandler.<init>(FileHandler.java:344)
        at org.archive.io.GenerationFileHandler.<init>(GenerationFileHandler.java:63)
        at org.archive.io.GenerationFileHandler.makeNew(GenerationFileHandler.java:158)
        at org.archive.crawler.reporting.CrawlerLoggerModule.setupLogFile(CrawlerLoggerModule.java:275)
        at org.archive.crawler.reporting.CrawlerLoggerModule.setupSimpleLog(CrawlerLoggerModule.java:296)
        ... 10 more
@ato
Copy link
Collaborator

ato commented Jul 24, 2018

Weird! Sounds like Spring is supposed to call start dependencies first and I assume the autowiring should register it as a dependency.

I don't suppose the CrawlerLoggerModule bean definition is not at the top-level? That's the only theory I could come up with (other than a Spring bug or circular dependency):

Note that the Lifecycle interface is only supported on top-level singleton beans. On any other component, the Lifecycle interface will remain undetected and hence ignored.

@nlevitt
Copy link
Contributor Author

nlevitt commented Jul 26, 2018

Weird! Sounds like Spring is supposed to call start dependencies first and I assume the autowiring should register it as a dependency.

Yeah I think so. org.springframework.context.support.DefaultLifecycleProcessor.doStart() does this:

			for (String dependency : dependenciesForBean) {
				doStart(lifecycleBeans, dependency);
			}

I don't suppose the CrawlerLoggerModule bean definition is not at the top-level?

It is defined at the top level.

We moved the crawl config to a different instance of heritrix and it started up.

Super weird. Maybe a spring bug.

@ato ato merged commit 9c9d11d into internetarchive:master Jul 27, 2018
@ato
Copy link
Collaborator

ato commented Jul 27, 2018

Not really sure what our process is here, so I'm just impertinently assuming 'someone else reviews and merges'. ;) Let me know if that's wrong.

I think this solution is fine. Personally I prefer explicit dependencies rather than Spring's automation anyway as it makes things more straightforward and deterministic.

@nlevitt
Copy link
Contributor Author

nlevitt commented Aug 2, 2018

Thank you Alex! Just noticed the merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants