g-battaglia / kerykeion

Data driven Astrology 💫
Kerykeion is a python library for astrology. It can generate SVG charts and extract all data about a birthchart, a synastry chart and a transit chart.
https://kerykeion.net
GNU Affero General Public License v3.0
297 stars 103 forks source link

Permission error "write a readonly database" #70

Closed to175 closed 1 year ago

to175 commented 1 year ago

Hello,

I can run my app with kerykeion on local however I have these errors when i put it on my server... All perms are good (777) and the city also. I don't understand why I got these errors which are not correlated to my bug. What is the first error ? "attempt to write a readonly database" ? is it from http://api.geonames.org/searchJSON ? Errors are not clear at all

PermissionError(13, 'Permission denied')

Full traceback :

2023-06-14 11:55:17,591 - KrInstance - ERROR - Error in fetching http://api.geonames.org/searchJSON: attempt to write a readonly database
2023-06-14 11:55:17,591 - KrInstance - ERROR - Error in fetching timezone: 'lat'
raise KerykeionException(
kerykeion.types.KerykeionException: No data found for this city, try again! Maybe check your connection?
g-battaglia commented 1 year ago

It looks like your fetching timezone for lat, I belive it's not a issue with the library.

to175 commented 1 year ago

I understand. However the code works fine in local env and I use very simple config like this KrInstance('name, 1990, 1, 1, 10, 30, 'Paris')

I dont understand why kerykeion throw me 2023-06-14 13:40:16,532 - KrInstance - ERROR - Error in fetching http://api.geonames.org/searchJSON: attempt to write a readonly database

Which error comes from

self.responses[cache_key] = cached_response
  File "/home/debian/Desktop/bot/botscript/venv/lib/python3.9/site-packages/requests_cache/backends/sqlite.py", line 283, in __setitem__
    con.execute(
sqlite3.OperationalError: attempt to write a readonly database

For you information the file .../botscript/venv/lib/python3.9/site-packages/requests_cache/backends/sqlite.py has the permissions rwxrwxrwx so the error thrown is more than strange

to175 commented 1 year ago

I have solved Permission error by adding permissions for www-data to write in cache/kerykeion_geonames_cache.sqlite in the right file (apache dirs)

Hoever, still had to "city not found" error, which is Paris so this is not normal... So I trouble shoot and find some errors from my side. I mean message is city not found but real error is not that so error messages must be changed...