question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Intermittent start failure due to "Text file busy"

See original GitHub issue

In Spring Boot CI builds (which run on Linux), we occasionally see Embedded Mongo 2.0.3 fail to start due to a text file being busy:

Caused by: java.io.IOException: Cannot run program "/tmp/extract-e66d8762-5929-4f3f-994a-00c185df3844extractmongod": error=26, Text file busy
	at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
	at de.flapdoodle.embed.process.runtime.ProcessControl.start(ProcessControl.java:205)
	at de.flapdoodle.embed.process.runtime.AbstractProcess.<init>(AbstractProcess.java:99)
	at de.flapdoodle.embed.mongo.AbstractMongoProcess.<init>(AbstractMongoProcess.java:53)
	at de.flapdoodle.embed.mongo.MongodProcess.<init>(MongodProcess.java:50)
	at de.flapdoodle.embed.mongo.MongodExecutable.start(MongodExecutable.java:44)
	at de.flapdoodle.embed.mongo.MongodExecutable.start(MongodExecutable.java:34)
	at de.flapdoodle.embed.process.runtime.Executable.start(Executable.java:108)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1827)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1770)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1698)
	... 36 more
Caused by: java.io.IOException: error=26, Text file busy
	at java.lang.UNIXProcess.forkAndExec(Native Method)
	at java.lang.UNIXProcess.<init>(UNIXProcess.java:247)
	at java.lang.ProcessImpl.start(ProcessImpl.java:134)
	at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
	... 50 more

Here’s one example of the failure from which I took the above stack trace.

I wonder if there’s a stream or writer that’s not being closed or flushed when the file’s being written so that it can subsequently be busy when an attempt is made to execute it?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
wilkinsonacommented, Apr 30, 2018

I can certainly try to get some lsof output when the problem next occurs. I’ll update this issue if I am able to do so. That said, I would be surprised if there’s another process accessing the file.

Having done a bit more research, I wonder if this could be a symptom of this JDK bug? If so, perhaps it would be appropriate to retry?

0reactions
Loki-Afrocommented, Apr 30, 2018

and only open jdk seems to be affected, I can’t reproduce it on my mac either and not on linux (4.16.3) with an oracle jdk …

Read more comments on GitHub >

github_iconTop Results From Across the Web

Gedit won't save a file on a VirtualBox share: Text file busy
The most common circumstance when you'll see “text file busy” ( ETXTBUSY ) is if you try to modify an executable that's running:...
Read more >
Unicorn error: text file busy - ruby on rails - Stack Overflow
I have solved this problem, and the matter is I am using virtual box and deploying the project in sync folders. So I...
Read more >
git client plugin occasionally fails with "text file busy" error
Occasionally I get the following git error early in some of my pipeline builds, but have not been able to reproduce the issue...
Read more >
Text file busy - Helpful
bad interpreter: Text file busy​​ Pretty much the same situation as above. But often specifically when a script is currently being written to. ......
Read more >
Text file busy
This error can occur when an attempt was made to execute a pure-procedure program that is currently open for writing. It also occurs...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found