GeoNode2.8.0 installed from source Thumbnails Error

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

GeoNode2.8.0 installed from source Thumbnails Error

juliermeopensourcedeveloper
Dear Toni Schonbuchner and GeoNode developers,

First of all, my apologies to bring this topic back to discussion. I had already started with Toni, as shown in the message bellow.

I am digging into GeoNode scripts architecture trying to find an issue related to the creation of thumbnails. Let me introduce to you what I have done so far.


I have [hidden email] installed in a virtualenv according to http://docs.geonode.org/en/master/tutorials/install_and_admin/geonode_install/index.html. The thumbnails created by loading data from GeoNode interface do not work at all.

They are displayed if and only if I upload the layers from GeoServer interface and in a next step, run python manage.py updatelayers. It is very interesting what happens here: after running updatelayers, if I go to GeoNode interface, I see the thumbnail perfectly fine, but doing a right click over it and copy image location, the response is an OWS url as I am showing bellow. However If a make a request to the database, get_thumbnail_url, the response is a http://localhost:8000/. Why port 8000? Sorry to use this expression, this port 8000 is a nightmare, and I am digging deep trying to find its source.

If I remove port 8000, the thumbnails work like a charm in port 80.

After following all Toni's recommendations [1] [2] and [3] (please, see the message right in the bottom of this e-mail), I could not find port 8000 source. It is in somewhere, and I will keep looking for its source in GeoNode scripts.

A brilliant idea came out. Let's compare GeoNode@2.8.0 stable installed via apt-get with GeoNode@2.8.0 installed from source in a python virtualenv. I am going through GeoServer data path,  settings.py and local_settings.py, [1], helpers.py [2], and signals.py[3]. I am not sure that is a brilliant idea to find port 8000, my nightmare, but I found another issue in respect to GeoNode apt-get. This issue tells me that port 8000 is not the only one, there is another problem related to thumbnails that occurs either in GeoNode@2.8.0 installed from source  and GeoNode@2.8.0 installed via apt-get when updating thumbnails in GeoNode interface and I am showing it bellow:


GeoNode installed from source in a virtualenv

Thumbnail created by loading data from GeoNode Interface

Does not work at all

$ sudo geonode shell

>>> from geonode.layers.models import Layer
>>> layer = Layer.objects.all()
>>> for tn in layer:
...     print tn.get_thumbnail_url()
...

NOTE: The nightmare is here: port 8000. Why? I have set geoserver_location and geoserver_public_ location to port 8080. And there is proxy reverse in geonode.conf to port 80.


Thumbnail created by loading data from GeoServer Interface

Does not work at all

>>> from geonode.layers.models import Layer
>>> layer = Layer.objects.all()
>>> for tn in layer:
...     print tn.get_thumbnail_url()
...
http://localhost:8000/uploaded/thumbs/layer-cfe8a292-80d4-4c59-bff5-2c2245f15caf-thumb.png

NOTE:The nightmare is here: port 8000. Why? I have set geoserver_location and geoserver_public_ location to port 8080. And there is proxy reverse in geonode.conf to port 80.

HOWEVER: after running updatelayers for the first time without updating the thumbnail, there is a light at the end of the tunnel.

Thumbnails are displayed.

Right Click over thumbnail --> Copy image Location

A OWS url appears:


Why these urls patterns are different? One uses GeoServer, but the other do not.


Now, let's edit this layer (zoom in / zoom out) and Set Thumbnails

Layer --> Edit Layer --> Zoom in or Zoom out --> Set Thumbnails


Error message:
The image 'http://localhost/uploaded/thumbs/layer-2524c8db-726e-4050-9689-055dc0bb9aaa-thumb.png' cannot be displayed because it contains errors.


CONCLUSION GEONODE INSTALLED BY SOURCE: There are two issues: port 8000 and thumbnails update.


GEONODE INSTALLED VIA APT-GET


Thumbnail created by loading data from GeoNode Interface

Works like a charm

$ sudo geonode shell

>>> from geonode.layers.models import Layer
>>> layer = Layer.objects.all()
>>> for tn in layer:
...     print tn.get_thumbnail_url()
...
http://localhost/uploaded/thumbs/layer-f519c8d4-6b35-11e8-90e2-080027ac8c10-thumb.png

Now, let's edit this layer (zoom in / zoom out) and Set Thumbnail

Layer --> Edit Layer --> Zoom in or Zoom out --> Set Thumbnails


Error message:
The image 'http://localhost/uploaded/thumbs/layer-a7c6035e-6b49-11e8-90e2-080027ac8c10-thumb.png' cannot be displayed because it contains errors.


Thumbnail created by loading data from GeoServer Interface

Works like a charm

>>> from geonode.layers.models import Layer
>>> layer = Layer.objects.all()
>>> for tn in layer:
...     print tn.get_thumbnail_url()
...
http://localhost/uploaded/thumbs/layer-2524c8db-726e-4050-9689-055dc0bb9aaa-thumb.png

Right Click over thumbnail blank image --> Copy image Location


Now, let's edit this layer (zoom in / zoom out) and Set Thumbnails

Layer --> Edit Layer --> Zoom in or Zoom out --> Set Thumbnails


Error message:
The image 'http://localhost/uploaded/thumbs/layer-2524c8db-726e-4050-9689-055dc0bb9aaa-thumb.png' cannot be displayed because it contains errors.

CONCLUSION GEONODE INSTALLED VIA APT-GET: There is only one issue: Thumbnails update.

As I said above, I do not know if it is a good idea, but I will keep comparing [1] [2] and [3] in GeoNode apt-get and GeoNode virtualenv in order to find port 8000 source. However the issue related to updating GeoNode thumbnails  I have no clue.


Sorry for this long e-mail. Thank you for your time in advance. I appreciated your help and attention.


Dear Julierme,

I think  using grep does not really help to get insights.
Why not look at the code? The geoserver URL is composed
in settings.py [1]. I think here you will find your 8000.

Next I think the best way to see what´s going on is to have
a look at the helpers.py [2]. Here you should find the code which
is responsible for creating thumbnails and here [3] the signal
which you see in stdout logging. If there is some time I will
do a dev installation and will test it as well.

Further you´ve asked if there is something like geonode-updateip 
for an installation by source? Not that I know of but yes it would be helpful.
But it should not be to hard to write a little script which does the job.
Have a look what geonode-updateip actually does [4] it programatically changes
the parts which the documentation [5] explains regarding auth.

I hope this helps a bit.
Best greetings to Brasilia!

Toni





_______________________________________________
geonode-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/geonode-users
Reply | Threaded
Open this post in threaded view
|

Re: GeoNode2.8.0 installed from source Thumbnails Error

Alessio Fabiani-2

Il giorno ven 8 giu 2018 alle ore 22:26 Julierme Pinheiro <[hidden email]> ha scritto:
Dear Toni Schonbuchner and GeoNode developers,

First of all, my apologies to bring this topic back to discussion. I had already started with Toni, as shown in the message bellow.

I am digging into GeoNode scripts architecture trying to find an issue related to the creation of thumbnails. Let me introduce to you what I have done so far.


I have [hidden email] installed in a virtualenv according to http://docs.geonode.org/en/master/tutorials/install_and_admin/geonode_install/index.html. The thumbnails created by loading data from GeoNode interface do not work at all.

They are displayed if and only if I upload the layers from GeoServer interface and in a next step, run python manage.py updatelayers. It is very interesting what happens here: after running updatelayers, if I go to GeoNode interface, I see the thumbnail perfectly fine, but doing a right click over it and copy image location, the response is an OWS url as I am showing bellow. However If a make a request to the database, get_thumbnail_url, the response is a http://localhost:8000/. Why port 8000? Sorry to use this expression, this port 8000 is a nightmare, and I am digging deep trying to find its source.

If I remove port 8000, the thumbnails work like a charm in port 80.

After following all Toni's recommendations [1] [2] and [3] (please, see the message right in the bottom of this e-mail), I could not find port 8000 source. It is in somewhere, and I will keep looking for its source in GeoNode scripts.

