xbb
xbb

Reputation: 2163

celery log shows "Permission Denied"

I'm running celery on Windows, and there's a task that writes a file on a network drive. Looks like it's having issue to write due to permission. Here's part of celery log that shows the error:

 File "C:\TaskerApp\FlaskApps\Tasker\tasks.py", line 194, in export
 with open(filename, 'wb') as w:
 IOError: [Errno 13] Permission denied: u'//saab/Data/5863/5-Message/5863_2M.txt'

And this is the original code:

@celery.task(name="tasks.export")
def export(file_name):
    with open(file_name, 'wb') as w:
        w.write('test')

However when I try to write the file directly from python command line, I don't see any issue.

Just wonder what is the possible reason to cause this issue? enter image description here

Upvotes: 0

Views: 1484

Answers (1)

xbb
xbb

Reputation: 2163

Finally I got this work. Looks like the service is running under Local System Account, after I share the file path with this local account, the issue went away.

Upvotes: 1

Related Questions