geonode icon indicating copy to clipboard operation
geonode copied to clipboard

Timeout while uploading large files in GeoNode/GeoServer

Open satigebah opened this issue 3 years ago • 9 comments

Hello I have some problems with geonode in docker. When I try to download a large layer, I have this problem:

Unexpected error! - 504 Gateway Timeout. GeoNode lost the connection with GeoServer or DB due to a connection timeout. Consider using the management commands to import data!

satigebah avatar Jul 27 '21 10:07 satigebah

The title says uploading, the description downloading. which one is it?

  • have a look at geoservers memory usage
  • have a look at uWSGI harakiri which lives in your django / celery container
    • https://github.com/GeoNode/geonode/blob/3.2.x/uwsgi.ini#L24

t-book avatar Jul 28 '21 09:07 t-book

basically i am facing uploading issue... it will be a pleasure having clear instructions of changing file upload size and increase time. its bit confusing and stlll unresolved

zahirulislamovich avatar Jul 28 '21 11:07 zahirulislamovich

@zahirulislamovich Unfortunately transferring a large amount over HTTP is cumbersome. For example, you can face many bottlenecks like: nginx max body size limits, python worker timeouts, geoserver memory issues, and so on. Is the management command importlayers of help for your task? Using it you can workaround several possible problems

t-book avatar Jul 28 '21 14:07 t-book

@t-book thanks. it is very useful as i currently use this to upload large files. (docker manage.py updatelayers) , @satigebah i assume this is the only solution as i am facing this sorts of issue for last 2 years which was solved only by manage layer. i appreciate geonode team for their great task. it will be the best of having a tutorial to external geoserver_data integration (for large files) and gdal integration. if its possible to ingest .sid file we can store so many gb data; as xample i have 25gb orthophoto in tiff but in .sid foormat its just 6 gb. Thanks again tony

zahirulislamovich avatar Jul 28 '21 17:07 zahirulislamovich

@t-book @zahirulislamovich Thank you for everything! I tested it and was able to add the layers with python manage.py importlayers

satigebah avatar Jul 28 '21 20:07 satigebah

I had the same issue a few days ago. And it's fixed when updating the harakiri param.

My instance was setup following the Geonode Project on Docker instructions (https://docs.geonode.org/en/master/install/advanced/project/index.html)

What I did was based on t-follow comment above, and this link: https://gis.stackexchange.com/questions/382710/timeout-while-uploading-large-files-in-geonode-geoserver

Steps:

  • Go to your project folder, check the uswgi.ini file: cd /opt/geonode_custom/my_geonode nano uwsgi.ini

  • Check the line when it says: harakiri = 60 --> increase this parameter to 600: harakiri = 600

  • Save and exit

  • Restart the containers: docker-compose stop docker-compose up -d

iandmozart avatar Jul 30 '21 00:07 iandmozart

I had the same issue, which is reported with the following error message:

Unexpected error! - Unknwon Error Code.
Contact the system administrator for more information regarding this error message.
Additional info:
    [Server Error: timeout
     Please check your network connection.
     In case of Layer Upload make sure GeoServer is running and accepting connections.]

To solve this, I increased the parameter harakiri to 600 as outlined above. In addition, I added the recommendation to upload larger files or when having a bad connection, using a backend driven approach:

  • upload to geonode container + importlayers management command
  • upload to geoserver + updatelayers management command.

Hope this helps, because the error message was quite confusing for me.

Maybe, someone can improve the error message or the data loading documentation, if not already done during the latest developments.

EHJ-52n avatar Feb 15 '22 15:02 EHJ-52n

@giohappy Why did you close this issue?

EHJ-52n avatar May 09 '22 11:05 EHJ-52n

By error @EHJ-52n, I was doing some housekeeping with old and stale issues. Do you have a patch to submit here to the documentation?

giohappy avatar May 09 '22 12:05 giohappy