Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wallabag can't runing #316

Closed
DukeFox opened this issue Feb 2, 2023 · 13 comments · Fixed by #402
Closed

wallabag can't runing #316

DukeFox opened this issue Feb 2, 2023 · 13 comments · Fixed by #402

Comments

@DukeFox
Copy link

DukeFox commented Feb 2, 2023

I get an error when I use the following command

$ docker run -v /opt/wallabag/data:/var/www/wallabag/data -v /opt/wallabag/images:/var/www/wallabag/web/assets/images -p 80:80 -e "SYMFONY__ENV__DOMAIN_NAME=http://localhost" wallabag/wallabag

error log:

  PDO Driver (pdo_sqlite)   OK!                                                                                                                         
  Database connection       ERROR!   Can't connect to the database: An exception occurred in driver: SQLSTATE[HY000] [14] unable to open database file  
  Database version          OK!                                                                                                                         
  curl_exec                 OK!                                                                                                                         
  curl_multi_init           OK!                                                                                                                         
 ------------------------- -------- ------------------------------------------------------------------------------------------------------------------- 

12:29:16 ERROR     [console] Error thrown while running command "wallabag:install --env=prod -n". Message: "Some system requirements are not fulfilled. Please check output messages and fix them." ["exception" => RuntimeException { …},"command" => "wallabag:install --env=prod -n","message" => "Some system requirements are not fulfilled. Please check output messages and fix them."]

In InstallCommand.php line 163:
                                                                               
  Some system requirements are not fulfilled. Please check output messages an  
  d fix them.                                                                  
                                                                               

wallabag:install [--reset] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-e|--env ENV] [--no-debug] [--] 

It works fine if I use the following command

$ docker run  -v /opt/wallabag/images:/var/www/wallabag/web/assets/images -p 80:80 -e "SYMFONY__ENV__DOMAIN_NAME=http://localhost" wallabag/wallabag

How to fix it?

@j0k3r
Copy link
Member

j0k3r commented Feb 2, 2023

Does /opt/wallabag/data is writable?

@DukeFox
Copy link
Author

DukeFox commented Feb 2, 2023

Does /opt/wallabag/data is writable?

yes, 755/root

@DukeFox
Copy link
Author

DukeFox commented Feb 3, 2023

-v /opt/wallabag/images:/var/www/wallabag/web/assets/images

After enable local caching of images, there are no files inside this mapped directory either.

@df911
Copy link

df911 commented Feb 6, 2023

same problem here

@carlosmandel
Copy link

I have the same problem. On macOS using Docker Desktop, I managed to fix this issues by creating a db directory inside the hosts directory, but that doesn't work on my Linux host.

@laurentlbm
Copy link

laurentlbm commented Feb 13, 2023

EDIT: I was wrong, ignore this comment.

@j0k3r
Copy link
Member

j0k3r commented Feb 13, 2023

Hum it's weird.
The web folder means it'll be accessible to the world. The data folder shouldn't be accessible.

@laurentlbm
Copy link

You're right, I was wrong. I'll investigate a bit more.

@laurentlbm
Copy link

Upon investigation, the problem seems to be that it tries and fails to create the file /var/www/wallabag/data/db/wallabag.sqlite.

It can fail for 2 reasons:

  1. It requires the sub-directory db to already exist.
  2. It tries to create the SQLite file as the user nobody and fails unless that user has write-access to the db directory.

@igvr
Copy link

igvr commented Feb 19, 2023

bump.

tried creating db/ and db/wallabag.sqlite
with chmod -R 777 /var/www/wallabag/

@ozls
Copy link

ozls commented Mar 11, 2023

Solved it by (1) first creating the data folder and its db subfolder (2) doing sudo chown nobody data --recursive. Still, it's very bizarre behaviour

@jagaa8361
Copy link

I was also encountering the same problem when trying to set up a new one on Docker, using 2.5.4 and 2.5.3 images, same problem. with 2.5.2 images I had no problem.

@AdrianEarnshawMusic
Copy link

Same issue here, cannot seem to get the db to create. I’m on a Synology box and ozls workaround didn’t fix it for me. Ended up going down the mariadb route but would rather have SQLite.

fho added a commit to fho/wallabag-docker that referenced this issue Oct 13, 2023
When a volume mount was used for /var/wwww/wallabag/data, as
documented[^1].
The container failed to start with the error messages:
  wc: /var/www/wallabag/data/db/wallabag.sqlite: No such file or directory
  Configuring the SQLite database ...
  In ExceptionConverter.php line 76:
    An exception occurred in the driver: SQLSTATE[HY000] [14] unable to
    open database file
  [..]

When a volume mount is used, the /var/wwww/wallabag/data/db
directory and the empty /var/www/wallabag/data/db/wallabag.sqlite file
did not exist on startup.
Create the directory and the empty wallabag.sqlite if they do not exist
in the entrypoint script and make nobody the owner.

This fixes: wallabag#316

[^1]:https://github.com/wallabag/docker/tree/96dd9bc3e3d12b216471db03f5afacd6d1afac61#sqlite
fho added a commit to fho/wallabag-docker that referenced this issue Oct 13, 2023
When a volume mount was used for /var/wwww/wallabag/data, as
documented[^1], the container failed to start with the error messages:
  wc: /var/www/wallabag/data/db/wallabag.sqlite: No such file or directory
  Configuring the SQLite database ...
  In ExceptionConverter.php line 76:
    An exception occurred in the driver: SQLSTATE[HY000] [14] unable to
    open database file
  [..]

When a volume mount is used, the /var/wwww/wallabag/data/db
directory and the empty /var/www/wallabag/data/db/wallabag.sqlite file
does not exist on startup.
Create the directory and the empty wallabag.sqlite if they do not exist
in the entrypoint script and make nobody the owner.

This fixes: wallabag#316

[^1]:https://github.com/wallabag/docker/tree/96dd9bc3e3d12b216471db03f5afacd6d1afac61#sqlite
fho added a commit to fho/wallabag-docker that referenced this issue Oct 13, 2023
When a volume mount is used for /var/wwww/wallabag/data, as
documented[^1], the container fails to start with the error messages:

    wc: /var/www/wallabag/data/db/wallabag.sqlite: No such file or directory
    Configuring the SQLite database ...
    In ExceptionConverter.php line 76:
      An exception occurred in the driver: SQLSTATE[HY000] [14] unable to
      open database file
    [..]

In the volume mount the db directory and the empty db/wallabag.sqlite do
not exist which causes the issue.

Check in the entrypoint script if the file exist, if it does not create
the db directory and the file and make nobody the owner.

This fixes: wallabag#316

[^1]:https://github.com/wallabag/docker/tree/96dd9bc3e3d12b216471db03f5afacd6d1afac61#sqlite
Kdecherf added a commit that referenced this issue Mar 10, 2024
If we use a local folder volume binding, install_wallabag was failing
because of missing file and permission issues.

This reworks the way we initially create the database when it is missing
or empty.

Superseeds #386

Fixes #316 #346

Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
9 participants