A brilliant idea came out. Let's compare GeoNode@2.8.0 stable installed via apt-get with GeoNode@2.8.0 installed from source in a python virtualenv. I am going through GeoServer data path,  settings.py and local_settings.py, [1], helpers.py [2], and signals.py[3]. I am not sure that is a brilliant idea to find port 8000, my nightmare, but I found another issue in respect to GeoNode apt-get. This issue tells me that port 8000 is not the only one, there is another problem related to thumbnails that occurs either in GeoNode@2.8.0 installed from source  and GeoNode@2.8.0 installed via apt-get when updating thumbnails in GeoNode interface and I am showing it bellow:


GeoNode installed from source in a virtualenv

Thumbnail created by loading data from GeoNode Interface

Does not work at all

$ sudo geonode shell

>>> from geonode.layers.models import Layer
>>> layer = Layer.objects.all()
>>> for tn in layer:
...     print tn.get_thumbnail_url()
...

NOTE: The nightmare is here: port 8000. Why? I have set geoserver_location and geoserver_public_ location to port 8080. And there is proxy reverse in geonode.conf to port 80.


Thumbnail created by loading data from GeoServer Interface

Does not work at all

>>> from geonode.layers.models import Layer
>>> layer = Layer.objects.all()
>>> for tn in layer:
...     print tn.get_thumbnail_url()
...
http://localhost:8000/uploaded/thumbs/layer-cfe8a292-80d4-4c59-bff5-2c2245f15caf-thumb.png

NOTE:The nightmare is here: port 8000. Why? I have set geoserver_location and geoserver_public_ location to port 8080. And there is proxy reverse in geonode.conf to port 80.

HOWEVER: after running updatelayers for the first time without updating the thumbnail, there is a light at the end of the tunnel.

Thumbnails are displayed.

Right Click over thumbnail --> Copy image Location

A OWS url appears:


Why these urls patterns are different? One uses GeoServer, but the other do not.


Now, let's edit this layer (zoom in / zoom out) and Set Thumbnails

Layer --> Edit Layer --> Zoom in or Zoom out --> Set Thumbnails


Error message:
The image 'http://localhost/uploaded/thumbs/layer-2524c8db-726e-4050-9689-055dc0bb9aaa-thumb.png' cannot be displayed because it contains errors.


CONCLUSION GEONODE INSTALLED BY SOURCE: There are two issues: port 8000 and thumbnails update.


GEONODE INSTALLED VIA APT-GET


Thumbnail created by loading data from GeoNode Interface

Works like a charm

$ sudo geonode shell

>>> from geonode.layers.models import Layer
>>> layer = Layer.objects.all()
>>> for tn in layer:
...     print tn.get_thumbnail_url()
...
http://localhost/uploaded/thumbs/layer-f519c8d4-6b35-11e8-90e2-080027ac8c10-thumb.png

Now, let's edit this layer (zoom in / zoom out) and Set Thumbnail

Layer --> Edit Layer --> Zoom in or Zoom out --> Set Thumbnails


Error message:
The image 'http://localhost/uploaded/thumbs/layer-a7c6035e-6b49-11e8-90e2-080027ac8c10-thumb.png' cannot be displayed because it contains errors.


Thumbnail created by loading data from GeoServer Interface

Works like a charm

>>> from geonode.layers.models import Layer
>>> layer = Layer.objects.all()
>>> for tn in layer:
...     print tn.get_thumbnail_url()
...
http://localhost/uploaded/thumbs/layer-2524c8db-726e-4050-9689-055dc0bb9aaa-thumb.png

Right Click over thumbnail blank image --> Copy image Location


Now, let's edit this layer (zoom in / zoom out) and Set Thumbnails

Layer --> Edit Layer --> Zoom in or Zoom out --> Set Thumbnails


Error message:
The image 'http://localhost/uploaded/thumbs/layer-2524c8db-726e-4050-9689-055dc0bb9aaa-thumb.png' cannot be displayed because it contains errors.

CONCLUSION GEONODE INSTALLED VIA APT-GET: There is only one issue: Thumbnails update.

As I said above, I do not know if it is a good idea, but I will keep comparing [1] [2] and [3] in GeoNode apt-get and GeoNode virtualenv in order to find port 8000 source. However the issue related to updating GeoNode thumbnails  I have no clue.


