Open AlphaJack opened 3 days ago
This sounds like some form of database corruption, either because podman wrote something invalid or because the actual sqlite db is corrupted.
cc @mheon
The JSON field is defined as JSON TEXT NOT NULL
so why do we get NULL back from the db here?
name "JSON": converting NULL to string is unsupported
@AlphaJack Can you run sqlite3 ~/.local/share/containers/storage/db.sql
and then SELECT * FROM ContainerState;
inside there to show us how the table looks there.
@Luap99
~ Gasolio@P4|> sqlite3 ~/.local/share/containers/storage/db.sql
SQLite version 3.46.0 2024-05-23 13:25:27
Enter ".help" for usage hints.
sqlite> SELECT * FROM ContainerState;
7dd71076b254bb2b7d7d45ff3b06c2f1ac1e8f5c3e1c0a1c342d670c5809fe83|21b209447f5eef5f8de6c095e7157b873e10ea7908f45eb6be368a2a3f3ad974||
sqlite> PRAGMA table_info(ContainerState);
0|ID|TEXT|1||1
1|State|INTEGER|1||0
2|ExitCode|INTEGER|0||0
3|JSON|TEXT|1||0
Removing the file seems to have fixed the issue for the network quadlet, but not for the containers:
Jul 01 18:26:45 P4 podman[25941]: 2024-07-01 18:26:45.82353107 +0200 CEST m=+0.084629881 image pull 8ef1bb9aad44f85399ca3bfbfb26f676e4299c76a424beb829d0288a88440042 ghcr.io/blakeblackshear/frigate:stable
Jul 01 18:26:46 P4 podman[25941]: 2024-07-01 18:26:46.035131519 +0200 CEST m=+0.296230311 container create ad2dcba28e63cf93bcd8f65d45d8d6bfd8e4904c058417f9562c5ad30c08d3b5 (image=ghcr.io/blakeblackshear/frigate:stable, name=frigate, PODMAN_S>
Jul 01 18:26:46 P4 conmon[26047]: conmon ad2dcba28e63cf93bcd8 <nwarn>: runtime stderr: access `/run/user/1000/crun/ad2dcba28e63cf93bcd8f65d45d8d6bfd8e4904c058417f9562c5ad30c08d3b5`: Permission denied
Jul 01 18:26:46 P4 conmon[26047]: conmon ad2dcba28e63cf93bcd8 <error>: Failed to create container: exit status 1
Jul 01 18:26:46 P4 frigate[26050]: cannot open run directory `/run/user/1000/crun`: Permission denied
Jul 01 18:26:46 P4 frigate[25941]: time="2024-07-01T18:26:46+02:00" level=error msg="Removing container ad2dcba28e63cf93bcd8f65d45d8d6bfd8e4904c058417f9562c5ad30c08d3b5 from runtime after creation failed"
Jul 01 18:26:47 P4 podman[25941]: 2024-07-01 18:26:47.567421118 +0200 CEST m=+1.828519891 container remove ad2dcba28e63cf93bcd8f65d45d8d6bfd8e4904c058417f9562c5ad30c08d3b5 (image=ghcr.io/blakeblackshear/frigate:stable, name=frigate, PODMAN_S>
Jul 01 18:26:47 P4 frigate[25941]: Error: crun: access `/run/user/1000/crun/ad2dcba28e63cf93bcd8f65d45d8d6bfd8e4904c058417f9562c5ad30c08d3b5`: Permission denied: OCI permission denied
Jul 01 18:26:47 P4 systemd[564]: frigate.service: Main process exited, code=exited, status=126/n/a
Thanks
7dd71076b254bb2b7d7d45ff3b06c2f1ac1e8f5c3e1c0a1c342d670c5809fe83|21b209447f5eef5f8de6c095e7157b873e10ea7908f45eb6be368a2a3f3ad974||
That does not look right, 21b209447f5eef5f8de6c095e7157b873e10ea7908f45eb6be368a2a3f3ad974
is clearly not an integer. I am not really familiar with sqlite so it is hard to tell what went wrong. Did you have a hard shutdown or powerloss maybe?
To fix your system the best chance is to remove or better rename it so we can have a peak at it if needed then the quadlets should regenerate the necessary containers in theory
Removing the file seems to have fixed the issue for the network quadlet, but not for the containers:
Maybe try to reboot again, there is some special refresh logic that must run after boot maybe the weird the state caused that to fail.
If you still have the broken file following the steps here (under 2) might be interesting: https://www.sqlite.org/recovery.html
Now it works again, I run:
mv ~/.local/share/containers/storage/db.sql ~/.local/share/containers/storage/db.sql.old`
podman system reset
sudo reboot now
Would be still interesting to understand the cause and how a non-int value was saved to Sqlite
Well it is not like you can just like safe a invalid value. This really sounds like a proper database corruption hence why question if you had a hard shutdown or powerloss? Or maybe check your hard drive for disk errors etc... Of course it could also be a bug in podman or sqlite3 https://www.sqlite.org/howtocorrupt.html
Without having a reproducer it will be basically impossible to find out.
Without having a reproducer it will be basically impossible to find out.
Then I think we can close the issue and leave the steps I mentioned as a workaround
Issue Description
I cannot start any network or container quadlet because of the error
Steps to reproduce the issue
Steps to reproduce the issue
Jul 01 17:31:46 P4 pod-network[8158]: Error: scanning container state row: sql: Scan error on column index 1, name "JSON": converting NULL to string is unsupported
:podman container ps
and other commands returns the same errorDescribe the results you received
Describe the results you received
Describe the results you expected
Quadlets are activated as before
podman info output
Podman in a container
No
Privileged Or Rootless
Rootless
Upstream Latest Release
Yes
Additional environment details
Additional environment details
Additional information
sudo podman version
works, and so dosudo podman info
: