Forums

Error in Task log-files: Device or resource busy

Hello together, Yesterday I set up a new Dash-Project, where the required data is captured via different task. Today I had a look in the log files of all tasks and see the following message

rm: cannot remove '/mnt/chroots/defianalytics/fishnchips/dev/shm': Device or resource busy

In the scripts there is no rm-Command and the scripts seems the be run successfully. So, can anybody help me, what is wrong on my system, please? I myself have no idea, because similar tasks are running on another account without any message.

I just compared and the only really difference is in using the following line inside the code scriptPath = file Could the file cause this message?

Thanks a lot in advance.

Sorry about that - a little bit of a server hiccough that I've fixed. Your tasks should be fine now.

Wow, such a fast answer. Thanks a lot for solving the issue. Really great !!! Now, everything looks fine.

I have again this message in my tasks. This was the first time today appearing again

rm: cannot remove '/mnt/chroots/defianalytics/fishnchips/dev/shm': Device or resource busy 2021-04-03 05:01:23 -- Completed task, took 34.95 seconds, return code was 0.

Can you have a look again, please?

thanks for reporting- let us investigate and get back to you.

Judging from the second message--

Completed task, took 34.95 seconds, return code was 0.

Given the status code of 0, I think the message above was just a warning, and your task did run fine after that warning.

We believe this warning is due to a recent change that we made on our side, but should just be a warning that we should have filtered out for you.

Please let us know if this is not the case!

You are right, the task a running as specified. There is neither a warning than an error before the message, that was irritating me.

So, if the task are running, everything is fine and I let them as they are.

Yes, that sounds like the right thing to do for now. We'll work out how to suppress that error, because it is annoying and confusing, but it doesn't seem to indicate any specific system issues right now.

I got this message in my task log starting with the task at 2021-04-17 05:09:37, and every hour since. I found this while investigating an issue that looks like the task suddenly stopped running, and that was reported to me about 12 hours ago (at time of writing). I haven't touched this stuff for weeks. Coincidence?

rm: cannot remove '/mnt/chroots/rangevsrange/classic/dev/shm': Device or resource busy

I don't know if the task is working / running again yet, but I'll keep an eye on it.

(to be clear, I couldn't find any actual problems, but the task seemed to have had no effect, and running it from the console did work as expected)

I reported the same problem (sorry I didn't fin this topic) error starting web2py scheduler on pythoneverywhere. The pythoneverywhere task is launched to restart web2py scheduler, just in case it stops.

It runs OK from console but not from Scheduled Tasks. For me it isn't a warning, process doesn't start running. Thanks to any help.

We believe that the error message is harmless -- something we need to fix just so that it doesn't pollute the logs rather than a real problem -- but it is possible that the change that introduced that might have broken other things.

That said, if the script works from a console, it certainly should work from a scheduled task -- code is executed pretty much the same way in both cases. Could you let us know which of your tasks it is? A link to the logfile would be a good way to do that -- the link will help us work out which one it is from our admin interface, but the contents of the log would not be visible to other people on these forums.

This is the error code.<br/>

rm: cannot remove 'django3ip/bin/.nfs0000000004eae7ca000007ae': Device or resource busy`

<br/> Please fix it for me too. also, is there any solution in this case?

Where are you getting that error?

Symptoms persist.

Here is the URL of the logfile: https://www.pythonanywhere.com/user/rangevsrange/files/var/log/schedule-log-19303.log

I ran the script, and it took 4 seconds to do its work (see https://www.pythonanywhere.com/user/rangevsrange/consoles/16825942/). Compare to 100-200 seconds reported in that logfile.

When is your task scheduled? If it runs on full hours, it could affect its performance, since people tend to run their tasks on round hours and the server is busy then.

5 minutes past the hour, then every 15 minutes.

Could you try rescheduling that for non "obvious" times and check if that helps?

Hard to know what the least used times will be, so I decided to use random times. I know humans are no good at that though, so I used random.org. Unfortunately it just gave me:

4   4   4   4

And now I guess I see that random is not necessarily right either, so I'll just go with this instead.

8   23  38  53

I'll report back (but it may take a few days to confirm).

Looks like you could have a good hand for slots! (joking) Sure, let us know how the task is performing after the reschedule.

Symptoms persist.

When I run the task (same command text running from /home/rangevsrange) in a bash console, it does its work. I just ran it and it took 3 minutes 57 seconds. When I run it again, it completes almost immediately.

That 4 minutes of work that it did on the command line reflects the backlog of work accumulated in the last 10 days, from these tasks not... completing? executing? working properly.

Any suggestions?

I cannot confirm it relates to the "Device or resource busy" message in the log, but I can confirm that A) the problem started at the same time, and B) I didn't change anything at or around that time (for weeks). So, if it is a coincidence, it's a big one.

Also: https://xkcd.com/221/ :-)

I see that your task does not log anything when it is successful. Could you add some logging so that you can determine what it is doing? That will help us to narrow down what might be the issue.

Hello, since the past few days I have been receiving the same error in the log: rm: cannot remove '/mnt/chroots/mafbotboi/fishnchips/dev/shm': Device or resource busy.

Also since a few days ago, one of my tasks stopped running hourly, but rather at seemingly random intervals and idk why. It was working perfectly fine before and i didnt change any of the code. Also I dont think the error lies in the code, as if it was broken, an error message should have popped up in the logs.

Feedback/help would be greatly appreciated!

That sounds very strange! I see that you have a lot of tasks -- which one is doing that? If there's something private about the filenames or other identifying features of the tasks and you don't want to post them here, just let us know over email at support@pythonanywhere.com

1) umount: /mnt/chroots/philipd6/fishnchips/dev/shm: target is busy.

2) rm: cannot remove '/mnt/chroots/philipd6/fishnchips/dev/shm': Device or resource busy

I have just started receiving the same message on my scheduled tasks, first I received the two messages above, then I only receive the second message on each subsequent task .

All my tasks seem to be working regardless.

I think my App was recently switched to your virtual wrapper or environment to run tasks, not sure if that helps.

We are working on that. It should not cause any problems apart from spamming your logs.

I added some logging, and I think fixed the problem.

I think the problem was that my task is spawning the real work into a new process using subprocess.Popen, but it wasn't blocking. The task wrapper script would finish, and then I suspect PythonAnywhere was killing the child process once the parent script finished.

The fix was simple, task.wait().

However, I still conclude that if this was coincidental to the subject of this thread ("Device or resource busy"), then it was a very, very big coincidence. This task used to run fine (evidently PythonAnywhere would let the child process complete), and it was working for years before it suddenly broke. When it did suddenly stop working, it was at the same time this message started appearing in the logs, and it was months after the last change I had made on PythonAnywhere.

All that said, thanks for the help in tracking it down and fixing it. You rock.

Thanks for letting us know. It should not have any effect on your code and is not related as far as we know.

Hi Guys, Is there any solution to this yet. Good it doesn't affect program execution but it does look unappealing.

We looked into your logs -- the error you're seing is most probably caused by a different thing, the traceback message implicates that you're trying to delete a file that is still open/used by the process.