Forums

Invalid cross-device link

Hi,

I'm getting "Invalid cross-device link: '/tmp/tmpo3h60rii' -> '/home/myname/mysite/static/QQ/info'" when I use the persistent queue module as in the following line:

"myqueue.put(item)"

Which should write my item to a file to be saved. Any suggestion? Is there any setting I should use in my wsgi file for flask?

Thanks in advance

Which persistent queue module are you using? It looks like it's having a problem with the fact that the filesystem on PythonAnywhere is a networked one, but it's possible there's a workaround.

Hey giles,

Thanks for your response. I'm using persistqueue module PyPI , GitHub

Thanks for the help

OK, I think I see the problem. If you check out the docs for the Queue constructor, they say:

    The tempdir parameter indicates where temporary files should be stored.
    The tempdir has to be located on the same disk as the enqueued data in
    order to obtain atomic operations.

On PythonAnywhere, /tmp is a different partition (well, strictly speaking a different NFS share) to your home directory.

So what you need to do is create the queue so that both path and tempdir point to directories on the same disk. Aassuming that your path is set to something like /home/SirTen/myqueue -- that is, it's in your home directory -- you should create a directory for the temp stuff in your home directory (say, /home/SirTen/myqueue/tmp), and then specify that as the tempdir.

Thank you so much giles. I really appreciate you taking the time to help me fix this problem. I'll try that solution tomorrow. A simple tempdir=path/tmp should do it.

Much appreciated <3 Majed

No problem! Let us know if you have any problems with the fix.