Sorry for this long e-mail. Thank you for your time in advance. I appreciated your help and attention.


Dear Julierme,

I think  using grep does not really help to get insights.
Why not look at the code? The geoserver URL is composed
in settings.py [1]. I think here you will find your 8000.

Next I think the best way to see what´s going on is to have
a look at the helpers.py [2]. Here you should find the code which
is responsible for creating thumbnails and here [3] the signal
which you see in stdout logging. If there is some time I will
do a dev installation and will test it as well.

Further you´ve asked if there is something like geonode-updateip 
for an installation by source? Not that I know of but yes it would be helpful.
But it should not be to hard to write a little script which does the job.
Have a look what geonode-updateip actually does [4] it programatically changes
the parts which the documentation [5] explains regarding auth.

I hope this helps a bit.
Best greetings to Brasilia!

Toni




_______________________________________________
geonode-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/geonode-users


--

==

GeoServer Professional Services from the experts! Visit http://goo.gl/it488V for more information.
==
Ing. Alessio Fabiani

@alfa7691
Founder/Technical Lead


GeoSolutions S.A.S.
Via di Montramito 3/A - 55054  Massarosa (LU) - Italy
phone: +39 0584 962313
fax:     +39 0584 1660272
mob:   +39 331 6233686


http://www.geo-solutions.it
http://twitter.com/geosolutions_it
-------------------------------------------------------

Con riferimento alla normativa sul trattamento dei dati personali (Reg. UE 2016/679 - Regolamento generale sulla protezione dei dati “GDPR”), si precisa che ogni circostanza inerente alla presente email (il suo contenuto, gli eventuali allegati, etc.) è un dato la cui conoscenza è riservata al/i solo/i destinatario/i indicati dallo scrivente. Se il messaggio Le è giunto per errore, è tenuta/o a cancellarlo, ogni altra operazione è illecita. Le sarei comunque grato se potesse darmene notizia.


This email is intended only for the person or entity to which it is addressed and may contain information that is privileged, confidential or otherwise protected from disclosure. We remind that - as provided by European Regulation 2016/679 “GDPR” - copying, dissemination or use of this e-mail or the information herein by anyone other than the intended recipient is prohibited. If you have received this email by mistake, please notify us immediately by telephone or e-mail.


_______________________________________________
geonode-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/geonode-users
Reply | Threaded
Open this post in threaded view
|

Re: GeoNode2.8.0 installed from source Thumbnails Error

jesdial
I suppose that Julierme is following this tutorial:


( in fact, I also did and got exactly the same error). In that tutorial all the URLs related to localhost in the last two steps/pages are set to "http://localhost".

Regards

Jesús de Diego

2018-06-12 17:20 GMT+02:00 Alessio Fabiani <[hidden email]>:

Il giorno ven 8 giu 2018 alle ore 22:26 Julierme Pinheiro <[hidden email]> ha scritto:
Dear Toni Schonbuchner and GeoNode developers,

First of all, my apologies to bring this topic back to discussion. I had already started with Toni, as shown in the message bellow.

I am digging into GeoNode scripts architecture trying to find an issue related to the creation of thumbnails. Let me introduce to you what I have done so far.


I have [hidden email] installed in a virtualenv according to http://docs.geonode.org/en/master/tutorials/install_and_admin/geonode_install/index.html. The thumbnails created by loading data from GeoNode interface do not work at all.

They are displayed if and only if I upload the layers from GeoServer interface and in a next step, run python manage.py updatelayers. It is very interesting what happens here: after running updatelayers, if I go to GeoNode interface, I see the thumbnail perfectly fine, but doing a right click over it and copy image location, the response is an OWS url as I am showing bellow. However If a make a request to the database, get_thumbnail_url, the response is a http://localhost:8000/. Why port 8000? Sorry to use this expression, this port 8000 is a nightmare, and I am digging deep trying to find its source.

If I remove port 8000, the thumbnails work like a charm in port 80.

After following all Toni's recommendations [1] [2] and [3] (please, see the message right in the bottom of this e-mail), I could not find port 8000 source. It is in somewhere, and I will keep looking for its source in GeoNode scripts.

A brilliant idea came out. Let's compare GeoNode@2.8.0 stable installed via apt-get with GeoNode@2.8.0 installed from source in a python virtualenv. I am going through GeoServer data path,  settings.py and local_settings.py, [1], helpers.py [2], and signals.py[3]. I am not sure that is a brilliant idea to find port 8000, my nightmare, but I found another issue in respect to GeoNode apt-get. This issue tells me that port 8000 is not the only one, there is another problem related to thumbnails that occurs either in GeoNode@2.8.0 installed from source  and GeoNode@2.8.0 installed via apt-get when updating thumbnails in GeoNode interface and I am showing it bellow:


GeoNode installed from source in a virtualenv

Thumbnail created by loading data from GeoNode Interface

Does not work at all

$ sudo geonode shell

>>> from geonode.layers.models import Layer
>>> layer = Layer.objects.all()
>>> for tn in layer:
...     print tn.get_thumbnail_url()
...

NOTE: The nightmare is here: port 8000. Why? I have set geoserver_location and geoserver_public_ location to port 8080. And there is proxy reverse in geonode.conf to port 80.


Thumbnail created by loading data from GeoServer Interface

Does not work at all

>>> from geonode.layers.models import Layer
>>> layer = Layer.objects.all()
>>> for tn in layer:
...     print tn.get_thumbnail_url()
...
http://localhost:8000/uploaded/thumbs/layer-cfe8a292-80d4-4c59-bff5-2c2245f15caf-thumb.png

NOTE:The nightmare is here: port 8000. Why? I have set geoserver_location and geoserver_public_ location to port 8080. And there is proxy reverse in geonode.conf to port 80.

HOWEVER: after running updatelayers for the first time without updating the thumbnail, there is a light at the end of the tunnel.

Thumbnails are displayed.

Right Click over thumbnail --> Copy image Location

A OWS url appears:


Why these urls patterns are different? One uses GeoServer, but the other do not.


Now, let's edit this layer (zoom in / zoom out) and Set Thumbnails

Layer --> Edit Layer --> Zoom in or Zoom out --> Set Thumbnails


Error message:
The image 'http://localhost/uploaded/thumbs/layer-2524c8db-726e-4050-9689-055dc0bb9aaa-thumb.png' cannot be displayed because it contains errors.


CONCLUSION GEONODE INSTALLED BY SOURCE: There are two issues: port 8000 and thumbnails update.


GEONODE INSTALLED VIA APT-GET


Thumbnail created by loading data from GeoNode Interface

Works like a charm

$ sudo geonode shell

>>> from geonode.layers.models import Layer
>>> layer = Layer.objects.all()
>>> for tn in layer:
...     print tn.get_thumbnail_url()
...
http://localhost/uploaded/thumbs/layer-f519c8d4-6b35-11e8-90e2-080027ac8c10-thumb.png

Now, let's edit this layer (zoom in / zoom out) and Set Thumbnail

Layer --> Edit Layer --> Zoom in or Zoom out --> Set Thumbnails


Error message:
The image 'http://localhost/uploaded/thumbs/layer-a7c6035e-6b49-11e8-90e2-080027ac8c10-thumb.png' cannot be displayed because it contains errors.


Thumbnail created by loading data from GeoServer Interface

Works like a charm

>>> from geonode.layers.models import Layer
>>> layer = Layer.objects.all()
>>> for tn in layer:
...     print tn.get_thumbnail_url()
...
http://localhost/uploaded/thumbs/layer-2524c8db-726e-4050-9689-055dc0bb9aaa-thumb.png

Right Click over thumbnail blank image --> Copy image Location


Now, let's edit this layer (zoom in / zoom out) and Set Thumbnails

Layer --> Edit Layer --> Zoom in or Zoom out --> Set Thumbnails


Error message:
The image 'http://localhost/uploaded/thumbs/layer-2524c8db-726e-4050-9689-055dc0bb9aaa-thumb.png' cannot be displayed because it contains errors.

CONCLUSION GEONODE INSTALLED VIA APT-GET: There is only one issue: Thumbnails update.

As I said above, I do not know if it is a good idea, but I will keep comparing [1] [2] and [3] in GeoNode apt-get and GeoNode virtualenv in order to find port 8000 source. However the issue related to updating GeoNode thumbnails  I have no clue.


Sorry for this long e-mail. Thank you for your time in advance. I appreciated your help and attention.


Dear Julierme,

I think  using grep does not really help to get insights.
Why not look at the code? The geoserver URL is composed
in settings.py [1]. I think here you will find your 8000.

Next I think the best way to see what´s going on is to have
a look at the helpers.py [2]. Here you should find the code which
is responsible for creating thumbnails and here [3] the signal
which you see in stdout logging. If there is some time I will
do a dev installation and will test it as well.

Further you´ve asked if there is something like geonode-updateip 
for an installation by source? Not that I know of but yes it would be helpful.
But it should not be to hard to write a little script which does the job.
Have a look what geonode-updateip actually does [4] it programatically changes
the parts which the documentation [5] explains regarding auth.

I hope this helps a bit.
Best greetings to Brasilia!

Toni




_______________________________________________
geonode-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/geonode-users


--

==

GeoServer Professional Services from the experts! Visit http://goo.gl/it488V for more information.
==
Ing. Alessio Fabiani

@alfa7691
Founder/Technical Lead


GeoSolutions S.A.S.
Via di Montramito 3/A - 55054  Massarosa (LU) - Italy
phone: +39 0584 962313
fax:     +39 0584 1660272
mob:   +39 331 6233686


http://www.geo-solutions.it
http://twitter.com/geosolutions_it
-------------------------------------------------------

Con riferimento alla normativa sul trattamento dei dati personali (Reg. UE 2016/679 - Regolamento generale sulla protezione dei dati “GDPR”), si precisa che ogni circostanza inerente alla presente email (il suo contenuto, gli eventuali allegati, etc.) è un dato la cui conoscenza è riservata al/i solo/i destinatario/i indicati dallo scrivente. Se il messaggio Le è giunto per errore, è tenuta/o a cancellarlo, ogni altra operazione è illecita. Le sarei comunque grato se potesse darmene notizia.


This email is intended only for the person or entity to which it is addressed and may contain information that is privileged, confidential or otherwise protected from disclosure. We remind that - as provided by European Regulation 2016/679 “GDPR” - copying, dissemination or use of this e-mail or the information herein by anyone other than the intended recipient is prohibited. If you have received this email by mistake, please notify us immediately by telephone or e-mail.


_______________________________________________
geonode-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/geonode-users




--
Jesús de Diego Alarcón
[hidden email]

"La vida es linda, lo malo es que muchos confunden lindo con fácil."
Mafalda

_______________________________________________
geonode-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/geonode-users
Reply | Threaded
Open this post in threaded view
|

Re: GeoNode2.8.0 installed from source Thumbnails Error

juliermeopensourcedeveloper
In reply to this post by Alessio Fabiani-2
Hi Alessio Fabiani,

Thank you very much for your reply. Sorry, I missed your question in here. Accordingly to [1] SITEURL should be configured as:

SITEURL = 'http://localhost' 

which is the same as

SITEURL = os.getenv('SITEURL', "http://localhost/") # if I am not wrong.

Now, I am comparing GeoNode@2.8.0 Production (GP) and GeoNode@2.8.0 DevMode (GD) which has the thumbnails working a lot better. In GP WSGI_APPLICATION is set as the following:

local_settings.py (according to [1])

WSGI_APPLICATION = "my_geonode.wsgi.application"
settings.py

PROJECT_NAME = 'my_geonode'

WSGI_APPLICATION = "{}.wsgi.application".format (PROJECT_NAME)

printing the variable WSGI_APPLICATION on python terminal, the response is >my_geonode.wsgi.application<

In the other hand GD WSGI_APPLICATION is set as the following:


local_settings.py (according to [1])

Not available.

settings.py

PROJECT_NAME = 'my_geonode'

WSGI_APPLICATION = "{}.wsgi.application".format (PROJECT_NAME)

