Reputation: 589
I am banging my head over this one. I have successfully completed the SQLAlcemy + URL Dispatch tutorial in the past. Now whatever I do, the attempts to write to the sqlite db file all fail, throwing:
OperationalError: (OperationalError) attempt to write a readonly database u'INSERT INTO pages (name, data) VALUES (?, ?)' (u'NewPage', u'A new page is dawning.')
The variations in my current configuration are:
The datafile initializes fine. The ownership is the same as the wsgi process owner. I'm baffled.
Here's the models.py:
from sqlalchemy import (
Column,
Index,
Integer,
Text,
)
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import (
scoped_session,
sessionmaker,
)
from zope.sqlalchemy import ZopeTransactionExtension
DBSession = scoped_session(sessionmaker(extension=ZopeTransactionExtension()))
Base = declarative_base()
class Page(Base):
__tablename__ = 'pages'
id = Column(Integer, primary_key=True)
name = Column(Text, unique=True)
data = Column(Text)
def __init__(self, name, data):
self.name = name
self.data = data
Index('page_index', Page.name, unique=True, mysql_length=255)
Pretty straightforward out of the tutorial.
Any thoughts greatly appreciated.
Upvotes: 0
Views: 2538
Reputation: 589
Daemon process owner could not write to the file even though the same owner created the file. WTF? Anyway, manually setting 666 on the sqlite file has cleared this up.
Upvotes: 1