[GeoNode-users] updatelayers "httplib2.socks.HTTPError: (403, 'Forbidden')" problem ...
G. Allegri
giovanni.allegri at geo-solutions.it
Thu Mar 19 14:04:45 PDT 2020
Are you sure Geoserver credentials (admin user and password) are configured
correctly on GeoNode?
Giovanni
Il gio 19 mar 2020, 21:37 Giuliano Grigolin <giuliano.geobases at gmail.com>
ha scritto:
> Hi all !
>
> I have a GeoNode 2.8 in production, with internet domain, in Ubuntu Server
> 16.04.
> When i try update a layer that i import trough "Import Data" in GeoServer,
> i get the following message:
>
> root at geonode# python manage.py updatelayers -w geonode -f
> my_layer_in_GeoServer
>
> Inspecting the available layers in GeoServer ...
> GET http://localhost:8080/geoserver/rest/workspaces.xml
> Traceback (most recent call last):
> File "manage.py", line 11, in <module>
> execute_from_command_line(sys.argv)
> File
> "/usr/lib/python2.7/dist-packages/django/core/management/__init__.py", line
> 354, in execute_from_command_line
> utility.execute()
> File
> "/usr/lib/python2.7/dist-packages/django/core/management/__init__.py", line
> 346, in execute
> self.fetch_command(subcommand).run_from_argv(self.argv)
> File "/usr/lib/python2.7/dist-packages/django/core/management/base.py",
> line 394, in run_from_argv
> self.execute(*args, **cmd_options)
> File "/usr/lib/python2.7/dist-packages/django/core/management/base.py",
> line 445, in execute
> output = self.handle(*args, **options)
> File
> "/usr/local/lib/python2.7/dist-packages/geonode/geoserver/management/commands/updatelayers.py",
> line 122, in handle
> execute_signals=True)
> File
> "/usr/local/lib/python2.7/dist-packages/geonode/geoserver/helpers.py", line
> 531, in gs_slurp
> workspace = cat.get_workspace(workspace)
> File "/usr/lib/python2.7/dist-packages/geoserver/catalog.py", line 1031,
> in get_workspace
> workspaces = self.get_workspaces(name)
> File "/usr/lib/python2.7/dist-packages/geoserver/catalog.py", line 1011,
> in get_workspaces
> description = self.get_xml("%s/workspaces.xml" % self.service_url)
> File "/usr/lib/python2.7/dist-packages/geoserver/catalog.py", line 211,
> in get_xml
> response, content = self.http.request(rest_url)
> File "/usr/lib/python2.7/dist-packages/httplib2/__init__.py", line 1659,
> in request
> (response, content) = self._request(conn, authority, uri, request_uri,
> method, body, headers, redirections, cachekey)
> File "/usr/lib/python2.7/dist-packages/httplib2/__init__.py", line 1399,
> in _request
> (response, content) = self._conn_request(conn, request_uri, method,
> body, headers)
> File "/usr/lib/python2.7/dist-packages/httplib2/__init__.py", line 1319,
> in _conn_request
> conn.connect()
> File "/usr/lib/python2.7/dist-packages/httplib2/__init__.py", line 946,
> in connect
> self.sock.connect((self.host, self.port) + sa[2:])
> File "/usr/lib/python2.7/dist-packages/httplib2/socks.py", line 434, in
> connect
> self.__negotiatehttp(destpair[0], destpair[1])
> File "/usr/lib/python2.7/dist-packages/httplib2/socks.py", line 400, in
> __negotiatehttp
> raise HTTPError((statuscode, statusline[2]))
> httplib2.socks.HTTPError: (403, 'Forbidden')
>
>
> The 'importlayers' command returns an 403 error message too:
>
> python manage.py importlayers -v 3 /mnt/GEOSRVVOL01/000-transf/34_787_test/
> Verifying that GeoNode is running ...
>
> Found 1 potential layers.
>
> Using name as requested
> In pre_save_layer
> instance.alternate is: geonode:_34_787_test
> Checking for permissions.
> There are no permissions for this object, setting default perms.
> Inside set_geofence_all for instance geonode:_34_787_test
> going to work in workspace 'geonode'
> Attempt 1/5 - Found layer in the database
> >>> Step 2. Make sure we are not trying to overwrite a existing resource
> named [_34_787_test] with the wrong type
> GET http://localhost:8080/geoserver/rest/workspaces.xml
> [failed] Layer for
> '/mnt/GEOSRVVOL01/000-transf/34_787_test/34_787_test.shp' (1/1)
>
>
> Detailed report of failures:
>
>
> /mnt/GEOSRVVOL01/000-transf/34_787_test/34_787_test.shp
> ================
> Traceback (most recent call last):
> File "/usr/local/lib/python2.7/dist-packages/geonode/layers/utils.py",
> line 778, in upload
> charset=charset)
> File "/usr/local/lib/python2.7/dist-packages/geonode/layers/utils.py",
> line 553, in file_upload
> defaults=defaults
> File "/usr/lib/python2.7/dist-packages/django/db/models/manager.py",
> line 127, in manager_method
> return getattr(self.get_queryset(), name)(*args, **kwargs)
> File "/usr/lib/python2.7/dist-packages/modeltranslation/manager.py",
> line 389, in get_or_create
> return super(MultilingualQuerySet, self).get_or_create(**kwargs)
> File "/usr/lib/python2.7/dist-packages/django/db/models/query.py", line
> 407, in get_or_create
> return self._create_object_from_params(lookup, params)
> File "/usr/lib/python2.7/dist-packages/django/db/models/query.py", line
> 439, in _create_object_from_params
> obj = self.create(**params)
> File "/usr/lib/python2.7/dist-packages/modeltranslation/manager.py",
> line 381, in create
> return super(MultilingualQuerySet, self).create(**kwargs)
> File "/usr/lib/python2.7/dist-packages/django/db/models/query.py", line
> 348, in create
> obj.save(force_insert=True, using=self.db)
> File "/usr/lib/python2.7/dist-packages/polymorphic/models.py", line 74,
> in save
> return super(PolymorphicModel, self).save(*args, **kwargs)
> File "/usr/lib/python2.7/dist-packages/django/db/models/base.py", line
> 734, in save
> force_update=force_update, update_fields=update_fields)
> File "/usr/lib/python2.7/dist-packages/django/db/models/base.py", line
> 771, in save_base
> update_fields=update_fields, raw=raw, using=using)
> File "/usr/lib/python2.7/dist-packages/django/dispatch/dispatcher.py",
> line 189, in send
> response = receiver(signal=self, sender=sender, **named)
> File "/usr/local/lib/python2.7/dist-packages/geonode/decorators.py",
> line 44, in wrapper
> return func(*args, **kwargs)
> File
> "/usr/local/lib/python2.7/dist-packages/geonode/geoserver/signals.py", line
> 87, in geoserver_post_save
> producer.geoserver_upload_layer(payload)
> File "<decorator-gen-3>", line 2, in geoserver_upload_layer
> File
> "/usr/local/lib/python2.7/dist-packages/geonode/messaging/producer.py",
> line 62, in sync_if_local_memory
> worker.run()
> File "/usr/lib/python2.7/dist-packages/kombu/mixins.py", line 170, in run
> for _ in self.consume(limit=None, **kwargs):
> File "/usr/lib/python2.7/dist-packages/kombu/mixins.py", line 192, in
> consume
> conn.drain_events(timeout=safety_interval)
> File "/usr/lib/python2.7/dist-packages/kombu/connection.py", line 301,
> in drain_events
> return self.transport.drain_events(self.connection, **kwargs)
> File "/usr/lib/python2.7/dist-packages/kombu/transport/virtual/base.py",
> line 961, in drain_events
> get(self._deliver, timeout=timeout)
> File "/usr/lib/python2.7/dist-packages/kombu/utils/scheduling.py", line
> 56, in get
> return self.fun(resource, callback, **kwargs)
> File "/usr/lib/python2.7/dist-packages/kombu/transport/virtual/base.py",
> line 999, in _drain_channel
> return channel.drain_events(callback=callback, timeout=timeout)
> File "/usr/lib/python2.7/dist-packages/kombu/transport/virtual/base.py",
> line 745, in drain_events
> return self._poll(self.cycle, callback, timeout=timeout)
> File "/usr/lib/python2.7/dist-packages/kombu/transport/virtual/base.py",
> line 402, in _poll
> return cycle.get(callback)
> File "/usr/lib/python2.7/dist-packages/kombu/utils/scheduling.py", line
> 56, in get
> return self.fun(resource, callback, **kwargs)
> File "/usr/lib/python2.7/dist-packages/kombu/transport/virtual/base.py",
> line 406, in _get_and_deliver
> callback(message, queue)
> File "/usr/lib/python2.7/dist-packages/kombu/transport/virtual/base.py",
> line 981, in _deliver
> callback(message)
> File "/usr/lib/python2.7/dist-packages/kombu/transport/virtual/base.py",
> line 633, in _callback
> return callback(message)
> File "/usr/lib/python2.7/dist-packages/kombu/messaging.py", line 624, in
> _receive_callback
> return on_m(message) if on_m else self.receive(decoded, message)
> File "/usr/lib/python2.7/dist-packages/kombu/messaging.py", line 590, in
> receive
> [callback(body, message) for callback in callbacks]
> File
> "/usr/local/lib/python2.7/dist-packages/geonode/messaging/consumer.py",
> line 99, in on_geoserver_messages
> geoserver_post_save_local(layer)
> File
> "/usr/local/lib/python2.7/dist-packages/geonode/geoserver/signals.py", line
> 130, in geoserver_post_save_local
> charset=instance.charset)
> File
> "/usr/local/lib/python2.7/dist-packages/geonode/geoserver/upload.py", line
> 71, in geoserver_upload
> workspace = cat.get_workspace(settings.DEFAULT_WORKSPACE)
> File "/usr/lib/python2.7/dist-packages/geoserver/catalog.py", line 1031,
> in get_workspace
> workspaces = self.get_workspaces(name)
> File "/usr/lib/python2.7/dist-packages/geoserver/catalog.py", line 1011,
> in get_workspaces
> description = self.get_xml("%s/workspaces.xml" % self.service_url)
> File "/usr/lib/python2.7/dist-packages/geoserver/catalog.py", line 211,
> in get_xml
> response, content = self.http.request(rest_url)
> File "/usr/lib/python2.7/dist-packages/httplib2/__init__.py", line 1659,
> in request
> (response, content) = self._request(conn, authority, uri, request_uri,
> method, body, headers, redirections, cachekey)
> File "/usr/lib/python2.7/dist-packages/httplib2/__init__.py", line 1399,
> in _request
> (response, content) = self._conn_request(conn, request_uri, method,
> body, headers)
> File "/usr/lib/python2.7/dist-packages/httplib2/__init__.py", line 1319,
> in _conn_request
> conn.connect()
> File "/usr/lib/python2.7/dist-packages/httplib2/__init__.py", line 946,
> in connect
> self.sock.connect((self.host, self.port) + sa[2:])
> File "/usr/lib/python2.7/dist-packages/httplib2/socks.py", line 434, in
> connect
> self.__negotiatehttp(destpair[0], destpair[1])
> File "/usr/lib/python2.7/dist-packages/httplib2/socks.py", line 400, in
> __negotiatehttp
> raise HTTPError((statuscode, statusline[2]))
> HTTPError: (403, 'Forbidden')
>
>
> Finished processing 1 layers in 3.0 seconds.
>
> 0 Created layers
> 0 Updated layers
> 0 Skipped layers
> 1 Failed layers
> 3.000000 seconds per layer
>
>
>
>
> Any tip on where is the prmission issue ?
>
>
> Thanks
>
>
>
>
>
>
>
>
> _______________________________________________
> geonode-users mailing list
> geonode-users at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/geonode-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/geonode-users/attachments/20200319/4483d01c/attachment.html>
More information about the geonode-users
mailing list