You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Если на сайте ID карточки у одного пользователя удалили, а другому сразу же его добавили, то при синхронизации может возникнуть ошибка, связанная с валидацией уникальности карт:
root@bramnik:/srv/Bramnik/software/host# ./run_sync.sh
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 20523 0 20523 0 0 16362 0 --:--:-- 0:00:01 --:--:-- 16379
Traceback (most recent call last):
File "/srv/Bramnik/software/host/env/lib/python3.7/site-packages/peewee.py", line 6741, in get
return clone.execute(database)[0]
File "/srv/Bramnik/software/host/env/lib/python3.7/site-packages/peewee.py", line 4184, in __getitem__
return self.row_cache[item]
IndexError: list index out of range
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/srv/Bramnik/software/host/env/lib/python3.7/site-packages/peewee.py", line 6360, in get_or_create
return query.get(), False
File "/srv/Bramnik/software/host/env/lib/python3.7/site-packages/peewee.py", line 6746, in get
(clone.model, sql, params))
models.CardDoesNotExist: <Model: Card> instance matching query does not exist:
SQL: SELECT "t1"."id", "t1"."user_id", "t1"."card_id" FROM "cards" AS "t1" WHERE (("t1"."user_id" = ?) AND ("t1"."card_id" = ?)) LIMIT ? OFFSET ?
Params: [23, '2c4aae9c', 1, 0]
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "bramnik_mgr.py", line 170, in <module>
main()
File "bramnik_mgr.py", line 166, in main
cli()
File "/srv/Bramnik/software/host/env/lib/python3.7/site-packages/click/core.py", line 764, in __call__
return self.main(*args, **kwargs)
File "/srv/Bramnik/software/host/env/lib/python3.7/site-packages/click/core.py", line 717, in main
rv = self.invoke(ctx)
File "/srv/Bramnik/software/host/env/lib/python3.7/site-packages/click/core.py", line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/srv/Bramnik/software/host/env/lib/python3.7/site-packages/click/core.py", line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/srv/Bramnik/software/host/env/lib/python3.7/site-packages/click/core.py", line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/srv/Bramnik/software/host/env/lib/python3.7/site-packages/click/core.py", line 555, in invoke
return callback(*args, **kwargs)
File "bramnik_mgr.py", line 58, in sync
card, created = Card.get_or_create(user_id=user.id, card_id=sanitized_key)
File "/srv/Bramnik/software/host/env/lib/python3.7/site-packages/peewee.py", line 6362, in get_or_create
raise exc
File "/srv/Bramnik/software/host/env/lib/python3.7/site-packages/peewee.py", line 6357, in get_or_create
return cls.create(**kwargs), True
File "/srv/Bramnik/software/host/env/lib/python3.7/site-packages/peewee.py", line 6235, in create
inst.save(force_insert=True)
File "/srv/Bramnik/software/host/env/lib/python3.7/site-packages/peewee.py", line 6433, in save
pk = self.insert(**field_dict).execute()
File "/srv/Bramnik/software/host/env/lib/python3.7/site-packages/peewee.py", line 1845, in inner
return method(self, database, *args, **kwargs)
File "/srv/Bramnik/software/host/env/lib/python3.7/site-packages/peewee.py", line 1916, in execute
return self._execute(database)
File "/srv/Bramnik/software/host/env/lib/python3.7/site-packages/peewee.py", line 2665, in _execute
return super(Insert, self)._execute(database)
File "/srv/Bramnik/software/host/env/lib/python3.7/site-packages/peewee.py", line 2400, in _execute
cursor = database.execute(self)
File "/srv/Bramnik/software/host/env/lib/python3.7/site-packages/peewee.py", line 3070, in execute
return self.execute_sql(sql, params, commit=commit)
File "/srv/Bramnik/software/host/env/lib/python3.7/site-packages/peewee.py", line 3064, in execute_sql
self.commit()
File "/srv/Bramnik/software/host/env/lib/python3.7/site-packages/peewee.py", line 2831, in __exit__
reraise(new_type, new_type(exc_value, *exc_args), traceback)
File "/srv/Bramnik/software/host/env/lib/python3.7/site-packages/peewee.py", line 183, in reraise
raise value.with_traceback(tb)
File "/srv/Bramnik/software/host/env/lib/python3.7/site-packages/peewee.py", line 3057, in execute_sql
cursor.execute(sql, params or ())
peewee.IntegrityError: UNIQUE constraint failed: cards.card_id
The text was updated successfully, but these errors were encountered:
Если на сайте ID карточки у одного пользователя удалили, а другому сразу же его добавили, то при синхронизации может возникнуть ошибка, связанная с валидацией уникальности карт:
The text was updated successfully, but these errors were encountered: