steemit / steem-python

The official Python (3) library for the Steem Blockchain.
https://steem.io
MIT License
154 stars 99 forks source link

Support read-only filesystem #123

Closed rosevill closed 6 years ago

rosevill commented 6 years ago

In a read-only file system environment, such as AWS Lambda, import Steem module will get the following error. Please provide a way to configure storage path.

from steem import Steem File "/usr/local/lib/python3.6/site-packages/steem/init.py", line 2, in from .steem import Steem File "/usr/local/lib/python3.6/site-packages/steem/steem.py", line 1, in from .commit import Commit File "/usr/local/lib/python3.6/site-packages/steem/commit.py", line 18, in from steembase.storage import configStorage File "/usr/local/lib/python3.6/site-packages/steembase/storage.py", line 459, in keyStorage = Key() File "/usr/local/lib/python3.6/site-packages/steembase/storage.py", line 114, in init super(Key, self).init() File "/usr/local/lib/python3.6/site-packages/steembase/storage.py", line 51, in init self.mkdir_p() File "/usr/local/lib/python3.6/site-packages/steembase/storage.py", line 61, in mkdir_p os.makedirs(self.data_dir) File "/usr/local/lib/python3.6/os.py", line 210, in makedirs makedirs(head, mode, exist_ok) File "/usr/local/lib/python3.6/os.py", line 210, in makedirs makedirs(head, mode, exist_ok) File "/usr/local/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) OSError: [Errno 30] Read-only file system: '/root/.local'

Boontjie commented 6 years ago

This is difficult to do as a general solution. You would need to assume some sort of database, I suggest you convert this section of code to use a database on AWS instead on your own.

sneak commented 6 years ago

I believe this may have already been fixed. Could you verify that this issue still exists on master?

cyon1c commented 6 years ago

Closing this for now as it appears to be fixed. If you are still having issues @rosevill , please let us know.