[ECODP-dev] Question about migrating

Dimitrios Mexis dimitrios.mexis at tenforce.com
Fri Jun 14 06:00:01 UTC 2013


Good morning,

*Today I tried to execute the following ( continuing the exercise ) :*
*I did "git pull" in the ckanext-ecportal and then:
*
[root at rpm-tester ckanext-ecportal]#
/applications/ecodp/users/ecodp/ckan/ecportal/bin/paster --plugin=ckan db
upgrade -c /applications/ecodp/users/ecodp/ckan/conf/ecportal.ini
Traceback (most recent call last):
  File "/applications/ecodp/users/ecodp/ckan/ecportal/bin/paster", line 9,
in <module>
    load_entry_point('PasteScript==1.7.5', 'console_scripts', 'paster')()
  File
"/applications/ecodp/users/ecodp/ckan/ecportal/lib/python2.6/site-packages/paste/script/command.py",
line 104, in run
    invoke(command, command_name, options, args[1:])
  File
"/applications/ecodp/users/ecodp/ckan/ecportal/lib/python2.6/site-packages/paste/script/command.py",
line 143, in invoke
    exit_code = runner.run(args)
  File
"/applications/ecodp/users/ecodp/ckan/ecportal/lib/python2.6/site-packages/paste/script/command.py",
line 238, in run
    result = self.command()
  File
"/applications/ecodp/users/ecodp/ckan/ecportal/src/ckan/ckan/lib/cli.py",
line 139, in command
    model.repo.upgrade_db()
  File
"/applications/ecodp/users/ecodp/ckan/ecportal/src/ckan/ckan/model/__init__.py",
line 324, in upgrade_db
    mig.upgrade(self.metadata.bind, self.migrate_repository,
version=version)
  File
"/applications/ecodp/users/ecodp/ckan/ecportal/lib/python2.6/site-packages/migrate/versioning/api.py",
line 186, in upgrade
    return _migrate(url, repository, version, upgrade=True, err=err, **opts)
  File "<string>", line 2, in _migrate
  File
"/applications/ecodp/users/ecodp/ckan/ecportal/lib/python2.6/site-packages/migrate/versioning/util/__init__.py",
line 159, in with_engine
    return f(*a, **kw)
  File
"/applications/ecodp/users/ecodp/ckan/ecportal/lib/python2.6/site-packages/migrate/versioning/api.py",
line 366, in _migrate
    schema.runchange(ver, change, changeset.step)
  File
"/applications/ecodp/users/ecodp/ckan/ecportal/lib/python2.6/site-packages/migrate/versioning/schema.py",
line 91, in runchange
    change.run(self.engine, step)
  File
"/applications/ecodp/users/ecodp/ckan/ecportal/lib/python2.6/site-packages/migrate/versioning/script/py.py",
line 145, in run
    script_func(engine)
  File
"/applications/ecodp/users/ecodp/ckan/ecportal/src/ckan/ckan/migration/versions/058_add_follower_tables.py",
line 37, in upgrade
    ''')
  File
"/applications/ecodp/users/ecodp/ckan/ecportal/lib/python2.6/site-packages/sqlalchemy/engine/base.py",
line 2447, in execute
    return connection.execute(statement, *multiparams, **params)
  File
"/applications/ecodp/users/ecodp/ckan/ecportal/lib/python2.6/site-packages/sqlalchemy/engine/base.py",
line 1449, in execute
    params)
  File
"/applications/ecodp/users/ecodp/ckan/ecportal/lib/python2.6/site-packages/sqlalchemy/engine/base.py",
line 1628, in _execute_text
    statement, parameters
  File
"/applications/ecodp/users/ecodp/ckan/ecportal/lib/python2.6/site-packages/sqlalchemy/engine/base.py",
line 1698, in _execute_context
    context)
  File
"/applications/ecodp/users/ecodp/ckan/ecportal/lib/python2.6/site-packages/sqlalchemy/engine/base.py",
line 1691, in _execute_context
    context)
  File
"/applications/ecodp/users/ecodp/ckan/ecportal/lib/python2.6/site-packages/sqlalchemy/engine/default.py",
line 331, in do_execute
    cursor.execute(statement, parameters)
sqlalchemy.exc.ProgrammingError: (ProgrammingError) relation
"user_following_dataset" already exists
 '\nCREATE TABLE user_following_dataset (\n    follower_id text NOT NULL,\n
   object_id text NOT NULL,\n    datetime timestamp without time zone NOT
NULL\n);\n\nCREATE TABLE user_following_user (\n    follower_id text NOT
NULL,\n    object_id text NOT NULL,\n    datetime timestamp without time
zone NOT NULL\n);\n\nALTER TABLE user_following_dataset\n    ADD CONSTRAINT
user_following_dataset_pkey PRIMARY KEY (follower_id, object_id);\n\nALTER
TABLE user_following_user\n    ADD CONSTRAINT user_following_user_pkey
PRIMARY KEY (follower_id, object_id);\n\nALTER TABLE
user_following_dataset\n    ADD CONSTRAINT
user_following_dataset_follower_id_fkey FOREIGN KEY (follower_id)
REFERENCES "user"(id) ON UPDATE CASCADE ON DELETE CASCADE;\n\nALTER TABLE
user_following_dataset\n    ADD CONSTRAINT
user_following_dataset_object_id_fkey FOREIGN KEY (object_id) REFERENCES
package(id) ON UPDATE CASCADE ON DELETE CASCADE;\n\nALTER TABLE
user_following_user\n    ADD CONSTRAINT
user_following_user_follower_id_fkey FOREIGN KEY (follower_id) REFERENCES
"user"(id) ON UPDATE CASCADE ON DELETE CASCADE;\n\nALTER TABLE
user_following_user\n    ADD CONSTRAINT user_following_user_object_id_fkey
FOREIGN KEY (object_id) REFERENCES "user"(id) ON UPDATE CASCADE ON DELETE
CASCADE;\n    ' {}



On Thu, Jun 13, 2013 at 3:03 PM, Dimitrios Mexis <
dimitrios.mexis at tenforce.com> wrote:

> Hello John
>
> if we have data in 1,7 database CKAN
>
> We had 1.8 db and new instance setup
> Then we restored the 1.7 backup with pg_restore.
> Then I run the ckan_reindex utility which calls the paster to reindex the
> database
> I see some output like:
>
> *ERROR:  relation "search_popular_approved" does not exist at character 34
> *
> *STATEMENT:  SELECT search_string, count FROM search_popular_approved;*
> *ERROR:  relation "search_popular_approved" does not exist at character 34
> *
> *STATEMENT:  SELECT search_string, count FROM search_popular_approved;*
> *ERROR:  relation "search_popular_approved" does not exist at character 34
> *
> *STATEMENT:  SELECT search_string, count FROM search_popular_approved;*
> *ERROR:  relation "search_popular_approved" does not exist at character 34
> *
> *STATEMENT:  SELECT search_string, count FROM search_popular_approved;*
> *LOG:  unexpected EOF on client connection*
>
> Is that normal ?
> [ During the process which still runs from the ps faux , I can see that
> postgresql indeed receives commands from the connection like "SELECT" ]
>
> Is that everything ok, and I just have to wait to finish ?
>
> Kind regards
> Dimitrios
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.okfn.org/mailman/private/ecodp-dev/attachments/20130614/fe99a868/attachment.html>


More information about the ecodp-dev mailing list