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

Could not delete temporary directory - NFS Disk #48

Open
mannemvamsi opened this issue Nov 16, 2020 · 1 comment
Open

Could not delete temporary directory - NFS Disk #48

mannemvamsi opened this issue Nov 16, 2020 · 1 comment

Comments

@mannemvamsi
Copy link

Sentry Log

OSError: [Errno 39] Directory not empty: '/kode/picxy/phtgr_photos/temporary_uploads/3k3VsojXz3kZwKVdcnvi9M'
  File "scheduler/tasks.py", line 238, in removeTemporaryUpload
    photo.temporary_upload.delete()
  File "django/db/models/base.py", line 919, in delete
    return collector.delete()
  File "django/db/models/deletion.py", line 318, in delete
    sender=model, instance=obj, using=self.using
  File "django/dispatch/dispatcher.py", line 175, in send
    for receiver in self._live_receivers(sender)
  File "django/dispatch/dispatcher.py", line 175, in <listcomp>
    for receiver in self._live_receivers(sender)
  File "django_drf_filepond/models.py", line 63, in delete_temp_upload_file
    os.rmdir(file_dir)

I've been using this plugin more than a year.. works like charm with local disk.
Recently, I have moved the deployment to kubernetes pod with NFS disk mounted to store the temporary uploads, where i am getting the error [os error: Directory not empty]

Folder that unable to delete 3k3VsojXz3kZwKVdcnvi9M it is emptly.

ls -lrt
total 0

ls -la
total 1568
drwxr-xr-x    2 root root    4096 Nov 16 09:24 .
drwxr-xr-x 4290 root root 1597440 Nov 16 10:06 ..
@jcohen02
Copy link
Collaborator

Hi @mannemvamsi, thanks for highlighting this issue and apologies for the delay in getting to this. Great to hear that you've been using the plugin successfully prior to this. I'll need to make some further investigations as to what might be causing this.

My initial thought is that it looks like this could be the result of some sort of delay in removing the temporary upload file within the directory resulting from, perhaps, some NFS write-caching or similar. Or perhaps even just a slight delay in NFS handling the request to delete the file. I'm assuming that this is unlikely to be a direct result of running in a container within a kubernetes pod.

If you have any further information or you're able to create a minimal example to reproduce this, that would be really helpful. Alternatively, it might be worth just writing a really simple shell script to create a directory/file structure similar to that set up by the plugin and then issuing an rm command for the file within the folder, followed straight away by an rmdir command to remove the folder. If you run this within the container where the app is hosted and see if you get an error saying that the directory is not empty, this would help to determine whether this is indeed some sort of issue related to delayed NFS writes.

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

No branches or pull requests

2 participants