alexbelgium / hassio-addons

My homeassistant addons
MIT License
1.35k stars 193 forks source link

[Photoprism] Addon won't start after some trouble with shares #1407

Closed JvdBBBB closed 1 month ago

JvdBBBB commented 1 month ago

Description

I am trying to install the Photoprism addon for Home Assistant, but I ran in some trouble.

I did not entirely understand how shared folders in HA work while I wanted to use an SMB share. In the process I had the addon running a couple of times with a file location I didn't want to use.

Now I have the file location correctly set and have seen the necessary folders created where I wanted them, but now the addon doesn't want to start:

time="2024-05-21T16:22:52+02:00" level=error msg="migrate: database is locked (create migrations table)"
time="2024-05-21T16:23:03+02:00" level=error msg="migrate: failed migrating photos_users"
time="2024-05-21T16:23:03+02:00" level=error msg="migrate: database is locked in photos_users (panic)"
time="2024-05-21T16:23:13+02:00" level=error msg="migrate: some database tables are missing"
time="2024-05-21T16:23:13+02:00" level=error msg="place: no such table: places (create zz)"

I use the default sqlite database, could it be that there is something left in there that interferes? Is there a way to reset the addon completely? I have tried reinstalling, but that didn't solve the issue.

Reproduction steps

Install addon and then remove the folder where it ran the first time.

Addon Logs

home directory: /data/photoprism
assets path...: /opt/photoprism/assets
storage path..: null
config path...: default
cache path....: default
backup path...: null
import path...: null
originals path: null
running as uid 0
photoprism start
time="2024-05-21T16:21:37+02:00" level=error msg="could not parse null as bool value for flag upload-nsfw, n: strconv.ParseBool: parsing \"null\": invalid syntax"
photoprism start
time="2024-05-21T16:21:47+02:00" level=error msg="could not parse null as bool value for flag upload-nsfw, n: strconv.ParseBool: parsing \"null\": invalid syntax"
photoprism start
time="2024-05-21T16:21:56+02:00" level=error msg="could not parse null as bool value for flag upload-nsfw, n: strconv.ParseBool: parsing \"null\": invalid syntax"
photoprism start
time="2024-05-21T16:22:06+02:00" level=error msg="could not parse null as bool value for flag upload-nsfw, n: strconv.ParseBool: parsing \"null\": invalid syntax"
photoprism start
Starting...
/etc/cont-init.d/00-banner.sh: executing

-----------------------------------------------------------
 Add-on: Photoprism
 A server-based application for browsing, organizing and sharing your personal photo collection
-----------------------------------------------------------
 Add-on version: 240420-ef5f14bc4
 You are running the latest version of this add-on.
 System: Home Assistant OS 12.3  (aarch64 / raspberrypi4-64)
 Home Assistant Core: 2024.5.4
 Home Assistant Supervisor: 2024.05.1
-----------------------------------------------------------
 Please, share the above information when looking for help
 or support in, e.g., GitHub, forums
-----------------------------------------------------------
 Provided by: https://github.com/alexbelgium/hassio-addons 
-----------------------------------------------------------
/etc/cont-init.d/00-folders.sh: executing
[16:22:18] INFO: Preparing scripts
... creating structure
... setting permissions
/etc/cont-init.d/00-global_var.sh: executing
BACKUP_PATH='/share/photoprism/backup'
CONFIG_LOCATION='/config/addons_config/photoprism/config.yaml'
DB_TYPE='sqlite'
IMPORT_PATH='/share/photoprism/import'
ORIGINALS_PATH='/share/photoprism/originals'
STORAGE_PATH='/share/photoprism/storage'
UPLOAD_NSFW='false'
certfile='fullchain.pem'
keyfile='privkey.pem'
ssl='false'
Timezone set from Etc/UTC to Europe/Amsterdam
/etc/cont-init.d/00-local_mounts.sh: executing
/etc/cont-init.d/00-smb_mounts.sh: executing
/etc/cont-init.d/01-config_yaml.sh: executing
Setting permissions for the config.yaml directory

Load environment variables from /config/addons_config/photoprism/config.yaml if existing

If accessing the file with filebrowser it should be mapped to /homeassistant/addons_config/photoprism/config.yaml
---------------------------------------------------------
Wiki here on how to use : github.com/alexbelgium/hassio-addons/wiki/Add‐ons-feature-:-add-env-variables
... no env variables found, exiting
/etc/cont-init.d/01-custom_script.sh: executing
Execute /homeassistant/addons_config/photoprism/photoprism.sh if existing
Wiki here : github.com/alexbelgium/hassio-addons/wiki/Add-ons-feature-:-customisation
/etc/cont-init.d/30-graphic_drivers.sh: executing
/etc/cont-init.d/32-nginx_ingress.sh: executing
/etc/cont-init.d/32-nginx_ssl.sh: executing
/etc/cont-init.d/90-disable_ingress.sh: executing
/etc/cont-init.d/99-run.sh: executing
[16:22:20] INFO: Defining database
[16:22:20] INFO: Using a local sqlite database
[16:22:20] WARNING: Ingress is enabled. To connect, you must add /api/hassio_ingress/wog3GjEyQ-15IWrYN_MNbuRdgvyBsRIsnY9ifDLr81k/ to the end of your access point. Example : http://my-url:8123/api/hassio_ingress/wog3GjEyQ-15IWrYN_MNbuRdgvyBsRIsnY9ifDLr81k/
[16:22:32] INFO: Please wait 1 or 2 minutes to allow the server to load
[16:22:32] INFO: Default username : admin, default password: "please_change_password"
[16:22:32] INFO: Starting, please wait for next green text...
started 240518 as root (arm64-prod)
init: https
Creation of a default HTTPS/TLS certificate is skipped because PHOTOPRISM_DEFAULT_TLS is "false".
Problems? Our Troubleshooting Checklists help you quickly diagnose and solve them:
https://docs.photoprism.app/getting-started/troubleshooting/
file umask....: "0002" (u=rwx,g=rwx,o=rx)
home directory: /data/photoprism
assets path...: /opt/photoprism/assets
storage path..: /share/photoprism/storage
config path...: default
cache path....: default
backup path...: /share/photoprism/backup
import path...: /share/photoprism/import
originals path: /share/photoprism/originals
running as uid 0
photoprism start
time="2024-05-21T16:22:42+02:00" level=info msg="config: case-insensitive file system detected"
time="2024-05-21T16:22:42+02:00" level=info msg="Become a member today, support our mission and enjoy our member benefits! 💎"
time="2024-05-21T16:22:42+02:00" level=info msg="Visit https://www.photoprism.app/membership to learn more."
time="2024-05-21T16:22:52+02:00" level=error msg="migrate: database is locked (create migrations table)"
time="2024-05-21T16:23:03+02:00" level=error msg="migrate: failed migrating photos_users"
time="2024-05-21T16:23:03+02:00" level=error msg="migrate: database is locked in photos_users (panic)"
time="2024-05-21T16:23:13+02:00" level=error msg="migrate: some database tables are missing"
time="2024-05-21T16:23:13+02:00" level=error msg="place: no such table: places (create zz)"

Architecture

No response

OS

HAos

alexbelgium commented 1 month ago

Hi, to restart from scratch there could be files located in several places :

Globally, HA manages two main locations :

JvdBBBB commented 1 month ago

I tried removing the files and folders you mentioned, and reinstalling the addon, but that didn't help. Then I switched to MariaDB which solved the issue. So I think something that stays in the database after the uninstall of the addon screwed things up.

alexbelgium commented 1 month ago

Well as long as it works :-) and mariadb is much more efficient and faster in the longer term than sqlite