which is equal to
WSGI_APPLICATION = "my_geonode.wsgi.application"  # If I am not wrong

I appreciated your time.

Julierme



On Tue, Jun 12, 2018 at 12:20 PM, Alessio Fabiani <[hidden email]> wrote:

Il giorno ven 8 giu 2018 alle ore 22:26 Julierme Pinheiro <[hidden email]> ha scritto:
Dear Toni Schonbuchner and GeoNode developers,

First of all, my apologies to bring this topic back to discussion. I had already started with Toni, as shown in the message bellow.

I am digging into GeoNode scripts architecture trying to find an issue related to the creation of thumbnails. Let me introduce to you what I have done so far.


I have [hidden email] installed in a virtualenv according to http://docs.geonode.org/en/master/tutorials/install_and_admin/geonode_install/index.html. The thumbnails created by loading data from GeoNode interface do not work at all.

They are displayed if and only if I upload the layers from GeoServer interface and in a next step, run python manage.py updatelayers. It is very interesting what happens here: after running updatelayers, if I go to GeoNode interface, I see the thumbnail perfectly fine, but doing a right click over it and copy image location, the response is an OWS url as I am showing bellow. However If a make a request to the database, get_thumbnail_url, the response is a http://localhost:8000/. Why port 8000? Sorry to use this expression, this port 8000 is a nightmare, and I am digging deep trying to find its source.

If I remove port 8000, the thumbnails work like a charm in port 80.

After following all Toni's recommendations [1] [2] and [3] (please, see the message right in the bottom of this e-mail), I could not find port 8000 source. It is in somewhere, and I will keep looking for its source in GeoNode scripts.

A brilliant idea came out. Let's compare GeoNode@2.8.0 stable installed via apt-get with GeoNode@2.8.0 installed from source in a python virtualenv. I am going through GeoServer data path,  settings.py and local_settings.py, [1], helpers.py [2], and signals.py[3]. I am not sure that is a brilliant idea to find port 8000, my nightmare, but I found another issue in respect to GeoNode apt-get. This issue tells me that port 8000 is not the only one, there is another problem related to thumbnails that occurs either in GeoNode@2.8.0 installed from source  and GeoNode@2.8.0 installed via apt-get when updating thumbnails in GeoNode interface and I am showing it bellow:


GeoNode installed from source in a virtualenv

Thumbnail created by loading data from GeoNode Interface

Does not work at all

$ sudo geonode shell

>>> from geonode.layers.models import Layer
>>> layer = Layer.objects.all()
>>> for tn in layer:
...     print tn.get_thumbnail_url()
...

NOTE: The nightmare is here: port 8000. Why? I have set geoserver_location and geoserver_public_ location to port 8080. And there is proxy reverse in geonode.conf to port 80.


Thumbnail created by loading data from GeoServer Interface

Does not work at all

>>> from geonode.layers.models import Layer
>>> layer = Layer.objects.all()
>>> for tn in layer:
...     print tn.get_thumbnail_url()
...
http://localhost:8000/uploaded/thumbs/layer-cfe8a292-80d4-4c59-bff5-2c2245f15caf-thumb.png

NOTE:The nightmare is here: port 8000. Why? I have set geoserver_location and geoserver_public_ location to port 8080. And there is proxy reverse in geonode.conf to port 80.

HOWEVER: after running updatelayers for the first time without updating the thumbnail, there is a light at the end of the tunnel.

Thumbnails are displayed.

Right Click over thumbnail --> Copy image Location

A OWS url appears:


Why these urls patterns are different? One uses GeoServer, but the other do not.


Now, let's edit this layer (zoom in / zoom out) and Set Thumbnails

Layer --> Edit Layer --> Zoom in or Zoom out --> Set Thumbnails


Error message:
The image 'http://localhost/uploaded/thumbs/layer-2524c8db-726e-4050-9689-055dc0bb9aaa-thumb.png' cannot be displayed because it contains errors.


CONCLUSION GEONODE INSTALLED BY SOURCE: There are two issues: port 8000 and thumbnails update.


GEONODE INSTALLED VIA APT-GET


Thumbnail created by loading data from GeoNode Interface

Works like a charm

$ sudo geonode shell

>>> from geonode.layers.models import Layer
>>> layer = Layer.objects.all()
>>> for tn in layer:
...     print tn.get_thumbnail_url()
...
http://localhost/uploaded/thumbs/layer-f519c8d4-6b35-11e8-90e2-080027ac8c10-thumb.png

Now, let's edit this layer (zoom in / zoom out) and Set Thumbnail

Layer --> Edit Layer --> Zoom in or Zoom out --> Set Thumbnails


Error message:
The image 'http://localhost/uploaded/thumbs/layer-a7c6035e-6b49-11e8-90e2-080027ac8c10-thumb.png' cannot be displayed because it contains errors.


Thumbnail created by loading data from GeoServer Interface

Works like a charm

>>> from geonode.layers.models import Layer
>>> layer = Layer.objects.all()
>>> for tn in layer:
...     print tn.get_thumbnail_url()
...
http://localhost/uploaded/thumbs/layer-2524c8db-726e-4050-9689-055dc0bb9aaa-thumb.png

Right Click over thumbnail blank image --> Copy image Location


Now, let's edit this layer (zoom in / zoom out) and Set Thumbnails

Layer --> Edit Layer --> Zoom in or Zoom out --> Set Thumbnails


Error message:
The image 'http://localhost/uploaded/thumbs/layer-2524c8db-726e-4050-9689-055dc0bb9aaa-thumb.png' cannot be displayed because it contains errors.

CONCLUSION GEONODE INSTALLED VIA APT-GET: There is only one issue: Thumbnails update.

As I said above, I do not know if it is a good idea, but I will keep comparing [1] [2] and [3] in GeoNode apt-get and GeoNode virtualenv in order to find port 8000 source. However the issue related to updating GeoNode thumbnails  I have no clue.


Sorry for this long e-mail. Thank you for your time in advance. I appreciated your help and attention.


Dear Julierme,

I think  using grep does not really help to get insights.
Why not look at the code? The geoserver URL is composed
in settings.py [1]. I think here you will find your 8000.

Next I think the best way to see what´s going on is to have
a look at the helpers.py [2]. Here you should find the code which
is responsible for creating thumbnails and here [3] the signal
which you see in stdout logging. If there is some time I will
do a dev installation and will test it as well.

Further you´ve asked if there is something like geonode-updateip 
for an installation by source? Not that I know of but yes it would be helpful.
But it should not be to hard to write a little script which does the job.
Have a look what geonode-updateip actually does [4] it programatically changes
the parts which the documentation [5] explains regarding auth.

I hope this helps a bit.
Best greetings to Brasilia!

Toni




_______________________________________________
geonode-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/geonode-users


--

==

GeoServer Professional Services from the experts! Visit http://goo.gl/it488V for more information.
==
Ing. Alessio Fabiani

@alfa7691
Founder/Technical Lead


GeoSolutions S.A.S.
Via di Montramito 3/A - 55054  Massarosa (LU) - Italy
phone: +39 0584 962313
fax:     +39 0584 1660272
mob:   +39 331 6233686


http://www.geo-solutions.it
http://twitter.com/geosolutions_it
-------------------------------------------------------

Con riferimento alla normativa sul trattamento dei dati personali (Reg. UE 2016/679 - Regolamento generale sulla protezione dei dati “GDPR”), si precisa che ogni circostanza inerente alla presente email (il suo contenuto, gli eventuali allegati, etc.) è un dato la cui conoscenza è riservata al/i solo/i destinatario/i indicati dallo scrivente. Se il messaggio Le è giunto per errore, è tenuta/o a cancellarlo, ogni altra operazione è illecita. Le sarei comunque grato se potesse darmene notizia.


This email is intended only for the person or entity to which it is addressed and may contain information that is privileged, confidential or otherwise protected from disclosure. We remind that - as provided by European Regulation 2016/679 “GDPR” - copying, dissemination or use of this e-mail or the information herein by anyone other than the intended recipient is prohibited. If you have received this email by mistake, please notify us immediately by telephone or e-mail.



_______________________________________________
geonode-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/geonode-users