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

Uploading a file put's it in 2 different folders #180

Open
hilite24 opened this issue Mar 16, 2018 · 6 comments
Open

Uploading a file put's it in 2 different folders #180

hilite24 opened this issue Mar 16, 2018 · 6 comments
Labels

Comments

@hilite24
Copy link

hilite24 commented Mar 16, 2018

I just noticed that somehow when uploading a file, youtransfer "uploads" it a second time to another folder. I noticed this when trying to upload a 3GB file. With the command df the space used went up 6GB instead of only 3GB. After seemingly finishing uploading the file, it doesn't show the finished upload window but waits for a few more seconds. This "wait time" is probably when Youtransfer is copying it to the second folder.

In the youtransfer settings, the local file system path is set to /opt/youtransfer/uploads . Tried it again with a smaller file of 1.7M which gets correctly put it in /opt/youtransfer/uploads :
-rw-r--r-- 1 root root 1.7M Mar 16 08:55 37c828d1445fcaa95a0d2ed187d67390.binary
-rw-r--r-- 1 root root 503 Mar 16 08:55 37c828d1445fcaa95a0d2ed187d67390.json

But somehow also in the youtransfer folder at /opt/youtransfer, just under a different name :
-rw-r--r-- 1 root root 1.7M Mar 16 08:55 upload_1150d878777d63ed5603e2399ffff545

edit1 : I tried removing the file upload_1150d878777d63ed5603e2399ffff545 in /opt/youtransfer .
Downloading the file still works afterwards. A workaround would be to create a cron that removes all upload_
files in /opt/youtransfer

Is this a problem with my installation or does anyone notice the same behavior?

Thank you for any kind of help.

@Syam
Copy link

Syam commented Aug 6, 2018

Hello,

Meet the same issue, successfull uploads remain in both /opt/youtransfer/uploads and /opt/youtransfer as upload_xxxxxx tmp file.

It is consumming space twice.

@remie
Copy link
Collaborator

remie commented Aug 9, 2018

I can confirm this issue as the current storage providers (localstorage & s3storage) do not clean up the temporary uploaded file after they copied it to the final location. It would have been better to move the file and do the encryption (if enabled) in place instead of streaming it from one location to the other on the file system (and forgetting to remove it).

If anyone feels up to it, the place to fix it is in localstorage.js and s3storage.js. I would be happy to accept a PR that fixes this.

@doug86i
Copy link

doug86i commented Jun 11, 2020

Is there any progress on this? I like the project allot but will have to find an alternative if this isn't easily fixed. My root partition is a small SSD with a large array of spinning rust as storage, I can't risk the root partition filling up with duplicates.

@hilite24
Copy link
Author

Workaround that worked for me was to create a cronjob to clean the temp folder.

@doug86i
Copy link

doug86i commented Jun 12, 2020

Thanks hilite, I assume it's best to rebuild the docker image to run cron inside the same container? I'm relatively new to docker but enjoying the possibilities!

@alanlitster
Copy link

@doug86i No, one container per process. But running cron separately for this is probably an overkill.

You'd be better off creating a script that calls find to remove files over a certain age, that way if it happens to run at the same time as a file is being uploaded it won't mess it up.

But as this is only trivial, it'd be easier to just run docker exec with your script via your hosts own cron daemon to clean them up. You may want to check that your container is running first before the docker cleanup command.

container=youtransfer
 [[ $(docker container ls --no-trunc --filter "name=^/$container$" --filter 'status=running' --format '{{.Names}}') == "$container" ]] && docker exec $container cleanup

so that would want to go in it's own script and that would be called via cron on the host.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants