Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrading to 1.2beta1 causes data loss #334

Closed
ingenieroariel opened this issue Jul 24, 2012 · 9 comments
Closed

Upgrading to 1.2beta1 causes data loss #334

ingenieroariel opened this issue Jul 24, 2012 · 9 comments
Assignees
Milestone

Comments

@ingenieroariel
Copy link
Member

Method to replicate:

  1. Install GeoNode (any version from 1.1 to 1.2alpha2)
  2. Upgrade to 1.2beta1
  3. See your data dissapear :/

I believe this line would be the one to blame but will investigate further.

https://github.com/GeoNode/geonode/blob/master/shared/package/install.sh#L49

Ariel.

For the record, this is the kind of error the layer detail page gives:

FailedRequestError at /data/geonode:FloodProneAreasPoly1_WGS84

No store found in geonode @ http://geonode.openstreetmap.co/geoserver/rest/workspaces/geonode.xml named: FloodProneAreasPoly1_WGS84


Traceback:
File "/var/lib/geonode/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
  111.                         response = callback(request, *callback_args, **callback_kwargs)
File "/var/lib/geonode/src/GeoNodePy/geonode/maps/views.py" in layer_detail
  815.         "GEOSERVER_BASE_URL": settings.GEOSERVER_BASE_URL
File "/var/lib/geonode/lib/python2.7/site-packages/django/shortcuts/__init__.py" in render_to_response
  20.     return HttpResponse(loader.render_to_string(*args, **kwargs), **httpresponse_kwargs)
File "/var/lib/geonode/lib/python2.7/site-packages/django/template/loader.py" in render_to_string
  171.         return t.render(Context(dictionary))
File "/var/lib/geonode/lib/python2.7/site-packages/django/template/base.py" in render
  140.             return self._render(context)
File "/var/lib/geonode/lib/python2.7/site-packages/django/template/base.py" in _render
  134.         return self.nodelist.render(context)
File "/var/lib/geonode/lib/python2.7/site-packages/django/template/base.py" in render
  823.                 bit = self.render_node(node, context)
File "/var/lib/geonode/lib/python2.7/site-packages/django/template/debug.py" in render_node
  74.             return node.render(context)
File "/var/lib/geonode/lib/python2.7/site-packages/django/template/loader_tags.py" in render
  123.         return compiled_parent._render(context)
File "/var/lib/geonode/lib/python2.7/site-packages/django/template/base.py" in _render
  134.         return self.nodelist.render(context)
File "/var/lib/geonode/lib/python2.7/site-packages/django/template/base.py" in render
  823.                 bit = self.render_node(node, context)
File "/var/lib/geonode/lib/python2.7/site-packages/django/template/debug.py" in render_node
  74.             return node.render(context)
File "/var/lib/geonode/lib/python2.7/site-packages/django/template/loader_tags.py" in render
  62.             result = block.nodelist.render(context)
File "/var/lib/geonode/lib/python2.7/site-packages/django/template/base.py" in render
  823.                 bit = self.render_node(node, context)
File "/var/lib/geonode/lib/python2.7/site-packages/django/template/debug.py" in render_node
  74.             return node.render(context)
File "/var/lib/geonode/lib/python2.7/site-packages/django/template/debug.py" in render
  84.             output = self.filter_expression.resolve(context)
File "/var/lib/geonode/lib/python2.7/site-packages/django/template/base.py" in resolve
  571.                 obj = self.var.resolve(context)
File "/var/lib/geonode/lib/python2.7/site-packages/django/template/base.py" in resolve
  721.             value = self._resolve_lookup(context)
File "/var/lib/geonode/lib/python2.7/site-packages/django/template/base.py" in _resolve_lookup
  754.                         current = getattr(current, bit)
File "/var/lib/geonode/src/GeoNodePy/geonode/maps/models.py" in resource
  994.             store = cat.get_store(self.store, ws)
File "/var/lib/geonode/lib/python2.7/site-packages/geoserver/catalog.py" in get_store
  176.               raise FailedRequestError("No store found in " + str(workspace) + " named: " + name)

Exception Type: FailedRequestError at /data/geonode:colmun3corregido
Exception Value: No store found in geonode @ http://geonode.openstreetmap.co/geoserver/rest/workspaces/geonode.xml named: colmun3corregido

@ghost ghost assigned ingenieroariel Jul 24, 2012
@ingenieroariel
Copy link
Member Author

Below is a potential methodology to debug the issue:

The goal is to make sure there is enough information after the removal part to restore geoserver. The debugging will be done in two parts.

  • Part one: Removing geonode and trying with a vanilla 2.1.x geoserver pointed at the data dir. All layers should be there.
  • Part two: After verifying the data is there, install the same version of geonode and see if all is good

Once that is done, it makes sense to retry the upgrade.

  1. Install geonode
sudo add-apt-repository ppa:geonode/snapshots
sudo apt-get install geonode

sudo pip install geonode-extract
geonode-extract http://demo.geonode.org -d demodata -u admin -p admin -i -v
geonode importlayers demodata -i

sudo apt-get remove geonode
  1. Check data dir health
# Get a geoserver.war from the download page and put it in tomcat

# check layers are there

# remove geoserver
  1. Install geonode again
sudo apt-get install geonode

  1. Check layers are there
  2. Go back to the upgrade problem, if all the above works, there is a chance upgrade works too.

@simod
Copy link
Member

simod commented Sep 5, 2012

Reinstalling the same geonode is fine. My test was on ubuntu 12.04 from ppa:geonode/snapshots to ppa:geonode/snapshots.

@simod
Copy link
Member

simod commented Sep 5, 2012

Did a new test on Ubuntu 10.04:

  • installed geonode/release and a layer
  • removed geonode
  • installed geonode/snapshots

The initial error was related to a wrong version of httplib2 used by gsconfig, I think Ariel is already dealing with this.

After solving it the site is still completely broken, the error looks to be related of incompatibility between django 1.4 and python 2.6.5. In the threading module precisely.

And a deprecation warnings :

/var/lib/geonode/lib/python2.6/site-packages/django/views/generic/simple.py:8: DeprecationWarning: Function-based generic views have been deprecated; use class-based views instead.
DeprecationWarning
/var/lib/geonode/lib/python2.6/site-packages/django/views/generic/list_detail.py:10: DeprecationWarning: Function-based generic views have been deprecated; use class-based views instead.
DeprecationWarning
/var/lib/geonode/lib/python2.6/site-packages/django/template/defaulttags.py:1235: DeprecationWarning: The syntax for the url template tag is changing. Load the url tag from the future tag library to start using the new behavior.
category=DeprecationWarning)

However the geoserver data dir is still in place intact.

@simod
Copy link
Member

simod commented Sep 6, 2012

New test on ubuntu 12.04:

  • installed geonode/testing and uploaded a layer
  • removed geonode
  • installed geonode/snapshots

There is an error related to the database password and ownership, with testing the geonode db belongs to 'postgres', with snapshots the user also has to modify the password in the local_settings.py and then update the 'geonode' user in postgres.

Once solved this everything else is ok and the layer is in place correctly.

Hope this helps.

@simod
Copy link
Member

simod commented Sep 6, 2012

Until now I could not reproduce the bug. The last test to do is from /release to /testing on 10.04 but since from /release to /snapshot the data was not wiped I'm wondering whether this still makes sense.

Any comments?

@ingenieroariel
Copy link
Member Author

/release (1.1.1) to /testing (1.2beta1) does not really make sense. Like
you said, the important one is /release (1.1.1) to latest master (or
1.2beta2 in snapshots).

Thanks for making so much progress on this, your finding about the data dir
being present and recoverable is key.

On Thu, Sep 6, 2012 at 5:23 AM, Simone Dalmasso [email protected]:

Until now I could not reproduce the bug. The last test to do is from
/release to /testing on 10.04 but since from /release to /snapshot the data
was not wiped I'm wondering whether this still makes sense.

Any comments?


Reply to this email directly or view it on GitHubhttps://github.com//issues/334#issuecomment-8326994.

@simod
Copy link
Member

simod commented Sep 8, 2012

Since I was not convinced by the test on ubuntu 10.04 from /release to /snapshots, I did another try(new vm). Here the full report:

  • install geonode/release
  • upload a layer
  • remove geonode
  • install geonode/snapshots
  • change the geonode db owner to geonode and change the password both in postgres and local_settings
  • clean up httplib2 and install the 0.7.4
  • set the geoserver context params (GEONODE_BASE_URL and GEOSERVER_DATA_DIR) because they were not set
  • restart tomcat and go to geoserver and enable the geonode_imports store because was disabled
  • do a syncdb because was not done
  • remove /var/lib/tomcat/webapps/geonetwork (because the login was broken), download a fresh war and deploy it
  • do updatelayers

and voilà, GeoNode 1.2 is up with all the layers in and perfectly running.

It's a bit tricky but definetly no data have been lost.

Cheers

@ingenieroariel
Copy link
Member Author

This is impressive, that list of steps is what we needed to be able to
include any workarounds in the installer.

Many of the steps you mention may by themselves be the cause of the missing
data (database ownership, postgres_imports not being enabled).

Very happy to see progress on this, the next step is to create packages
from master (after the gsconfig 0.6.1 release that deals with httplib2
versioning), set up a local apt repo (as described here [1]) and try a
direct upgrade (that should avoid the need to set the password or do a
manual syncdb). It should now be a matter of re-creating the packages and
fixing the items in your list until it is able to upgrade from 1.1.1 on
it's own. Then we can mark it as 1.2RC1 and move on with the release train.

Thanks again for taking on this challenge, I know firsthand how time
consuming it is.

[1]
http://www.hiddentao.com/archives/2011/06/27/setting-up-a-simple-ubuntu-apt-repository/

On Sat, Sep 8, 2012 at 5:15 AM, Simone Dalmasso [email protected]:

Since I was not convinced by the test on ubuntu 10.04 from /release to
/snapshots, I did another try(new vm). Here the full report:

  • install geonode/release
  • upload a layer
  • remove geonode
  • install geonode/snapshots
  • change the geonode db owner to geonode and change the password both
    in postgres and local_settings
  • clean up httplib2 and install the 0.7.4
  • set the geoserver context params (GEONODE_BASE_URL and
    GEOSERVER_DATA_DIR) because they were not set
  • restart tomcat and go to geoserver and enable the geonode_imports
    store because was disabled
  • do a syncdb because was not done
  • remove /var/lib/tomcat/webapps/geonetwork (because the login was
    broken), download a fresh war and deploy it
  • do updatelayers

and voilà, GeoNode 1.2 is up with all the layers in and perfectly running.

It's a bit tricky but definetly no data have been lost.

Cheers


Reply to this email directly or view it on GitHubhttps://github.com//issues/334#issuecomment-8385918.

@ingenieroariel
Copy link
Member Author

Thank Simone for taking care of this.

afabiani pushed a commit that referenced this issue Jun 5, 2018
afabiani pushed a commit that referenced this issue Oct 18, 2018
* Remove an ipdb line

* Enable DB_DATASTORE when using WorldMap

* Now it is possible to edit and style also from local dev

* Fixes #263

* Fixes #273

* Synced with geonode master

* Fixes a problem with layers upload

* Add url dispatcher for worldmap api

* WorldMap api version is now 2.8

* Added worldmap geoexplorer client source code. Fixes #265

* Fixed javascript build.xml and a few things in GeoExplorer.js

* Ported the action model and its api, which is needed by hypermap

* Updating instructions for geonode-worldmap

* Fixes #264

* Fixes #280

* Update instructions adding the configuration of update_last_wm_geonode_layers

* Trying to increase accesstoken expiration to see if this affects #283

* Removed google earth tool. Fixed the gxp_mapshare tool. Fixing google map api key read

* Adding a missing import which caused an error when looking at map page as anonymous user

* Migrate worldmap map revisions. Fixes #266

* Restore map print tool

* Fixes #267

* Fixes #260 (gazetteer)

* Forgot one requirement in previous commit

* Fixes #272

* Fixes permission issues with editing and use the correct source for wm layers

* Fixes #283

* Fixes #314

* Fixes #298

* Point to the correct warper site in the rectify images dialog

* Correctly identify a local layer when using GeoNodeQueryTool

* Fixes #322

* Fixes zoom to extent tool

* Fixes the regression casuing all the extent issues

* Fixes #301

* Release 2.8.0

* Updated changelog for version 2.8

* Update README

* Update README

* Add the feature search functionality

* Forgot file in previous commit

* Improve map thumbnails

* Make layer configuration in json map more robust

* Removed a stale file

* Adds a status message when updating the gazetteer fields for a layer

* Fixes #334

* Fixes #300

* Fixes #330

* Fixes #327

* Fixes #336

* Fixes #340

* Align to master branch

* Fixes #343

* Prepare 2.8.1

*  - Fix issue with layer upload

*  - Fix issue with layer upload

* Backport master fixes

*  - Fix reproj issue on bbox_to_projection

* fix slow login/logout on certain circumstances

It seems connexion was make through public location,
while it's an internal call, making the request
very slow on some setups (not sure geoserver login
works anyway...)

* use geoip2 for monitoring

* Use HTML widget in GXP for any field starting with "descriptio". Refs #348

* Constrain pip to 9.0.3

* Updated changelog for version 2.8

* Backporting Master PRs

* Fixes #350

* Re-enable thumbnails for layers. Fixes #351

* Now categories order is respected for existing maps. Refs #341

* Sync with GeoNode 2.8 part 1/2

* Updating geoexplorer to last version

* Fixes a couple of things which were broken by merge with 2.8.0

* Fixing a couple of things broke when merging

* renaming celery to celery_app

* Fixes the updatelayers command

* Update helpers.py

* Backporting Master PRs

* Backporting Master PRs

* Fixes #367

* Fixes 31

Adding the {% trans %} tag for translation.

* Fixes https://github.com/camp-zju/geonode/issues/32

Add lable _() for translation

* Fixes https://github.com/camp-zju/geonode/issues/33

