[GeoNode-users] GeoNode2.8.0 installed from source Thumbnails Error

Alessio Fabiani alessio.fabiani at geo-solutions.it
Tue Jun 12 08:20:07 PDT 2018


Have you correctly configured the SITEURL?

https://github.com/GeoNode/geonode/blob/2.8.0/geonode/settings.py#L632



Il giorno ven 8 giu 2018 alle ore 22:26 Julierme Pinheiro <
juliermeopensourcedeveloper at gmail.com> 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 GeoNode at 2.8.0. 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 at 2.8.0 stable installed
> via apt-get with GeoNode at 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 at 2.8.0 installed from source  and
> GeoNode at 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()
> ...
>
> http://localhost:8000/uploaded/thumbs/layer-d3b7e06c-6b4a-11e8-a4cc-0800277e2fd3-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.
>
>
> *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
> <http://localhost/uploaded/thumbs/layer-2524c8db-726e-4050-9689-055dc0bb9aaa-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.
>
>
> <http://localhost/uploaded/thumbs/layer-2524c8db-726e-4050-9689-055dc0bb9aaa-thumb.png>
> *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
> *:*
>
>
> http://localhost:8080/geoserver/ows?layers=geonode:GPS&crs=EPSG:4326&service=WMS&format=image/png8&request=GetMap&height=150&width=200&version=1.1.1&bbox=-69.935496180600000,-29.789445458300000,-35.777101013900000,0.047035064700000
>
> 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*
>
> Thumbnails url (
> http://localhost/uploaded/thumbs/layer-2524c8db-726e-4050-9689-055dc0bb9aaa-thumb.png)
> does not work properly.
>
> *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*
>
> Thumbnail url (
> http://localhost/uploaded/thumbs/layer-a7c6035e-6b49-11e8-90e2-080027ac8c10-thumb.png)
> does not work properly.
>
> *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*
>
>
> http://localhost/geoserver/ows?layers=geonode:RBMC&crs=EPSG:4326&service=WMS&format=image/png8&request=GetMap&height=150&width=200&version=1.1.1&bbox=-64.706650088900000,-31.802449444400000,-35.777101013900000,0.047035064700000
>
> *Now, let's edit this layer (zoom in / zoom out) and Set Thumbnails *
>
> *Layer --> Edit Layer --> Zoom in or Zoom out --> Set Thumbnails*
>
> Thumbnails url (
> http://localhost/uploaded/thumbs/layer-2524c8db-726e-4050-9689-055dc0bb9aaa-thumb.png)
> does not work properly.
>
> *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
>
>
> [1] https://github.com/GeoNode/geonode/blob/2.8.0/geonode/settings.py#L650
> [2]
> https://github.com/GeoNode/geonode/blob/master/geonode/geoserver/helpers.py#L1730
> [3]
> https://github.com/GeoNode/geonode/blob/df12893ced001973bd748f86d08fa6ae4c10dde9/geonode/geoserver/signals.py#L497
> [4]
> https://github.com/GeoNode/geonode/blob/df12893ced001973bd748f86d08fa6ae4c10dde9/package/support/geonode.updateip#L126
> [5]
> http://docs.geonode.org/en/master/tutorials/install_and_admin/geonode_install/install_geoserver_application.html#geonode-authentication-integration
>
>
> _______________________________________________
> geonode-users mailing list
> geonode-users at lists.osgeo.org
> 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/geonode-users/attachments/20180612/90a46b0a/attachment-0001.html>


More information about the geonode-users mailing list