I've got a scenario where I have a pipeline execute multiple times, especially in development, creating the same filename multiple times but from different commit shas. For example, nupic-0.2.4.dev0-cp27-none-linux_x86_64.whl
.
<snip>
pypi.default_read = everyone
pypi.default_write = authenticated
pypi.allow_overwrite = True
<snip>
and I'm using the default sqlite3 cache. When a package that has been previously uploaded is built, it tries to upload it, but gets back an HTTP 500 error because of the sqlite constraints on filename. Any thoughts?
Traceback (most recent call last):
File "/opt/numenta/anaconda/lib/python2.7/site-packages/pyramid/router.py", line 242, in __call__
response = self.invoke_subrequest(request, use_tweens=True)
File "/opt/numenta/anaconda/lib/python2.7/site-packages/pyramid/router.py", line 217, in invoke_subrequest
response = handle_request(request)
File "/opt/numenta/anaconda/lib/python2.7/site-packages/pyramid/tweens.py", line 21, in excview_tween
response = handler(request)
File "/opt/numenta/anaconda/lib/python2.7/site-packages/pyramid_tm/__init__.py", line 99, in tm_tween
reraise(*exc_info)
File "/opt/numenta/anaconda/lib/python2.7/site-packages/pyramid_tm/__init__.py", line 87, in tm_tween
manager.commit()
File "/opt/numenta/anaconda/lib/python2.7/site-packages/transaction/_manager.py", line 111, in commit
return self.get().commit()
File "/opt/numenta/anaconda/lib/python2.7/site-packages/transaction/_transaction.py", line 280, in commit
reraise(t, v, tb)
File "/opt/numenta/anaconda/lib/python2.7/site-packages/transaction/_transaction.py", line 271, in commit
self._commitResources()
File "/opt/numenta/anaconda/lib/python2.7/site-packages/transaction/_transaction.py", line 417, in _commitResources
reraise(t, v, tb)
File "/opt/numenta/anaconda/lib/python2.7/site-packages/transaction/_transaction.py", line 389, in _commitResources
rm.tpc_begin(self)
File "/opt/numenta/anaconda/lib/python2.7/site-packages/zope/sqlalchemy/datamanager.py", line 90, in tpc_begin
self.session.flush()
File "/opt/numenta/anaconda/lib/python2.7/site-packages/sqlalchemy/orm/session.py", line 2004, in flush
self._flush(objects)
File "/opt/numenta/anaconda/lib/python2.7/site-packages/sqlalchemy/orm/session.py", line 2122, in _flush
transaction.rollback(_capture_exception=True)
File "/opt/numenta/anaconda/lib/python2.7/site-packages/sqlalchemy/util/langhelpers.py", line 60, in __exit__
compat.reraise(exc_type, exc_value, exc_tb)
File "/opt/numenta/anaconda/lib/python2.7/site-packages/sqlalchemy/orm/session.py", line 2086, in _flush
flush_context.execute()
File "/opt/numenta/anaconda/lib/python2.7/site-packages/sqlalchemy/orm/unitofwork.py", line 373, in execute
rec.execute(self)
File "/opt/numenta/anaconda/lib/python2.7/site-packages/sqlalchemy/orm/unitofwork.py", line 532, in execute
uow
File "/opt/numenta/anaconda/lib/python2.7/site-packages/sqlalchemy/orm/persistence.py", line 174, in save_obj
mapper, table, insert)
File "/opt/numenta/anaconda/lib/python2.7/site-packages/sqlalchemy/orm/persistence.py", line 728, in _emit_insert_statements
execute(statement, multiparams)
File "/opt/numenta/anaconda/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 914, in execute
return meth(self, multiparams, params)
File "/opt/numenta/anaconda/lib/python2.7/site-packages/sqlalchemy/sql/elements.py", line 323, in _execute_on_connection
return connection._execute_clauseelement(self, multiparams, params)
File "/opt/numenta/anaconda/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1010, in _execute_clauseelement
compiled_sql, distilled_params
File "/opt/numenta/anaconda/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1146, in _execute_context
context)
File "/opt/numenta/anaconda/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1341, in _handle_dbapi_exception
exc_info
File "/opt/numenta/anaconda/lib/python2.7/site-packages/sqlalchemy/util/compat.py", line 199, in raise_from_cause
reraise(type(exception), exception, tb=exc_tb)
File "/opt/numenta/anaconda/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1139, in _execute_context
context)
File "/opt/numenta/anaconda/lib/python2.7/site-packages/sqlalchemy/engine/default.py", line 450, in do_execute
cursor.execute(statement, parameters)
sqlalchemy.exc.IntegrityError: (sqlite3.IntegrityError) UNIQUE constraint failed: packages.filename [SQL: u'INSERT INTO packages (filename, name, version, last_modified, data) VALUES (?, ?, ?, ?, ?)'] [parameters: (u'nupic-0.2.4.dev0-cp27-none-linux_x86_64.whl', u'nupic', u'0.2.4.dev0', '2015-06-18 11:22:59.368843', '{"url": "https://<S3_BACKEND>/nupic/nupic-0.2.4.dev0-cp27-none-linux_x86_64.whl?Signature=0Xzral9YyFFWCwtODTmWtRT2aEo%3D&Expires=1434712980&AWSAccessKeyId=<AWS_ACCESS_KEY_ID>", "path": "c544/nupic/nupic-0.2.4.dev0-cp27-none-linux_x86_64.whl", "expire": 1434712380.16067}')]
[pid: 7148|app: 0|req: 7477/10404] 10.0.1.42 () {44 vars in 748 bytes} [Thu Jun 18 11:22:58 2015] POST / => generated 0 bytes in 1244 msecs (HTTP/1.1 500) 0 headers in 0 bytes (0 switches on core 0)