Add "Text" in .js file for translation

* Fixes https://github.com/camp-zju/geonode/issues/34

add Tianditu basemap

* Add Chinese translation file

* Add Chinese translation file

* Fixes https://github.com/camp-zju/geonode/issues/36

* Modify the file for translation

* Fixes https://github.com/camp-zju/geonode/issues/37

* Some improvement to the createlayer application

* Fixes part of #358 (the layer extent)

* Now thumbanils are not generate from layers which are created. Fixes #358

* Backporting Master PRs

* Fixes #3801

* Fixes #375

* Backporting Master PRs

* Update integration.py

*  - Backport fixes from master

*  - Backport fixes from master

*  - Allow registered users to edit Remote Services

* Updating the client

* Move the worldmap documentation to the correct place

* Removed stale worldmap documentation page

*  - Backport commit 15123a5 from master

* A couple of fixes and removing geoexplorer source code

*  - Backport commit 6c0e8ca from master

* Removing from git the compiled geoexplorer worldmap client

* Removing worldmap account, which will be part of the cga geonode project

* Removing all static files, which should be added by pip install worldmap-geoexplorer

* Fixing a number of things before sending PR to GeoNode 2.7.x

* Updated requirements for WorldMap

* Including a local_settings sample file for worldmap

* Now using django-geoexplorer-worldmap from the pypi package

*  - Backport fixes from master branch

* Updated worldmap installation documentation

* Removed the worldmap.queue application for now

* Reset a couple of files

*  - Backport from master

* Fixes pep8 violations

* By default USE_WORLDMAP is False

* Fixes PEP8 violations and a syntax error

* Fixes a problem with createlayer app

* By default we dont use hypermap

* [Backport fixes from master]

* [Backport fixes from master]

* Backport from master branch

*  - SITEURL rstrip (/) consistently

* [Fixes #3800] Uploading shapefiles without a datefield and time-enabled is False in importer settings fails in 2.7.x

*  - Backport stable fixes from master branch

*  - Backport stable fixes from master branch

*  - Backporting Docker Improvs and Fixes from master branch

* Update Dockerfile

* Externalize OGC TIMEOUT setting as ENV var

*  - Fix celery initialization when using GeoNode ad a depenency

* pep8 issues

* - Fix celery initialization when using GeoNode ad a depenency

* - Fix celery initialization when using GeoNode ad a depenency

* - Fix celery initialization when using GeoNode ad a depenency

* pep8 fixes

* - Fix celery initialization when using GeoNode ad a depenency

*  - Fixes layer replace

* Update helpers.py

* Update helpers.py

* add missing ast import

docker compose would fail due to a missing import, looking for global ast

* [backport 2.7.x] Minor improvements: allow registered users to invite others / improve French translation

*  - Packagin scripts updates

*  - Fix max zoom issue

*  - backport from master

*  - Backport fixes and PRs from master

*  - Minor Layout improvements

*  - Backport fixes and PRs from master (#3846)

*  - Backport fixes and PRs from master

*  - Minor Layout improvements

* Backport fixes from master branch

* Backport fix #3853

* Backport #3856

*  - Backporting master branch fixes

*  - Backporting fixes from master

* Backport fixes from master

* Backport fixes from master

*  - Fix integration tests

* Backport fixes from master

*  - Fix typo

* Ported the mobile client as per #404

* Includes commands in Makefile to create and remove databases needed when using the worldmap contrib application

* Now there is not a local_settings.py file, so we need to set DATABASES when using worldmap application

* Updated worldmap installation instructions and setup_worlmap make command

* When parsing ALLOWED_HOSTS the error can be more generic (in my case got a syntax error)

* Added the initial migration for datastore_shards app

* Fix issue with styles introduced with latest GeoNode synced code

* Correctly reference the google maps api

* add some localizations

* Skip a layer in the map if its source is missing

* Add localization

* Uncommenting a line wrongly commented out

* Started the GeoFence refactoring

* Fixes a problem with owner permissions not being synced on geofence

* Use psycopg2 for syncing geofence if there is a GEOFENCE_URL setting

* Handle a case of possible null values from geofence database

* Adding a GEOFENCE_URL in OGC_SERVER

* Fixes permissions sync with geofence for anonymous users

* Fixes an issue with guardian anonymous permissions

* Fixes another issue with anonymous user

* Skipping not anymore existing layers in maps

* Fixes the google maps api path

* Fixes #441

* Fixes #439

* Make sure coordinates are not flipped for a wm map

* Removing an unwanted print statment

* Fixes #454

* Fixes after sync with master

* Fixes pep8 violations

* Fixes some problem with automatic merge and migrations
marthamareal pushed a commit to marthamareal/geonode that referenced this issue Sep 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants