i’m trying to enable hooks, so i ran tusd --hooks-dir ./tusd-hooks --upload-dir=./tusd-data/data
with in the tusd container and getting the following error unable to create listener, blind address already in use. of course tusd is on port 1080. Any ideas would be much appreciated?
[tusd] 2023/03/16 07:34:08.343102 Using ‘/srv/tusd-hooks/data’ as directory storage.
[tusd] 2023/03/16 07:34:08.345033 Using 0.00MB as maximum size.
[tusd] 2023/03/16 07:34:08.345077 Using ‘/srv/tusd-hooks/tusd-hooks’ for hooks
[tusd] 2023/03/16 07:34:08.345089 Enabled hook events: pre-create, post-create, post-receive, post-terminate, post-finish
[tusd] 2023/03/16 07:34:08.345141 Using 0.0.0.0:1080 as address to listen.
[tusd] 2023/03/16 07:34:08.345157 Using /files/ as the base path.
[tusd] 2023/03/16 07:34:08.345252 Using /metrics as the metrics path.
[tusd] 2023/03/16 07:34:08.345344 Supported tus extensions: creation,creation-with-upload,termination,concatenation,creation-defer-length
[tusd] 2023/03/16 07:34:08.374574 Unable to create listener: listen tcp 0.0.0.0:1080: bind: address already in use
Are you running two tusd processes inside the same containers? You do not need two processes for using hooks. The tusd process itself is able to listen for uploads and handle the hooks without a second process. You should use one tusd process and add the hooks flags to its command line.
Hi Marius,
thats what i was trying to do. i have tus running as a container and i though i was trying to add the hook flags by running tusd --hooks-dir ./tusd-hooks.
ended up adding a command in the docker-compose to add the flag but now running into other errors
[tusd] 2023/03/16 14:13:32.531622 event=“ResponseOutgoing” status=“500” method=“POST” path=“” error="pre-create hook failed: fork/exec /srv/tusd-hooks/pre-create: permission denied
" requestId=“66f6678f-8cfe-4b6e-a7cc-f2ec44b9b0e1”
tried to change the permissions on the pre-create file
if i delete this pre-create script so there are no hooks, restart tusd server, see logs and the upload fails
with unexpecrted response while uploading chunk,originated from request
This error means that the file pre-create is not executable. You must make sure that the file permissions of the hook file allow it to be executed inside the Docker container. Usually it is enough to run chmod +x pre-create, but maybe there is more required for Docker containers. Unfortunately, I am not Docker expert, but you should find something about this in other forums.
I don’t see any error in these logs. However, they only show the creation of multiple uploads, but no data is uploaded. It seems as if the PATCH requests to not make it to tusd. I would assume that you have some misconfigured proxy and would advise you to look at that. Also see tusd/faq.md at main · tus/tusd · GitHub