-
Notifications
You must be signed in to change notification settings - Fork 17
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
Upload page 503 Service Temporarily Not Available #11
Comments
It’s hard for me to debug with changes I don’t know, but I’d check if you exposed the port, and made sure to update the Nginx.conf, and also verify the temporary upload folders exist in /tmp. |
hi, I think I found the issue. The sub directories under _upload are missing and had to manually create all 0 to 9 directories. The command listed was creating _upload/{0..9} directory by default. After I created subdirectories That error is vanished but running into other errors. Here is the output from nginx error.log. I did not change any of your stuff. 2020/10/27 17:31:12 [error] 6#6: *2 open() "/var/www/static/img/favicon.ico" failed (2: No such file or directory), client: 10.255.0.2, server: localhost, request: "GET /static/img/favicon.ico HTTP/1.1", host: "dotiuasld01:50075", referrer: "http://dotiuasld01:50075/" |
Yes the instruction to create them is clearly stated in the README https://github.com/vsoch/django-nginx-upload#usage The second error message above suggests that you did not create the database, e.g., you didn't do the migrations. Again, I can't comment on the changes that you made, but I can say that the original version, clearly following the instructions, should work. |
the command listed below is creating the directory as it is. Not creating sub folders. sudo mkdir -p images/_upload/{0..9} && sudo chmod 777 -R images/_upload Also do I have to create the database manually? I don't see instructions. |
When execute docker deploy using your composefile creating 3 containers. One of them is db. |
It depends on having a bash shell, if you have something different or Windows you need to adjust for your needs. The migrations are done in the run_uwsgi.sh script, which is the container entrypoint: https://github.com/vsoch/django-nginx-upload/blob/master/run_uwsgi.sh. If this script isn't hit then there is something different or erroneous about your setup. |
Thanks. I see the script running as entry point I guess from the following output. 763ce969235f django-nginx-upload_uwsgi:latest "/bin/sh -c /code/ru…" 6 minutes ago Up 6 minutes 3031/tcp fileupload_uwsgi.1.cp8hvnczcv0oz51u2fpkrzvmq After I executed it manually inside the container it fixed the issue. Now I can see the uploaded file list. Here is the output after I executed it manually. Thanks for the pointer. Still not sure why its not executed. root@763ce969235f:/code# ./run_uwsgi.sh 0 static files copied to '/var/www/static', 121 unmodified. |
It's likely related to your operating system, and versions of Docker and docker-compose - I've had different results on different OS in personal experience. Glad it all worked out with the manual commands, feel free to close the issue if it's resolved. |
I will probably mention explicitly to execute as command in compose and test it out. Thanks for help. I will close it out. |
Thanks. |
Hi Vanessarauras,
A quick question. The current push.py handles one file at a time. Do you have a version that handles multi-file upload?
|
hey again! That’s really just provided as a dummy example, if you want to scale it I can imagine trying multiprocessing or similar, given using Python. If you come up with an example to supplement the current please please PR to contribute back to the repository! |
Sure. I will. But it is working like a charm. Just now I converted the compose file to use azure storage account mounts. It is working great for nginx uwsci containers. But for DB still have to use file system due to the limitation of postgres. I wanted to try multi-file upload. But I am not a web developer. I am a docker professional at ODOT.
|
Hey be careful about responding from email, I just deleted a bunch of your personal information from your signature from the last two comments that you likely don’t want out in the public on a GitHub comment. I’m not a web developer either and this is provided as a proof of concept for others to build on so I can only give suggestions. For smaller files it is in fact possible to save data (e.g images) directly to a binary field in the database (e.g. Postgres). I’ve done this for services like app engine that don’t support writing to a filesystem other than tmp. But when you are talking about multiple file upload there are two issues at hand - the client making multiple requests (e.g using multiprocessing) and the server being able to handle it. Since this is Nginx, it would mean scaling that, either adding more containers to the Docker compose or using something more like Kubernetes. I’m happy to give this advice but beyond that is out of scope for this repository. The challenge I had at the time was implementing this for Django, and so that’s the example implemented here and nothing more than that. |
hi I downloaded the files and made few changes to suit our docker environment and trying to run on port 50075. The initial upload page came up and then selected the files to upload from the pop-up selection box. Then I am getting the 503 Service Temporarily Available. Do I have to make any changes or missed any changes? Here is the screenshot of the error.
The text was updated successfully, but these errors were encountered: