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

[BUG] App randomly resets its state to brand new install #242

Open
MadTiago opened this issue Sep 30, 2023 · 12 comments
Open

[BUG] App randomly resets its state to brand new install #242

MadTiago opened this issue Sep 30, 2023 · 12 comments
Labels
bug Something isn't working can't reproduce An issue that's not reproducable

Comments

@MadTiago
Copy link
Contributor

MadTiago commented Sep 30, 2023

Describe the bug
I deployed a brand new LXC container with Ubuntu 22.04, specifically for this app.
The only additional package installed was nmap.
Went to the IP:8090 URL, setup the admin account and started adding a couple devices, changed 2 or 3 settings,
and the app randomly redirects me to the fresh install setup again.
I tried a few times, running as non-root and root, sometimes it was almost instant, sometimes it took longer, but it always reverts back to a fresh install.

To Reproduce
Steps to reproduce the behavior:

  1. Start the app
  2. Add 1 or 2 devices
  3. Changed user avatar, page title and lazy ping.
  4. When changing page, it randomly resets to a fresh install state.

Expected behavior
App should remember its state and not reset.

Host OS (and version)
Ubuntu 22.04 on proxmox LXC

Host Architecture
amd64

Brower (if relevant)
Chrome 117.0.5938.132 64bit

@seriousm4x
Copy link
Owner

Are you using a reverse proxy? It sounds very similar to this issue here: #65

Can you check the network tab in your browser dev tools? What is the response of settings_public? Should say "setup_completed": true
image

@MadTiago
Copy link
Contributor Author

MadTiago commented Sep 30, 2023

I intend to user later, at this moment was just trying it out first with direct access.
There's nothing else running on the LXC container and no proxy.
I also checked that issue before posting, and the solution was not relevant.
It does indeed say "setup_completed": true

@MadTiago
Copy link
Contributor Author

Ok, so I did a fresh install, setup the admin account, added 1 device and refreshed the page. It took me to the setup page again.
But... I noticed that it did save the data, since I stopped the upsnap execution and relaunched it, being now redirected to the login page and the device is there.
So I guess its just a redirect bug somewhere, since data seems ok.

@seriousm4x
Copy link
Owner

This will hopefully fix it. I will publish a beta as soon as #71 is done.

@seriousm4x
Copy link
Owner

@MadTiago
Copy link
Contributor Author

MadTiago commented Oct 1, 2023

I've deployed both versions (4.0.7 and 4.1.0-beta1) on the same conditions. And I can't replicate the bug now.
It only happened once today on 4.1.0-beta1, then it I tried new installs (removing pb_data folder in between) and couldn't make it redirect. I'm confused now, because it happened every single time yesterday. And the server env is the same.

@seriousm4x
Copy link
Owner

Ah, these are the most annoying bugs! Keep me up to date

@seriousm4x seriousm4x added the can't reproduce An issue that's not reproducable label Oct 10, 2023
@seriousm4x seriousm4x added the bug Something isn't working label Dec 14, 2023
@czm97176
Copy link

czm97176 commented Dec 17, 2023

i had the similar issue the app reset to brand new setting page and ask me to create admin account. it always happened after running update by watchtower but i am not quite sure why this happened.

@seriousm4x
Copy link
Owner

i had the similar issue the app reset to brand new setting page and ask me to create admin account. it always happened after running update by watchtower but i am not quite sure why this happened.

What does your docker-compose file look like?

@Nonobis
Copy link

Nonobis commented Apr 24, 2024

Got same problem on clean install... i have this docker container logs

[INFO] 2024/04/24 11:56:16 pb.go:272: Ping interval set to @every 10s # Sets the interval in which the devices are pinge
2024/04/24 11:56:16 Server started at http://0.0.0.0:8090
├─ REST API: http://0.0.0.0:8090/api/
└─ Admin UI: http://0.0.0.0:8090/_/
[DEBUG]2024/04/24 12:03:57 base.go:1250: Failed to write log &{{false n0niowlhpwkcnup 2024-04-24 12:03:51.364Z 2024-04-24 12:03:51.364Z} map[auth:guest details:No client associated with connection ID "h3ZfXimAVXJpjDgz4Xngx83L7YFovzcxMUBiok1W" error:Missing or invalid client id. execTime:0.105992 method:POST referer:http://192.168.1.50:8090/ remoteIp:10.0.0.2 status:404 type:request url:/api/realtime userAgent:Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36 Edg/124.0.0.0 userIp:10.0.0.2] POST /api/realtime 8} database disk image is malformed (11)
[DEBUG]2024/04/24 12:03:57 base.go:1250: Failed to write log &{{false 7lqcs9eqkgrl2r5 2024-04-24 12:03:53.491Z 2024-04-24 12:03:53.491Z} map[auth:guest details:No client associated with connection ID "4Qag8BhhP7vdcPH0URJIMhCpIpTDSMWzxTmd32oB" error:Missing or invalid client id. execTime:0.055291 method:POST referer:http://192.168.1.50:8090/ remoteIp:10.0.0.2 status:404 type:request url:/api/realtime userAgent:Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36 Edg/124.0.0.0 userIp:10.0.0.2] POST /api/realtime 8} database disk image is malformed (11)
[DEBUG]2024/04/24 12:03:57 base.go:1250: Failed to write log &{{false tj3ad5khe61gndj 2024-04-24 12:03:53.515Z 2024-04-24 12:03:53.515Z} map[auth:guest details: error:The request requires valid admin authorization token to be set. execTime:0.02532 method:POST referer:http://192.168.1.50:8090/ remoteIp:10.0.0.2 status:401 type:request url:/api/admins/auth-refresh userAgent:Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36 Edg/124.0.0.0 userIp:10.0.0.2] POST /api/admins/auth-refresh 8} database disk image is malformed (11)
[DEBUG]2024/04/24 12:03:57 base.go:1250: Failed to write log &{{false quh75b3zdlqqr7c 2024-04-24 12:03:54.128Z 2024-04-24 12:03:54.128Z} map[auth:guest execTime:2.558161 method:GET referer:http://192.168.1.50:8090/login/ remoteIp:10.0.0.2 status:200 type:request url:/api/collections/users/auth-methods userAgent:Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36 Edg/124.0.0.0 userIp:10.0.0.2] GET /api/collections/users/auth-methods 0} database disk image is malformed (11)
[DEBUG]2024/04/24 12:04:11 base.go:1250: Failed to write log &{{false 95hbjrkzb9hk53b 2024-04-24 12:04:04.814Z 2024-04-24 12:04:04.814Z} map[auth:admin execTime:2.511521 method:GET referer:http://192.168.1.50:8090/ remoteIp:10.0.0.2 status:200 type:request url:/api/collections/devices/records?page=1&perPage=1000&skipTotal=1&sort=name&expand=ports%2Cgroups userAgent:Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36 Edg/124.0.0.0 userIp:10.0.0.2] GET /api/collections/devices/records?page=1&perPage=1000&skipTotal=1&sort=name&expand=ports,groups 0} database disk image is malformed (11)
[DEBUG]2024/04/24 12:04:11 base.go:1250: Failed to write log &{{false 3kgn1o9z3v3jp55 2024-04-24 12:04:04.859Z 2024-04-24 12:04:04.859Z} map[auth:admin execTime:2.254506 method:GET referer:http://192.168.1.50:8090/ remoteIp:10.0.0.2 status:200 type:request url:/api/collections/devices/records?page=1&perPage=1000&skipTotal=1&sort=name&expand=ports%2Cgroups userAgent:Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36 Edg/124.0.0.0 userIp:10.0.0.2] GET /api/collections/devices/records?page=1&perPage=1000&skipTotal=1&sort=name&expand=ports,groups 0} database disk image is malformed (11)
[DEBUG]2024/04/24 12:04:11 base.go:1250: Failed to write log &{{false sgvpoxxa0nof2w2 2024-04-24 12:04:06.347Z 2024-04-24 12:04:06.347Z} map[auth:admin execTime:2.853944 method:GET referer:http://192.168.1.50:8090/users/ remoteIp:10.0.0.2 status:200 type:request url:/api/collections/permissions/records?page=1&perPage=1000&skipTotal=1&expand=user userAgent:Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36 Edg/124.0.0.0 userIp:10.0.0.2] GET /api/collections/permissions/records?page=1&perPage=1000&skipTotal=1&expand=user 0} database disk image is malformed (11)
[DEBUG]2024/04/24 12:04:11 base.go:1250: Failed to write log &{{false jiq4zsz25guk2g4 2024-04-24 12:04:06.412Z 2024-04-24 12:04:06.412Z} map[auth:admin execTime:2.356548 method:GET referer:http://192.168.1.50:8090/users/ remoteIp:10.0.0.2 status:200 type:request url:/api/collections/permissions/records?page=1&perPage=1000&skipTotal=1&expand=user userAgent:Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36 Edg/124.0.0.0 userIp:10.0.0.2] GET /api/collections/permissions/records?page=1&perPage=1000&skipTotal=1&expand=user 0} database disk image is malformed (11)
[DEBUG]2024/04/24 12:04:11 base.go:1250: Failed to write log &{{false ffcomj2a9xiscxv 2024-04-24 12:04:07.639Z 2024-04-24 12:04:07.639Z} map[auth:admin execTime:2.414798 method:GET referer:http://192.168.1.50:8090/users/ remoteIp:10.0.0.2 status:200 type:request url:/api/collections/devices/records?page=1&perPage=1000&skipTotal=1&sort=name userAgent:Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36 Edg/124.0.0.0 userIp:10.0.0.2] GET /api/collections/devices/records?page=1&perPage=1000&skipTotal=1&sort=name 0} database disk image is malformed (11)
[DEBUG]2024/04/24 12:04:11 base.go:1250: Failed to write log &{{false gjss1hnbqkfop3l 2024-04-24 12:04:07.704Z 2024-04-24 12:04:07.704Z} map[auth:admin execTime:2.699252 method:GET referer:http://192.168.1.50:8090/users/ remoteIp:10.0.0.2 status:200 type:request url:/api/collections/devices/records?page=1&perPage=1000&skipTotal=1&sort=name userAgent:Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36 Edg/124.0.0.0 userIp:10.0.0.2] GET /api/collections/devices/records?page=1&perPage=1000&skipTotal=1&sort=name 0} database disk image is malformed (11)
[DEBUG]2024/04/24 12:04:11 base.go:1250: Failed to write log &{{false 5ti5hjj5q1h0f3b 2024-04-24 12:04:08.055Z 2024-04-24 12:04:08.055Z} map[auth:admin execTime:2.431291 method:GET referer:http://192.168.1.50:8090/settings/ remoteIp:10.0.0.2 status:200 type:request url:/api/collections/settings_private/records?page=1&perPage=1&filter=&skipTotal=1 userAgent:Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36 Edg/124.0.0.0 userIp:10.0.0.2] GET /api/collections/settings_private/records?page=1&perPage=1&filter=&skipTotal=1 0} database disk image is malformed (11)
[DEBUG]2024/04/24 12:04:11 base.go:1250: Failed to write log &{{false 3zf6gnip010o91u 2024-04-24 12:04:08.087Z 2024-04-24 12:04:08.087Z} map[auth:admin execTime:2.068196 method:GET referer:http://192.168.1.50:8090/settings/ remoteIp:10.0.0.2 status:200 type:request url:/api/collections/settings_private/records?page=1&perPage=1&filter=&skipTotal=1 userAgent:Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36 Edg/124.0.0.0 userIp:10.0.0.2] GET /api/collections/settings_private/records?page=1&perPage=1&filter=&skipTotal=1 0} database disk image is malformed (11)
[DEBUG]2024/04/24 12:04:21 base.go:1250: Failed to write log &{{false 200mk0mqca24rhi 2024-04-24 12:04:18.550Z 2024-04-24 12:04:18.550Z} map[auth:admin execTime:2.413939 method:GET referer:http://192.168.1.50:8090/ remoteIp:10.0.0.2 status:200 type:request url:/api/collections/devices/records?page=1&perPage=1000&skipTotal=1&sort=name&expand=ports%2Cgroups userAgent:Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36 Edg/124.0.0.0 userIp:10.0.0.2] GET /api/collections/devices/records?page=1&perPage=1000&skipTotal=1&sort=name&expand=ports,groups 0} database disk image is malformed (11)
[DEBUG]2024/04/24 12:04:21 base.go:1250: Failed to write log &{{false yw1vi67a84o8gvm 2024-04-24 12:04:18.587Z 2024-04-24 12:04:18.587Z} map[auth:admin execTime:2.033736 method:GET referer:http://192.168.1.50:8090/ remoteIp:10.0.0.2 status:200 type:request url:/api/collections/devices/records?page=1&perPage=1000&skipTotal=1&sort=name&expand=ports%2Cgroups userAgent:Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36 Edg/124.0.0.0 userIp:10.0.0.2] GET /api/collections/devices/records?page=1&perPage=1000&skipTotal=1&sort=name&expand=ports,groups 0} database disk image is malformed (11)
[DEBUG]2024/04/24 12:04:30 base.go:1250: Failed to write log &{{false c77jelz5kg4egnp 2024-04-24 12:04:25.590Z 2024-04-24 12:04:25.590Z} map[auth:admin execTime:3.344829 method:GET referer:http://192.168.1.50:8090/ remoteIp:10.0.0.2 status:200 type:request url:/api/collections/devices/records?page=1&perPage=1000&skipTotal=1&sort=name&expand=ports%2Cgroups userAgent:Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36 Edg/124.0.0.0 userIp:10.0.0.2] GET /api/collections/devices/records?page=1&perPage=1000&skipTotal=1&sort=name&expand=ports,groups 0} database disk image is malformed (11)
[DEBUG]2024/04/24 12:04:30 base.go:1250: Failed to write log &{{false 9prb8g6s7kvf7nf 2024-04-24 12:04:25.649Z 2024-04-24 12:04:25.649Z} map[auth:admin details:No client associated with connection ID "XLvF2juDrT7PsDSFQuvnWFN1KTEynXWBlFL60JtJ" error:Missing or invalid client id. execTime:0.062181 method:POST referer:http://192.168.1.50:8090/ remoteIp:10.0.0.2 status:404 type:request url:/api/realtime userAgent:Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36 Edg/124.0.0.0 userIp:10.0.0.2] POST /api/realtime 8} database disk image is malformed (11)
[DEBUG]2024/04/24 12:04:30 base.go:1250: Failed to write log &{{false hd0db4tw8lncxq9 2024-04-24 12:04:26.855Z 2024-04-24 12:04:26.855Z} map[auth:admin execTime:2.282327 method:GET referer:http://192.168.1.50:8090/ remoteIp:10.0.0.2 status:200 type:request url:/api/collections/settings_public/records?page=1&perPage=1&filter=&skipTotal=1 userAgent:Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36 Edg/124.0.0.0 userIp:10.0.0.2] GET /api/collections/settings_public/records?page=1&perPage=1&filter=&skipTotal=1 0} database disk image is malformed (11)
[DEBUG]2024/04/24 12:04:30 base.go:1250: Failed to write log &{{false 9038jrz7ciez10y 2024-04-24 12:04:26.891Z 2024-04-24 12:04:26.891Z} map[auth:admin execTime:0.056351 method:POST referer:http://192.168.1.50:8090/ remoteIp:10.0.0.2 status:200 type:request url:/api/admins/auth-refresh userAgent:Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36 Edg/124.0.0.0 userIp:10.0.0.2] POST /api/admins/auth-refresh 0} database disk image is malformed (11)
[DEBUG]2024/04/24 12:04:30 base.go:1250: Failed to write log &{{false kyv2zdtjcl11nqn 2024-04-24 12:04:27.805Z 2024-04-24 12:04:27.805Z} map[auth:admin execTime:2.146735 method:GET referer:http://192.168.1.50:8090/ remoteIp:10.0.0.2 status:200 type:request url:/api/collections/settings_public/records?page=1&perPage=1&filter=&skipTotal=1 userAgent:Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36 Edg/124.0.0.0 userIp:10.0.0.2] GET /api/collections/settings_public/records?page=1&perPage=1&filter=&skipTotal=1 0} database disk image is malformed (11)
[DEBUG]2024/04/24 12:04:30 base.go:1250: Failed to write log &{{false mufhw45pk1giett 2024-04-24 12:04:27.837Z 2024-04-24 12:04:27.837Z} map[auth:admin execTime:0.05953 method:POST referer:http://192.168.1.50:8090/ remoteIp:10.0.0.2 status:200 type:request url:/api/admins/auth-refresh userAgent:Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36 Edg/124.0.0.0 userIp:10.0.0.2] POST /api/admins/auth-refresh 0} database disk image is malformed (11)

@seriousm4x
Copy link
Owner

Got same problem on clean install... i have this docker container logs

Your logs don't really match the problem of the others. It seems more likely that the database files are not readable/writable. Perhaps there is a problem with the hard disk or file system on which the database is located.

Try saving the database to your internal system hard disk (if this is not already the case). Otherwise, please create a separate issue.

@Nonobis
Copy link

Nonobis commented Apr 25, 2024

the database is in my docker-swarm folder is replicated between 1 master et 3 client node with Gluster (all other dockers have no problems ..) accessible with the same user ... i will try to test in a folder not replicated with Gluster

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working can't reproduce An issue that's not reproducable
Projects
None yet
Development

No branches or pull requests

4 participants