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

sqlalchemy.exc.IntegrityError #3

Open
mebels opened this issue Mar 1, 2018 · 0 comments
Open

sqlalchemy.exc.IntegrityError #3

mebels opened this issue Mar 1, 2018 · 0 comments

Comments

@mebels
Copy link

mebels commented Mar 1, 2018

[user@server html]$ python2.7 ./nirvana.py migrate-verbose
Your current system encoding: ascii
Found 223 albums.
Found album ID 1446: albumname
mkdir -p albums/albumname
ZenPhoto DB: create album ID 1446
albumname: Albumname
Traceback (most recent call last):
  File "./nirvana.py", line 394, in <module>
    main(sys.argv[1:])
  File "./nirvana.py", line 379, in main
    Migrate()
  File "./nirvana.py", line 355, in Migrate
    MakeZenAlbum(cur_album_md)
  File "./nirvana.py", line 212, in MakeZenAlbum
    owner               = ZEN_ADMIN_USERID,
  File "/home/user/.local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 2075, in execute
    return connection.execute(statement, *multiparams, **params)
  File "/home/user/.local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 948, in execute
    return meth(self, multiparams, params)
  File "/home/user/.local/lib/python2.7/site-packages/sqlalchemy/sql/elements.py", line 269, in _execute_on_connection
    return connection._execute_clauseelement(self, multiparams, params)
  File "/home/user/.local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1060, in _execute_clauseelement
    compiled_sql, distilled_params
  File "/home/user/.local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1200, in _execute_context
    context)
  File "/home/user/.local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1413, in _handle_dbapi_exception
    exc_info
  File "/home/user/.local/lib/python2.7/site-packages/sqlalchemy/util/compat.py", line 203, in raise_from_cause
    reraise(type(exception), exception, tb=exc_tb, cause=cause)
  File "/home/user/.local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1193, in _execute_context
    context)
  File "/home/user/.local/lib/python2.7/site-packages/sqlalchemy/engine/default.py", line 507, in do_execute
    cursor.execute(statement, parameters)
  File "/home/user/.local/lib/python2.7/site-packages/MySQLdb/cursors.py", line 250, in execute
    self.errorhandler(self, exc, value)
  File "/home/user/.local/lib/python2.7/site-packages/MySQLdb/connections.py", line 50, in defaulterrorhandler
    raise errorvalue
sqlalchemy.exc.IntegrityError: (_mysql_exceptions.IntegrityError) (1062, "Duplicate entry 'albumname' for key 'folder'") [SQL: u'INSERT INTO xxx_albums (id, parentid, folder, title, `desc`, date, updateddate, thumb, mtime, sort_type, hitcounter, owner, codeblock) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)'] [parameters: (1446L, None, u'albumname', u'albumname', u'Albumname', '2016-12-04 15:08:46', '2017-08-19 22:15:06', u'PICT0001.JPG', 1386166126L, None, 2891L, 'user', 'a:0:{}')] (Background on this error at: http://sqlalche.me/e/gkpj)

Please to consider my fix in #2

@mebels mebels mentioned this issue Mar 1, 2018
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

1 participant