GeoNode / geonode

GeoNode is an open source platform that facilitates the creation, sharing, and collaborative use of geospatial data.
https://geonode.org/
Other
1.43k stars 1.12k forks source link

django.http.request.RawPostDataException on dataset upload #11543

Open Raji-Ahmad opened 11 months ago

Raji-Ahmad commented 11 months ago

I get Error 500 on my new installation of geonode when uploading dataset. Inspecting further I saw this error log

File "/docs/geon/geonode/geonode/proxy/views.py", line 185, in proxy _data = request.body.decode("utf-8") File "/docs/geon/tenv/lib/python3.10/site-packages/django/http/request.py", line 330, in body raise RawPostDataException("You cannot access body after reading from request's data stream") django.http.request.RawPostDataException: You cannot access body after reading from request's data stream

tulhaum commented 10 months ago

Same problem here. Did you find the solution ?

Raji-Ahmad commented 9 months ago

@tulhaum I had to reinstall from scratch

tulhaum commented 9 months ago

@tulhaum I had to reinstall from scratch

@Raji-Ahmad and did you notice some configuration different or new from the first install ? I have installed two times and the error persist. Did you follow some specific guide?

Raji-Ahmad commented 9 months ago

My previous installation was trying to configure Geonode on an existing Ubuntu instance with a different Geoserver and Django project already running on it. I tried to configure Geonode to use a new port and re-use the existing Geoserver instance, which resulted in the above error.

I got a new Ubuntu instance for Geonode and followed the documentation/guide carefully, but changed and customized the minimum things I needed for my use case. I probably changed some configurations too since I have a different setup.

nesangcode commented 2 months ago

any solution?

tulhaum commented 2 months ago

any solution?

After all, I realized that the problem is something related the way Geonode handle connections under reverse proxies in the version 4.x In my scenario, there is a Big-IP loadbalancer where my external URL is set with HTTPS/Letsencrypt and point to geonode Nginx at port 80. Despite all other configurations inside Geonode (UWSGI geonode.ini, etc) setting everything to HTTPS, I had to change the geonode nginx to operate ate port 443 using selfsigned certificate. After that, the problem was solved. In my previous Geonode version 2.x this wasn´t necessary, nginx at port 80 after Big-IP worked fine.

nesangcode commented 2 months ago

woah, in my case, it's fully operate at port 80. Can't I do that? I must have an HTTPS?

tulhaum commented 2 months ago

woah, in my case, it's fully operate at port 80. Can't I do that? I must have an HTTPS?

Yeah, you can. But in my case, a scenario with HTTPS(443) in frontend (BIG-IP) and HTTP(80) at backend didn´t work. In another case, frontend and backend both on port 80 worked fine too.

nesangcode commented 2 months ago

thank you