Hi Guix,
I was super exited to learn about the gunicorn-service-type and eager
to try it with one of my web services, but… something weird happened when
the service tried to write to the SQLite database!
The definition is:
```scheme
(define gertrude-gunicorn-apps
(match-record-lambda <gertrude-configuration>
(gertrude server-name socket database-file site-name)
(list
(gunicorn-app
; […]
(mappings
(list
(file-system-mapping
(source (dirname database-file))
(target source)
(writable? #t))))))))
```
I run the service in a container using:
`sudo (guix system container containers/gertrude.scm --network
--share=data/gertrude/=/var/lib/gertrude/)`
When the service tries to write to the database, it gets a `attempt to write a
readonly database` error.
>From within the container, the permissions are `-rw-r--r-- 1 gertrude gertrude
>28K Mar 6 13:42 /var/lib/gertrude/db.sqlite`.
Just to make sure, I created a container with the same `--share` and the
`sqlite` package
and I added some data to the DB from within the container. They were
successfully written and visible from my data folder outside the container.
And to make sure-sure, I added the records to the DB from within the container
the same way Gertrude does it, with Python and SQLAlchemy. And it worked as
expected.
So the problem might be that the gunicorn service is actually containerized
within the container itself!
Way out of my comfort zone! 😅
Any idea welcome!
Regards,
--
Tanguy
P.S. This was about a week ago. In the mean time, I decided to circumvent the
problem
and use a proper database, but this will be the object of a second email…