<div dir="ltr"><div>Dear Toni Schonbuchner and GeoNode developers,</div><div><br></div><div>First of all, my apologies to bring this topic back to discussion. I had already started with Toni, as shown in the message bellow. <br></div><div><br></div><div>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.<br></div><div><br></div><div><br></div><div>I have <a href="mailto:GeoNode@2.8.0." target="_blank">GeoNode@2.8.0.</a> installed in a virtualenv according to <a href="http://docs.geonode.org/en/master/tutorials/install_and_admin/geonode_install/index.html" target="_blank">http://docs.geonode.org/en/<wbr>master/tutorials/install_and_<wbr>admin/geonode_install/index.<wbr>html</a>. The thumbnails created by loading data from GeoNode interface do not work at all.</div><div><br></div><div> 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 <a href="http://localhost:8000/" target="_blank">http://localhost:8000/</a>. Why port 8000? Sorry to use this expression, this port 8000 is a nightmare, and I am digging deep trying to find its source. <br></div><div><br></div><div>If I remove port 8000, the thumbnails work like a charm in port 80. <br></div><div><br></div><div>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. <br></div><div><br></div><div>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:</div><div><br></div><div></div><div></div><div><br></div><div><b>GeoNode installed from source in a virtualenv</b><br></div><div><br></div><div><div><font size="4"><span style="color:rgb(32,18,77)"><span style="background-color:rgb(255,255,255)"><b>Thumbnail created by loading data from GeoNode Interface</b></span></span></font></div><div><br></div><div><b>Does not work at all</b><br></div><div><br></div><div>$ sudo geonode shell<span style="background-color:rgb(255,255,255)"><span></span></span><br></div><div><br></div><div>>>> from geonode.layers.models import Layer<br>>>> layer = Layer.objects.all()<br>>>> for tn in layer:<br>...     print tn.get_thumbnail_url()</div>...</div><div></div><div><a href="http://localhost:8000/uploaded/thumbs/layer-d3b7e06c-6b4a-11e8-a4cc-0800277e2fd3-thumb.png" target="_blank">http://localhost:8000/<wbr>uploaded/thumbs/layer-<wbr>d3b7e06c-6b4a-11e8-a4cc-<wbr>0800277e2fd3-thumb.png</a></div><div><br></div><div><span style="color:rgb(32,18,77)"><b>NOTE:</b></span> 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. <br></div><div><br></div><div><br></div><div><div><font size="4"><span style="color:rgb(32,18,77)"><b>Thumbnail created by loading data from GeoServer Interface</b></span></font></div><div><br></div><div><b>Does not work at all </b><br></div><div><br></div><div>>>> from geonode.layers.models import Layer<br>>>> layer = Layer.objects.all()<br>>>> for tn in layer:<br>...     print tn.get_thumbnail_url()<br>... <br><a href="http://localhost/uploaded/thumbs/layer-2524c8db-726e-4050-9689-055dc0bb9aaa-thumb.png" target="_blank">http://localhost:8000/<wbr>uploaded/thumbs/layer-<wbr>cfe8a292-80d4-4c59-bff5-<wbr>2c2245f15caf-thumb.png</a></div><div><br></div><div><span style="color:rgb(32,18,77)"><b>NOTE:</b></span>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. <br></div><div><a href="http://localhost/uploaded/thumbs/layer-2524c8db-726e-4050-9689-055dc0bb9aaa-thumb.png" target="_blank"><b><br></b></a></div><div><b>HOWEVER: </b>after running updatelayers for the first time without updating the thumbnail, there is a light at the end of the tunnel. <br></div><div><div><br></div><div><span style="color:rgb(32,18,77)"><b>Thumbnails are displayed. </b></span><br></div><div><br></div><div><b>Right Click over thumbnail --> Copy image Location</b></div><div><b><br></b></div><div>A OWS url appears<b>:<br></b></div></div><div><br></div><div><a href="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" target="_blank">http://localhost:8080/<wbr>geoserver/ows?layers=geonode:<wbr>GPS&crs=EPSG:4326&service=WMS&<wbr>format=image/png8&request=<wbr>GetMap&height=150&width=200&<wbr>version=1.1.1&bbox=-69.<wbr>935496180600000,-29.<wbr>789445458300000,-35.<wbr>777101013900000,0.<wbr>047035064700000</a></div><div><br></div><div>Why these urls patterns are different? One uses GeoServer, but the other do not. <br></div><div></div><div><br></div></div><div><br></div><div><div><b>Now, let's edit this layer (zoom in / zoom out) and Set Thumbnails </b><br></div><div><br></div><div><i><b>Layer --> Edit Layer --> Zoom in or Zoom out --> Set Thumbnails</b></i></div><div><br></div><div>Thumbnails url (<a href="http://localhost/uploaded/thumbs/layer-2524c8db-726e-4050-9689-055dc0bb9aaa-thumb.png" target="_blank">http://localhost/uploaded/thu<wbr>mbs/layer-2524c8db-726e-4050-<wbr>9689-055dc0bb9aaa-thumb.png</a>) does not work properly.</div><div><br></div><div><b>Error message:</b> <br></div><div>The image '<a href="http://localhost/uploaded/thumbs/layer-2524c8db-726e-4050-9689-055dc0bb9aaa-thumb.png" target="_blank">http://localhost/uploaded/thu<wbr>mbs/layer-2524c8db-726e-4050-<wbr>9689-055dc0bb9aaa-thumb.png</a>' cannot be displayed because it contains errors.</div><div><br></div><div><br></div><div><b>CONCLUSION GEONODE INSTALLED BY SOURCE:</b> There are two issues: <u>port 8000</u> and <u>thumbnails update.</u><br></div><br></div><div><br></div><div><span style="color:rgb(32,18,77)"><b>GEONODE INSTALLED VIA APT-GET </b></span><br></div><div><br></div><div><br></div><div>Thumbnail created by loading data from GeoNode Interface</div><div><br></div><div><b>Works like a charm </b><br></div><div><br></div><div>$ sudo geonode shell<br></div><div><br></div><div>>>> from geonode.layers.models import Layer<br>>>> layer = Layer.objects.all()<br>>>> for tn in layer:<br>...     print tn.get_thumbnail_url()<br>... <br><a href="http://localhost/uploaded/thumbs/layer-f519c8d4-6b35-11e8-90e2-080027ac8c10-thumb.png" target="_blank">http://localhost/uploaded/thum<wbr>bs/layer-f519c8d4-6b35-11e8-<wbr>90e2-080027ac8c10-thumb.png</a></div><div><b><br></b></div><div><b>Now, let's edit this layer (zoom in / zoom out) and Set Thumbnail</b></div><div><b><br></b></div><div><i><b>Layer --> Edit Layer --> Zoom in or Zoom out --> Set Thumbnails</b></i><br></div><div><br></div><div>Thumbnail url (<a href="http://localhost/uploaded/thumbs/layer-a7c6035e-6b49-11e8-90e2-080027ac8c10-thumb.png" target="_blank">http://localhost/uploaded/thu<wbr>mbs/layer-a7c6035e-6b49-11e8-<wbr>90e2-080027ac8c10-thumb.png</a>) does not work properly.<br></div><div><br></div><div><div><b>Error message:</b> <br></div><div>The image 
'<a href="http://localhost/uploaded/thumbs/layer-a7c6035e-6b49-11e8-90e2-080027ac8c10-thumb.png" target="_blank">http://localhost/uploaded/thu<wbr>mbs/layer-a7c6035e-6b49-11e8-<wbr>90e2-080027ac8c10-thumb.png</a>'
 cannot be displayed because it contains errors.</div><br></div><div></div><div><br></div><div><b>Thumbnail created by loading data from GeoServer Interface</b></div><div><br></div><div>Works like a charm <br></div><div><br></div><div>>>> from geonode.layers.models import Layer<br>>>> layer = Layer.objects.all()<br>>>> for tn in layer:<br>...     print tn.get_thumbnail_url()<br>... <br><a href="http://localhost/uploaded/thumbs/layer-2524c8db-726e-4050-9689-055dc0bb9aaa-thumb.png" target="_blank">http://localhost/uploaded/thum<wbr>bs/layer-2524c8db-726e-4050-<wbr>9689-055dc0bb9aaa-thumb.png</a></div><div><br></div><div><b><b>Right Click over thumbnail blank image --> </b>Copy image Location</b><br></div><div><br></div><div><a href="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" target="_blank">http://localhost/geoserver/ows<wbr>?layers=geonode:RBMC&crs=EPSG:<wbr>4326&service=WMS&format=image/<wbr>png8&request=GetMap&height=<wbr>150&width=200&version=1.1.1&<wbr>bbox=-64.706650088900000,-31.8<wbr>02449444400000,-35.77710101390<wbr>0000,0.047035064700000</a><br></div><div><br></div><div><b>Now, let's edit this layer (zoom in / zoom out) and Set Thumbnails </b><br></div><div><br></div><div><i><b>Layer --> Edit Layer --> Zoom in or Zoom out --> Set Thumbnails</b></i></div><div><br></div><div>Thumbnails url (<a href="http://localhost/uploaded/thumbs/layer-2524c8db-726e-4050-9689-055dc0bb9aaa-thumb.png" target="_blank">http://localhost/uploaded/thu<wbr>mbs/layer-2524c8db-726e-4050-<wbr>9689-055dc0bb9aaa-thumb.png</a>) does not work properly.</div><div><br></div><div><b>Error message:</b> <br></div><div>The image '<a href="http://localhost/uploaded/thumbs/layer-2524c8db-726e-4050-9689-055dc0bb9aaa-thumb.png" target="_blank">http://localhost/uploaded/thu<wbr>mbs/layer-2524c8db-726e-4050-<wbr>9689-055dc0bb9aaa-thumb.png</a>' cannot be displayed because it contains errors.</div><div><br></div><div><b>CONCLUSION GEONODE INSTALLED VIA APT-GET:</b> There is only one issue: <u>Thumbnails update.</u></div><div><u><br></u></div><div>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.</div><div><br></div><div><br></div><div>Sorry for this long e-mail. Thank you for your time in advance. I appreciated your help and attention.</div><div></div><div><u></u></div><div><br></div><div><br></div><div>Dear Julierme,</div><div><br></div><div>I think  using grep does not really help to get insights.</div><div>Why not look at the code? The geoserver URL is composed</div><div>in settings.py [1]. I think here you will find your 8000.</div><div><br></div><div>Next I think the best way to see what´s going on is to have</div><div>a look at the helpers.py [2]. Here you should find the code which</div><div>is responsible for creating thumbnails and here [3] the signal</div><div>which you see in stdout logging. If there is some time I will</div><div>do a dev installation and will test it as well.</div><div><br></div><div>Further you´ve asked if there is something like geonode-updateip </div><div>for an installation by source? Not that I know of but yes it would be helpful.</div><div>But it should not be to hard to write a little script which does the job.</div><div>Have a look what geonode-updateip actually does [4] it programatically changes</div><div>the parts which the documentation [5] explains regarding auth.</div><div><br></div><div>I hope this helps a bit.</div><div>Best greetings to Brasilia!</div><div><br></div><div>Toni</div><div><br></div><div><br></div><div>[1] <a href="https://github.com/GeoNode/geonode/blob/2.8.0/geonode/settings.py#L650" target="_blank">https://github.com/GeoNode<wbr>/geonode/blob/2.8.0/geonode/se<wbr>ttings.py#L650</a></div><div>[2] <a href="https://github.com/GeoNode/geonode/blob/master/geonode/geoserver/helpers.py#L1730" target="_blank">https://github.com/GeoNode<wbr>/geonode/blob/master/geonode/g<wbr>eoserver/helpers.py#L1730</a></div><div>[3] <a href="https://github.com/GeoNode/geonode/blob/df12893ced001973bd748f86d08fa6ae4c10dde9/geonode/geoserver/signals.py#L497" target="_blank">https://github.com/GeoNode<wbr>/geonode/blob/df12893ced001973<wbr>bd748f86d08fa6ae4c10dde9/geono<wbr>de/geoserver/signals.py#L497</a></div><div>[4] <a href="https://github.com/GeoNode/geonode/blob/df12893ced001973bd748f86d08fa6ae4c10dde9/package/support/geonode.updateip#L126" target="_blank">https://github.com/GeoNode<wbr>/geonode/blob/df12893ced001973<wbr>bd748f86d08fa6ae4c10dde9/packa<wbr>ge/support/geonode.updateip#L1<wbr>26</a></div><div>[5] <a href="http://docs.geonode.org/en/master/tutorials/install_and_admin/geonode_install/install_geoserver_application.html#geonode-authentication-integration" target="_blank">http://docs.geonode.org/en<wbr>/master/tutorials/install_and_<wbr>admin/geonode_install/install_<wbr>geoserver_application.html#geo<wbr>node-authentication-integratio<wbr>n</a></div><span><div><br></div></span><br></div>