Comments (2)
Could this be because of a RelStorage cache problem?
Unlikely. This is a low-level SystemError
that can only be produced by C code doing incorrect thing; it arises from a call to something like PyArg_Parse
being given a non-tuple --- C functions get a object args
argument that they break apart using a call like that.
Given the traceback, it's likely that obj
is a component of an OOBTree
, and you can definitely get an error like this if you pass the C code of OOBTree
something it doesn't like (which is really a bug in OOBTree); the Python implementation does better:
>>> from BTrees import OOBTree
>>> OOBTree.Bucket().__setstate__(1)
╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ in <module>:1 │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
SystemError: new style getargs format but argument is not a tuple
>>> OOBTree.BucketPy().__setstate__(1)
╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ in <module>:1 │
│ │
│ //lib/python3.10/site-packages/BTrees/_base.py:467 in │
│ __setstate__ │
│ │
│ 464 │ │ return (data, ) │
│ 465 │ │
│ 466 │ def __setstate__(self, state): │
│ ❱ 467 │ │ if not isinstance(state[0], tuple): │
│ 468 │ │ │ raise TypeError("tuple required for first state element") │
│ 469 │ │ │
│ 470 │ │ self.clear() │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
TypeError: 'int' object is not subscriptable
So most likely there's a mismatch between the type of state and the class of obj
. The database, and the cache, is keyed primarily by OID (_p_oid
), and that's why I say it being a caching problem is unlikely; instead, I would be suspicious of something playing low-level tricks with OIDs, or manipulating the database directly (e.g., assigning an OID directly, leading to a class mismatch with what's in the local Connection's ghost cache, or restoring a backup while running). A restart (or clearing the ghost cache) would force a new ghost object to be created with the right class as read from the database.
Closing for now, but if this is something you can still reproduce, feel free to re-open and we can look at some more steps for debugging (in particular, we'd want to get the state
value and ideally the entire pickled row from the database for that OID at the same time).
from relstorage.
Hi Jason,
I'll try to reproduce the problem. But as far as I can remember, this only occurs in production (where I use Apache and mod_wsgi) and not in development (where I just use Pyramid's "pserve" to run the application).
Best regards,
Thierry
from relstorage.
Related Issues (20)
- tpc_abort cleanup can fail on unexpected exceptions HOT 1
- Postgresql config recommendations for Relstorage HOT 7
- Change locking order to eliminate deadlocks
- Cache vacuuming can sometimes take way too long HOT 1
- Clarification on oids.sqlite3 in SQLite storage HOT 2
- FIPS support HOT 5
- Problem packing RelStorage HOT 5
- psycopg2.ProgrammingError: named cursor isn't valid anymore HOT 1
- When Relstorage 3.5.0 final or beta? HOT 2
- Why is psycopg2-binary not recommended in production use? HOT 3
- psycopg2.errors.DuplicateObject: type "temp_store" already exists HOT 7
- Prepack fails HOT 2
- pg8000 driver - AttributeError: 'Connection' object has no attribute 'in_transaction' HOT 2
- Avoiding UnableToLockRowsToReadCurrentError exceptions HOT 2
- Question about Pyramid + ZODB + RelStorage performances HOT 2
- Unable to install: fails to build relstorage.cache.cache extension HOT 6
- Large PostgreSQL database with blobs HOT 3
- Persistent cache not working? HOT 5
- Problem installing on macOS Sonoma HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from relstorage.