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

Error Running localshop upgrade - django.db.utils.DatabaseError: near "*": syntax error #31

Closed
victorhooi opened this issue Nov 5, 2012 · 7 comments

Comments

@victorhooi
Copy link

Hi,

I'm installing LocalShop on RHEL 5 with Python 2.6.

It seems to install fine, and I've run localshop init.

However, when I try to create the database and run the migrations:

./localshop upgrade
Syncing...
Creating tables ...
Installing custom SQL ...
Installing indexes ...
Installed 0 object(s) from 0 fixture(s)

Synced:
> django.contrib.auth
> django.contrib.contenttypes
> django.contrib.sessions
> django.contrib.sites
> django.contrib.messages
> django.contrib.staticfiles
> django.contrib.admin
> djkombu
> south

Not synced (use migrations):
- djcelery
- userena
- guardian
- localshop.apps.packages
- localshop.apps.permissions
(use ./manage.py migrate to migrate these)
Running migrations for djcelery:
- Migrating forwards to 0004_v30_changes.
> djcelery:0003_v26_changes
FATAL ERROR - The following SQL query failed: CREATE TABLE "_south_new_djcelery_crontabschedule" ("hour" varchar(64) NOT NULL, "day_of_month" varchar(64) NOT NULL DEFAULT *, "day_of_week" varchar(64) NOT NULL, "month_of_year" varchar(64) NOT NULL DEFAULT '*', "id" integer PRIMARY KEY, "minute" varchar(64) NOT NULL)
The error was: near "*": syntax error
! Error found during real run of migration! Aborting.

! Since you have a database that does not support running
! schema-altering statements in transactions, we have had 
 ! to leave it in an interim state between migrations.

! You *might* be able to recover with:
! The South developers regret this has happened, and would
! like to gently persuade you to consider a slightly
! easier-to-deal-with DBMS (one that supports DDL transactions)
! NOTE: The error which caused the migration to fail is further up.
Error in migration: djcelery:0003_v26_changes
Traceback (most recent call last):
  File "./localshop", line 9, in <module>
    load_entry_point('localshop==0.3', 'console_scripts', 'localshop')()
  File "/u01/pypi/localshop/lib/python2.6/site-packages/localshop-0.3-py2.6.egg/localshop/runner.py", line 53, in main
    settings_envvar='LOCALSHOP_CONF',
  File "/u01/pypi/localshop/lib/python2.6/site-packages/logan-0.5.0-py2.6.egg/logan/runner.py", line 135, in run_app
    management.execute_from_command_line([runner_name, command] + command_args)
  File "/u01/pypi/localshop/lib/python2.6/site-packages/Django-1.4.1-py2.6.egg/django/core/management/__init__.py", line 443, in execute_from_command_line
    utility.execute()
  File "/u01/pypi/localshop/lib/python2.6/site-packages/Django-1.4.1-py2.6.egg/django/core/management/__init__.py", line 382, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/u01/pypi/localshop/lib/python2.6/site-packages/Django-1.4.1-py2.6.egg/django/core/management/base.py", line 196, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/u01/pypi/localshop/lib/python2.6/site-packages/Django-1.4.1-py2.6.egg/django/core/management/base.py", line 232, in execute
    output = self.handle(*args, **options)
  File "/u01/pypi/localshop/lib/python2.6/site-packages/localshop-0.3-py2.6.egg/localshop/management/commands/upgrade.py", line 13, in handle
    delete_ghosts=True)
  File "/u01/pypi/localshop/lib/python2.6/site-packages/Django-1.4.1-py2.6.egg/django/core/management/__init__.py", line 150, in call_command
    return klass.execute(*args, **defaults)
  File "/u01/pypi/localshop/lib/python2.6/site-packages/Django-1.4.1-py2.6.egg/django/core/management/base.py", line 232, in execute
    output = self.handle(*args, **options)
  File "/u01/pypi/localshop/lib/python2.6/site-packages/south/management/commands/migrate.py", line 108, in handle
    ignore_ghosts = ignore_ghosts,
  File "/u01/pypi/localshop/lib/python2.6/site-packages/south/migration/__init__.py", line 213, in migrate_app
    success = migrator.migrate_many(target, workplan, database)
  File "/u01/pypi/localshop/lib/python2.6/site-packages/south/migration/migrators.py", line 235, in migrate_many
    result = migrator.__class__.migrate_many(migrator, target, migrations, database)
  File "/u01/pypi/localshop/lib/python2.6/site-packages/south/migration/migrators.py", line 310, in migrate_many
    result = self.migrate(migration, database)
  File "/u01/pypi/localshop/lib/python2.6/site-packages/south/migration/migrators.py", line 133, in migrate
    result = self.run(migration)
  File "/u01/pypi/localshop/lib/python2.6/site-packages/south/migration/migrators.py", line 107, in run
    return self.run_migration(migration)
  File "/u01/pypi/localshop/lib/python2.6/site-packages/south/migration/migrators.py", line 81, in run_migration
    migration_function()
  File "/u01/pypi/localshop/lib/python2.6/site-packages/south/migration/migrators.py", line 57, in <lambda>
    return (lambda: direction(orm))
  File "/u01/pypi/localshop/lib/python2.6/site-packages/django_celery-3.0.9-py2.6.egg/djcelery/migrations/0003_v26_changes.py", line 16, in forwards
    db.add_column('djcelery_crontabschedule', 'month_of_year', self.gf('django.db.models.fields.CharField')(default='*', max_length=64), keep_default=False)
  File "/u01/pypi/localshop/lib/python2.6/site-packages/south/db/sqlite3.py", line 31, in add_column
    field.column: self._column_sql_for_create(table_name, name, field, False),
  File "/u01/pypi/localshop/lib/python2.6/site-packages/south/db/generic.py", line 44, in _cache_clear
    return func(self, table, *args, **opts)
  File "/u01/pypi/localshop/lib/python2.6/site-packages/south/db/sqlite3.py", line 103, in _remake_table
    ", ".join(["%s %s" % (self.quote_name(cname), ctype) for cname, ctype in definitions.items()]),
  File "/u01/pypi/localshop/lib/python2.6/site-packages/south/db/generic.py", line 273, in execute
    cursor.execute(sql, params)
  File "/u01/pypi/localshop/lib/python2.6/site-packages/Django-1.4.1-py2.6.egg/django/db/backends/util.py", line 40, in execute
    return self.cursor.execute(sql, params)
  File "/u01/pypi/localshop/lib/python2.6/site-packages/Django-1.4.1-py2.6.egg/django/db/backends/sqlite3/base.py", line 337, in execute
    return Database.Cursor.execute(self, query, params)
django.db.utils.DatabaseError: near "*": syntax error

Any thoughts?

Cheers,
Victor

@mvantellingen
Copy link
Owner

Could you check if you still have these problems in the develop branch?

@victorhooi
Copy link
Author

Hi,

I can confirm I am still getting this error with the develop branch =(.

Cheers,
Victor

@mvantellingen
Copy link
Owner

After some more experimenting: the trick is to pass --no-execv to celery. As done by the procfile.

@victorhooi
Copy link
Author

heya,

Wait, is this for this issue?

I thought the issue was with South, and the migrate command?

I can give it a shot on the problematic box at work, though.

Cheers,
Victor

@mvantellingen
Copy link
Owner

Nope sorry, responded to the wrong issue :-)

@victorhooi
Copy link
Author

heya,

Hmm, this seems to be an Sqlite version issue.

Using Sqlite 3.3.6 - we get the error above.

When we upgraded to 3.5.9, it worked fine.

(Due to an oversight, the Python we were using was compiled against 3.5.9 in both cases, but I assume it was just using the system-installed library either way).

I'm sure we could bisect to figure out which version exactly it broke in, but maybe just adding a note that a modern version of Sqlite is required?

We're using RHEL, hence the incredibly ancient version of Sqlite - but I'm sure there's quite a few other places that are also on old versions as well.

Cheers,
Victor

@mvantellingen
Copy link
Owner

Ok. Also after looking more at the issue I'm pretty sure this is a problem with either south or django. So i'm closing it :-)

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