Couldn't upload file to docker #244

Closed
opened 2026-01-19 18:29:34 +00:00 by michael · 3 comments
Owner

Originally created by @ichcc on GitHub.

Docker run as recommended

$ docker run -p 8080:8080 dutchcoders/transfer.sh:latest --provider local --basedir /home/ichcc/tmp
[transfer.sh]2019/08/22 12:31:11 Transfer.sh server started.
using temp folder: /tmp/
using storage provider: local
[transfer.sh]2019/08/22 12:31:11 listening on port: :8080
[transfer.sh]2019/08/22 12:31:11 ---------------------------
2019/08/22 12:31:15 mkdir /home/ichcc/tmp/NMb6L: no such file or directory
[transfer.sh]2019/08/22 12:31:16 172.17.0.1:44804 - - [2019-08-22T12:31:16Z] "PUT /RH.txt HTTP/1.1" 500  "" "curl/7.52.1"
^C[transfer.sh]2019/08/22 12:32:11 Server stopped.

Basedir exist, full access

$ curl --upload-file  ./torrents/RH.txt http://127.0.0.1:8080/RH.txt --verbose -H "Max-Days: 1"
*   Trying 127.0.0.1...
* TCP_NODELAY set
* Connected to 127.0.0.1 (127.0.0.1) port 8080 (#0)
> PUT /RH.txt HTTP/1.1
> Host: 127.0.0.1:8080
> User-Agent: curl/7.52.1
> Accept: */*
> Max-Days: 1
> Content-Length: 3340
> Expect: 100-continue
>
* Done waiting for 100-continue
* We are completely uploaded and fine
< HTTP/1.1 500 Internal Server Error
< Content-Type: text/plain; charset=utf-8
< Server: Transfer.sh HTTP Server 1.0
< X-Content-Type-Options: nosniff
< X-Made-With: <3 by DutchCoders
< X-Served-By: Proudly served by DutchCoders
< Date: Thu, 22 Aug 2019 12:32:19 GMT
< Content-Length: 24
< Connection: close
<
Could not save metadata
* Curl_http_done: called premature == 0
* Closing connection 0
$ docker info
Client:
 Debug Mode: false

Server:
 Containers: 21
  Running: 1
  Paused: 0
  Stopped: 20
 Images: 10
 Server Version: 19.03.1
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Native Overlay Diff: true
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 894b81a4b802e4eb2a91d1ce216b8817763c29fb
 runc version: 425e105d5a03fabd737a126ad93d62a9eeede87f
 init version: fec3683
 Security Options:
  seccomp
   Profile: default
 Kernel Version: 4.9.0-9-amd64
 Operating System: Debian GNU/Linux 9 (stretch)
 OSType: linux
 Architecture: x86_64
 CPUs: 4
 Total Memory: 15.55GiB
 Name: raft
 ID: TZC5:PLKN:SHSE:INFZ:TXFG:SZRF:4WNK:ZQT7:7EAA:6LYR:XGCN:J2XT
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

WARNING: No swap limit support
Originally created by @ichcc on GitHub. Docker run as recommended ```bash $ docker run -p 8080:8080 dutchcoders/transfer.sh:latest --provider local --basedir /home/ichcc/tmp [transfer.sh]2019/08/22 12:31:11 Transfer.sh server started. using temp folder: /tmp/ using storage provider: local [transfer.sh]2019/08/22 12:31:11 listening on port: :8080 [transfer.sh]2019/08/22 12:31:11 --------------------------- 2019/08/22 12:31:15 mkdir /home/ichcc/tmp/NMb6L: no such file or directory [transfer.sh]2019/08/22 12:31:16 172.17.0.1:44804 - - [2019-08-22T12:31:16Z] "PUT /RH.txt HTTP/1.1" 500 "" "curl/7.52.1" ^C[transfer.sh]2019/08/22 12:32:11 Server stopped. ``` Basedir exist, full access ```bash $ curl --upload-file ./torrents/RH.txt http://127.0.0.1:8080/RH.txt --verbose -H "Max-Days: 1" * Trying 127.0.0.1... * TCP_NODELAY set * Connected to 127.0.0.1 (127.0.0.1) port 8080 (#0) > PUT /RH.txt HTTP/1.1 > Host: 127.0.0.1:8080 > User-Agent: curl/7.52.1 > Accept: */* > Max-Days: 1 > Content-Length: 3340 > Expect: 100-continue > * Done waiting for 100-continue * We are completely uploaded and fine < HTTP/1.1 500 Internal Server Error < Content-Type: text/plain; charset=utf-8 < Server: Transfer.sh HTTP Server 1.0 < X-Content-Type-Options: nosniff < X-Made-With: <3 by DutchCoders < X-Served-By: Proudly served by DutchCoders < Date: Thu, 22 Aug 2019 12:32:19 GMT < Content-Length: 24 < Connection: close < Could not save metadata * Curl_http_done: called premature == 0 * Closing connection 0 ``` ```bash $ docker info Client: Debug Mode: false Server: Containers: 21 Running: 1 Paused: 0 Stopped: 20 Images: 10 Server Version: 19.03.1 Storage Driver: overlay2 Backing Filesystem: extfs Supports d_type: true Native Overlay Diff: true Logging Driver: json-file Cgroup Driver: cgroupfs Plugins: Volume: local Network: bridge host ipvlan macvlan null overlay Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog Swarm: inactive Runtimes: runc Default Runtime: runc Init Binary: docker-init containerd version: 894b81a4b802e4eb2a91d1ce216b8817763c29fb runc version: 425e105d5a03fabd737a126ad93d62a9eeede87f init version: fec3683 Security Options: seccomp Profile: default Kernel Version: 4.9.0-9-amd64 Operating System: Debian GNU/Linux 9 (stretch) OSType: linux Architecture: x86_64 CPUs: 4 Total Memory: 15.55GiB Name: raft ID: TZC5:PLKN:SHSE:INFZ:TXFG:SZRF:4WNK:ZQT7:7EAA:6LYR:XGCN:J2XT Docker Root Dir: /var/lib/docker Debug Mode: false Registry: https://index.docker.io/v1/ Labels: Experimental: false Insecure Registries: 127.0.0.0/8 Live Restore Enabled: false WARNING: No swap limit support ```
Author
Owner

@dtsdwarak commented on GitHub:

The same has been resolved in a previous issue - #187

Try something like the following -

$ docker run -d \
--restart always \
--publish 8080:8080 \
-v "/home/transfer:/transfer" dutchcoders/transfer.sh:latest \
--provider local \
--basedir=/transfer
@dtsdwarak commented on GitHub: The same has been resolved in a previous issue - #187 Try something like the following - ```bash $ docker run -d \ --restart always \ --publish 8080:8080 \ -v "/home/transfer:/transfer" dutchcoders/transfer.sh:latest \ --provider local \ --basedir=/transfer ```
Author
Owner

@dopessoa commented on GitHub:

The problem is that /tmp does not exist inside the docker container, the method used to create the directory in storage.go does not create directories recursively, so it can't create any of the temporary folders inside /tmp. I've sent a PR that fixes this issue.

On the other hand, the documentation should be improved to an example that works, adding an example with a volume would be nice too.

@dopessoa commented on GitHub: The problem is that /tmp does not exist inside the docker container, the method used to create the directory in storage.go does not create directories recursively, so it can't create any of the temporary folders inside /tmp. I've sent a PR that fixes this issue. On the other hand, the documentation should be improved to an example that works, adding an example with a volume would be nice too.
Author
Owner

@ichcc commented on GitHub:

Thanks a lot!

On 22 Aug, 2019, at 22:37, Dwaraka Nath notifications@github.com wrote:

The same has been resolved in a previous issue - #187 https://github.com/dutchcoders/transfer.sh/issues/187
Try something like the following -

$ docker run -d
--restart always
--publish 8080:8080
-v "/home/transfer:/transfer" dutchcoders/transfer.sh:latest
--provider local
--basedir=/transfer

You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub https://github.com/dutchcoders/transfer.sh/issues/257?email_source=notifications&email_token=ACAQ6LRBLFHWS3RN4AHD26TQF3TJBA5CNFSM4IOUPW42YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD46FCTY#issuecomment-524046671, or mute the thread https://github.com/notifications/unsubscribe-auth/ACAQ6LXL7YOQ7I452VU75RTQF3TJBANCNFSM4IOUPW4Q.

@ichcc commented on GitHub: Thanks a lot! > On 22 Aug, 2019, at 22:37, Dwaraka Nath <notifications@github.com> wrote: > > The same has been resolved in a previous issue - #187 <https://github.com/dutchcoders/transfer.sh/issues/187> > Try something like the following - > > $ docker run -d \ > --restart always \ > --publish 8080:8080 \ > -v "/home/transfer:/transfer" dutchcoders/transfer.sh:latest \ > --provider local \ > --basedir=/transfer > — > You are receiving this because you authored the thread. > Reply to this email directly, view it on GitHub <https://github.com/dutchcoders/transfer.sh/issues/257?email_source=notifications&email_token=ACAQ6LRBLFHWS3RN4AHD26TQF3TJBA5CNFSM4IOUPW42YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD46FCTY#issuecomment-524046671>, or mute the thread <https://github.com/notifications/unsubscribe-auth/ACAQ6LXL7YOQ7I452VU75RTQF3TJBANCNFSM4IOUPW4Q>. >
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: dutchcoders/transfer.sh#244