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

unRAID Deployment #13

Open
olympia opened this issue Nov 23, 2024 · 44 comments
Open

unRAID Deployment #13

olympia opened this issue Nov 23, 2024 · 44 comments

Comments

@olympia
Copy link
Contributor

olympia commented Nov 23, 2024

Hi Charlie,

I installed and set this up on unRAID (without docker compose) a couple of days ago.
I don't have lots of data yet, but looking absolutely amazing. Thank you very much for creating this!

Would it be possible to have a selector at the top plates to chose from last 24 hours, last week, last month, last year or maybe custom dates?

...and I am wondering about vehicle description on the live feed: is this configurable somewhere, or is this a dead leftover from some initial plan? :)

Many thanks again!

@prsmith777
Copy link

olympia:
I have tried to set up on unRAID using docker compose and its not working correctly. Was wondering if you could give me a quick overview on setting up without compose. thanks

@olympia
Copy link
Contributor Author

olympia commented Nov 25, 2024

@prsmith777 the docker-compose.yml file provides the overview, but what you need to do:

  1. Create a postgres13 directory in your unRAID appdata, then create a data and a schema subdir in that
  2. Copy the schema.sql referenced in the readme somewhere to schema subdir
  3. Install postgres13 from unRAID Community Applications where you set the database storage path to the data subdir you created and create a new path where the container path is /docker-entrypoint-initdb.d/ and the host path is the schema subdir you created and have the schema.sql in it. Also set password to any. user and db to postgres.
  4. create an alpr_dashboard directory in your unRAID appdata, then create am auth subdir in that
  5. add a new container manually from docker tab by referencing algertc/alpr-dashboard:latest
  6. add the following paths to alpr-dashboard: docker:
    • container path: /app/auth | host path to your auth subdir
    • container path: /app/config | host path to the alpr_dashboard directory
  7. add the following variables:
    • key: NODE_ENV | value: production
    • key: ADMIN_PASSWORD | value: to your password
    • key: DB_PASSWORD | value: to your password
  8. add a tcp port: 3000
  9. that's it, you should be able to access the alpr database dasboard now
  10. set database settings accordingly in the settings,

@prsmith777
Copy link

prsmith777 commented Nov 25, 2024

@olympia

Awesome thank you. Got it going

EDIT:

Not connecting to database.... getting this error:

Database connection test failed: Error: getaddrinfo ENOTFOUND db
at (/app/node_modules/pg-pool/index.js:45:11)
at async l (/app/.next/server/chunks/79.js:1:979)
at async A (/app/.next/server/chunks/79.js:288:45)
at async d (/app/.next/server/app/api/plate-reads/route.js:1:1926)
at async te.do (/app/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:18:17826)
at async te.handle (/app/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:18:22492)
at async doRender (/app/node_modules/next/dist/server/base-server.js:1455:42)
at async responseGenerator (/app/node_modules/next/dist/server/base-server.js:1814:28)
at async NextNodeServer.renderToResponseWithComponentsImpl (/app/node_modules/next/dist/server/base-server.js:1824:28) {
errno: -3008,
code: 'ENOTFOUND',
syscall: 'getaddrinfo',
hostname: 'db'

@algertc
Copy link
Owner

algertc commented Nov 25, 2024

Would it be possible to have a selector at the top plates to chose from last 24 hours, last week, last month, last year or maybe custom dates?

...and I am wondering about vehicle description on the live feed: is this configurable somewhere, or is this a dead leftover from some initial plan? :)

I'll add some more configuration ability to the dashboard for things like date filtering.

The vehicle description is a bit of a leftover because the AI doesn't have a great way to do this currently, but I do plan to allow the user to manually enter these details. For now, you could just put it in the notes if you needed to. The other addition that I am prioritizing is the ability to correct plate recognitions in the live feed page. This will allow you to prevent your plate database from having 5 different variations of the same plate as a result of OCR misreads.

Thank you for sharing your Unraid instructions. I was going to make a docs directory to link to other more specific guides like this. If you would like credit, please make a pull request and put it in /docs/unraid.md.

I can also do it myself if you prefer.

@algertc
Copy link
Owner

algertc commented Nov 25, 2024

@olympia

Awesome thank you. Got it going

EDIT:

Not connecting to database.... getting this error:

Database connection test failed: Error: getaddrinfo ENOTFOUND db at (/app/node_modules/pg-pool/index.js:45:11) at async l (/app/.next/server/chunks/79.js:1:979) at async A (/app/.next/server/chunks/79.js:288:45) at async d (/app/.next/server/app/api/plate-reads/route.js:1:1926) at async te.do (/app/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:18:17826) at async te.handle (/app/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:18:22492) at async doRender (/app/node_modules/next/dist/server/base-server.js:1455:42) at async responseGenerator (/app/node_modules/next/dist/server/base-server.js:1814:28) at async NextNodeServer.renderToResponseWithComponentsImpl (/app/node_modules/next/dist/server/base-server.js:1824:28) { errno: -3008, code: 'ENOTFOUND', syscall: 'getaddrinfo', hostname: 'db'

There are a few things you can check here.

  • Since these containers are now separate and not in a stack together, you may need to set the db host as the IP address of your unraid machine + the port you exposed. The fact that it is saying hostname db not found leads me to believe that this is the cause. Using db only works if the containers are in the same docker network. So if your unraid machine is 1.2.3.4 and you exposed port 4000, you would want to set the database address as 1.2.3.4:4000 instead of db:4000.

  • Make sure the postgres container is running and hasn't exited. If unraid is already running a database on port 5432, you will need to use a different port.

  • In the app, go to the settings page and ensure that the database configuration is correct.

@olympia
Copy link
Contributor Author

olympia commented Nov 25, 2024

I'll add some more configuration ability to the dashboard for things like date filtering.
The vehicle description is a bit of a leftover because the AI doesn't have a great way to do this currently, but I do plan to allow the user to manually enter these details. For now, you could just put it in the notes if you needed to. The other addition that I am prioritizing is the ability to correct plate recognitions in the live feed page. This will allow you to prevent your plate database from having 5 different variations of the same plate as a result of OCR misreads.

Super, many thanks for all these!

Thank you for sharing your Unraid instructions. I was going to make a docs directory to link to other more specific guides like this. If you would like credit, please make a pull request and put it in /docs/unraid.md.

OK, but let's wait first if the instructions can get the first one go :)

@prsmith777 Did you follow the order of the instructions for postgres installation? If you started postgres docker without configuring the schema path first, then the alpr database hasn't got generated.

Also, how did you set the network for the dockers? Did you configure "bridge' networks or you set specific IP addresses for your dockers?

@prsmith777
Copy link

prsmith777 commented Nov 25, 2024

Thanks for both your help.

I added DBHOST: 192.168.0.250:3000 and still no luck

I did the configuration in order as stated.

I set network to bridge

There are no conflicts using port 5432

Here is postgres log:

2024-11-25 14:26:40.025 MST [1] LOG: listening on IPv4 address "0.0.0.0", port 5432
2024-11-25 14:26:40.025 MST [1] LOG: listening on IPv6 address "::", port 5432
2024-11-25 14:26:40.032 MST [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2024-11-25 14:26:40.040 MST [27] LOG: database system was shut down at 2024-11-25 14:26:36 MST
2024-11-25 14:26:40.048 MST [1] LOG: database system is ready to accept connections
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.

The database cluster will be initialized with locale "en_US.utf8".
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".

Data page checksums are disabled.

fixing permissions on existing directory /var/lib/postgresql/data ... ok
creating subdirectories ... ok
selecting dynamic shared memory implementation ... posix
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
selecting default time zone ... America/Denver
creating configuration files ... ok
running bootstrap script ... ok
performing post-bootstrap initialization ... ok
syncing data to disk ... ok

Success. You can now start the database server using:

pg_ctl -D /var/lib/postgresql/data -l logfile start

waiting for server to start....2024-11-25 14:07:36.418 MST [49] LOG: starting PostgreSQL 13.18 (Debian 13.18-1.pgdg120+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit
2024-11-25 14:07:36.422 MST [49] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2024-11-25 14:07:36.434 MST [50] LOG: database system was shut down at 2024-11-25 14:07:34 MST
2024-11-25 14:07:36.442 MST [49] LOG: database system is ready to accept connections
done
server started

/usr/local/bin/docker-entrypoint.sh: ignoring /docker-entrypoint-initdb.d/

2024-11-25 14:07:36.544 MST [49] LOG: received fast shutdown request
waiting for server to shut down....2024-11-25 14:07:36.547 MST [49] LOG: aborting any active transactions
2024-11-25 14:07:36.549 MST [49] LOG: background worker "logical replication launcher" (PID 56) exited with exit code 1
2024-11-25 14:07:36.549 MST [51] LOG: shutting down
2024-11-25 14:07:36.572 MST [49] LOG: database system is shut down
done
server stopped

PostgreSQL init process complete; ready for start up.

PostgreSQL Database directory appears to contain a database; Skipping initialization

PostgreSQL Database directory appears to contain a database; Skipping initialization

@olympia
Copy link
Contributor Author

olympia commented Nov 25, 2024

It's not possible to tell from the log if the alpr database has created successfully or not.

go to postgres docker console and type:

  1. psql -d postgres -U postgres -W
  2. enter password
  3. type: \dt

What do you get there?

@prsmith777
Copy link

prsmith777 commented Nov 25, 2024

psql -d postgres -U postgres -W

Password:
psql (13.18 (Debian 13.18-1.pgdg120+1))
Type "help" for help.

postgres=# \dt
Did not find any relations.
postgres=#

@olympia
Copy link
Contributor Author

olympia commented Nov 25, 2024

That's not OK. ALPR database is not there.

  1. Stop postgres docker
  2. delete everything from the data subdirectory of your postgres appdata directory.
  3. start the docker again
  4. try and post the result of the previous command in the console again.

@prsmith777
Copy link

followed those steps and getting same result:

postgres=# \dt
Did not find any relations.

@olympia
Copy link
Contributor Author

olympia commented Nov 25, 2024

Then probably something is not OK with your docker config, particularly the reference the the schema.sql.
Can you post a screenshot of the docker config?

@prsmith777
Copy link

docker

@algertc
Copy link
Owner

algertc commented Nov 25, 2024

3000 is not the right port. Notice that it says the database is listening on 5432. 3000 is for the app itself. You will want to set the database host to :5432 or if you exposed a different outside port for the database set it to that.

@prsmith777
Copy link

docker1
Changed the port.
Does this look right?

Still not working

@olympia
Copy link
Contributor Author

olympia commented Nov 25, 2024

3000 is not the right port. Notice that it says the database is listening on 5432. 3000 is for the app itself. You will want to set the database host to :5432 or if you exposed a different outside port for the database set it to that.

Yes, that's indeed incorrect too, but his database hasn't been generated correctly. First we would need to get that resolved.
This DBHOST variable is not even needed...

"Unfortunately" the docker config is correct, so I am not sure what the issue is.
I guess the schema.sql file has been correctly copied to the schema subdirectory, correct?

Can you delete the content of the data subdir again, then run the docker and then post the the docker logs?

@prsmith777
Copy link

Here is the log after deleting data subdir and starting docker back up:

2024-11-25 15:25:18.003 MST [1] LOG: starting PostgreSQL 13.18 (Debian 13.18-1.pgdg120+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit
2024-11-25 15:25:18.003 MST [1] LOG: listening on IPv4 address "0.0.0.0", port 5432
2024-11-25 15:25:18.003 MST [1] LOG: listening on IPv6 address "::", port 5432
2024-11-25 15:25:18.033 MST [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2024-11-25 15:25:18.054 MST [61] LOG: database system was shut down at 2024-11-25 15:25:17 MST
2024-11-25 15:25:18.068 MST [1] LOG: database system is ready to accept connections
2024-11-25 15:40:34.370 MST [1] LOG: received fast shutdown request
2024-11-25 15:40:34.372 MST [1] LOG: aborting any active transactions
2024-11-25 15:40:34.372 MST [75] FATAL: terminating connection due to administrator command
2024-11-25 15:40:34.374 MST [1] LOG: background worker "logical replication launcher" (PID 67) exited with exit code 1
2024-11-25 15:40:34.375 MST [62] LOG: shutting down
2024-11-25 15:40:34.396 MST [1] LOG: database system is shut down
2024-11-25 15:40:34.884 MST [1] LOG: starting PostgreSQL 13.18 (Debian 13.18-1.pgdg120+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit
2024-11-25 15:40:34.884 MST [1] LOG: listening on IPv4 address "0.0.0.0", port 5432
2024-11-25 15:40:34.884 MST [1] LOG: listening on IPv6 address "::", port 5432
2024-11-25 15:40:34.890 MST [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2024-11-25 15:40:34.900 MST [27] LOG: database system was shut down at 2024-11-25 15:40:34 MST
2024-11-25 15:40:34.908 MST [1] LOG: database system is ready to accept connections
2024-11-25 15:48:03.900 MST [1] LOG: received fast shutdown request
2024-11-25 15:48:03.902 MST [1] LOG: aborting any active transactions
2024-11-25 15:48:03.904 MST [1] LOG: background worker "logical replication launcher" (PID 33) exited with exit code 1
2024-11-25 15:48:03.904 MST [28] LOG: shutting down
2024-11-25 15:48:03.924 MST [1] LOG: database system is shut down
initdb: warning: enabling "trust" authentication for local connections
You can change this by editing pg_hba.conf or using the option -A, or
--auth-local and --auth-host, the next time you run initdb.
2024-11-25 15:48:29.031 MST [1] LOG: starting PostgreSQL 13.18 (Debian 13.18-1.pgdg120+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit
2024-11-25 15:48:29.031 MST [1] LOG: listening on IPv4 address "0.0.0.0", port 5432
2024-11-25 15:48:29.031 MST [1] LOG: listening on IPv6 address "::", port 5432
2024-11-25 15:48:29.037 MST [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2024-11-25 15:48:29.047 MST [61] LOG: database system was shut down at 2024-11-25 15:48:28 MST
2024-11-25 15:48:29.054 MST [1] LOG: database system is ready to accept connections

2024-11-25 15:25:17.851 MST [48] LOG: received fast shutdown request
waiting for server to shut down....2024-11-25 15:25:17.863 MST [48] LOG: aborting any active transactions
2024-11-25 15:25:17.864 MST [48] LOG: background worker "logical replication launcher" (PID 55) exited with exit code 1
2024-11-25 15:25:17.865 MST [50] LOG: shutting down
2024-11-25 15:25:17.899 MST [48] LOG: database system is shut down
done
server stopped

PostgreSQL init process complete; ready for start up.

PostgreSQL Database directory appears to contain a database; Skipping initialization

The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.

The database cluster will be initialized with locale "en_US.utf8".
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".

Data page checksums are disabled.

fixing permissions on existing directory /var/lib/postgresql/data ... ok
creating subdirectories ... ok
selecting dynamic shared memory implementation ... posix
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
selecting default time zone ... America/Denver
creating configuration files ... ok
running bootstrap script ... ok
performing post-bootstrap initialization ... ok
syncing data to disk ... ok

Success. You can now start the database server using:

pg_ctl -D /var/lib/postgresql/data -l logfile start

waiting for server to start....2024-11-25 15:48:28.786 MST [48] LOG: starting PostgreSQL 13.18 (Debian 13.18-1.pgdg120+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit
2024-11-25 15:48:28.791 MST [48] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2024-11-25 15:48:28.801 MST [49] LOG: database system was shut down at 2024-11-25 15:48:26 MST
2024-11-25 15:48:28.809 MST [48] LOG: database system is ready to accept connections
done
server started

/usr/local/bin/docker-entrypoint.sh: ignoring /docker-entrypoint-initdb.d/

waiting for server to shut down...2024-11-25 15:48:28.909 MST [48] LOG: received fast shutdown request
.2024-11-25 15:48:28.912 MST [48] LOG: aborting any active transactions
2024-11-25 15:48:28.913 MST [48] LOG: background worker "logical replication launcher" (PID 55) exited with exit code 1
2024-11-25 15:48:28.914 MST [50] LOG: shutting down
2024-11-25 15:48:28.944 MST [48] LOG: database system is shut down
done
server stopped

PostgreSQL init process complete; ready for start up.

@prsmith777
Copy link

This line in the log doesn't seem right:

/usr/local/bin/docker-entrypoint.sh: ignoring /docker-entrypoint-initdb.d/

@olympia
Copy link
Contributor Author

olympia commented Nov 25, 2024

The log file indicates the presence of an existing database with the message:
"PostgreSQL Database directory appears to contain a database; Skipping initialization."

I don't see how this can be if there is nothing in the data directory.

@prsmith777
Copy link

perhaps the issue because I first tried setting things up using docker compose manager. maybe that original database is still in there confusing things.

Is there a way to manually delete all databases and try again?

@olympia
Copy link
Contributor Author

olympia commented Nov 25, 2024

By deleting the data dir, everything should be purged. shrug

@prsmith777
Copy link

directory global and gb_wal aren't deleting. I thought they were

Trying krusader to delete

@prsmith777
Copy link

still same result

\dt
no relations

@olympia
Copy link
Contributor Author

olympia commented Nov 25, 2024

how you delete the data dir? Using SMB or terminal?

@prsmith777
Copy link

Deleting using Unraid file manager

@prsmith777
Copy link

This line in the log says:

/usr/local/bin/docker-entrypoint.sh: ignoring /docker-entrypoint-initdb.d/

It is ignoring this entrypoint so maybe it cant get to the schema.sql file.

@olympia
Copy link
Contributor Author

olympia commented Nov 25, 2024

It is ignoring this entrypoint so maybe it cant get to the schema.sql file.

The log suggests that it is ignoring initialization, because it finds and existing database.

I am running out of ideas...

Can you delete the data folder once again (make sure the docker is stopped first).
Then open a terminal and type:
ls -la /mnt/user/appdata/postgres13

share what you see there.

and then ls -la /mnt/user/appdata/postgres13/schema

share what you see there.

@prsmith777
Copy link

prsmith777 commented Nov 25, 2024

root@Storinator1:# ls -la /mnt/user/appdata/postgres13
total 12
drwxrwxrwx 1 nobody users 4 Nov 25 16:15 ./
drwxrwxrwx 1 nobody users 20 Nov 25 14:08 ../
drwx------ 1 999 users 2 Nov 25 16:35 data/
drwxr-xr-x 1 root root 2 Nov 25 16:15 schema/
root@Storinator1:# ls -la /mnt/user/appdata/postgres13/schema
total 2
drwxr-xr-x 1 root root 2 Nov 25 16:15 ./
drwxrwxrwx 1 nobody users 4 Nov 25 16:15 ../
root@Storinator1:#

@olympia
Copy link
Contributor Author

olympia commented Nov 25, 2024

so where is the schema.sql? :)

@prsmith777
Copy link

well it was there. I re added it

@prsmith777
Copy link

root@Storinator1:~ # ls -la /mnt/user/appdata/postgres13
total 12
drwxrwxrwx 1 nobody users 4 Nov 25 16:15 ./
drwxrwxrwx 1 nobody users 20 Nov 25 14:08 ../
drwx------ 1 999 users 2 Nov 25 16:44 data/
drwxr-xr-x 1 root root 3 Nov 25 16:40 schema/
root@Storinator1:~ # ls -la /mnt/user/appdata/postgres13/schema
total 15
drwxr-xr-x 1 root root 3 Nov 25 16:40 ./
drwxrwxrwx 1 nobody users 4 Nov 25 16:15 ../
-rw-rw-rw- 1 nobody users 9070 Nov 25 16:40 schema.sql
root@Storinator1:~ #

@olympia
Copy link
Contributor Author

olympia commented Nov 25, 2024

OK, cool, let's delete the entire data folder, so the folder as well, then start the docker

@prsmith777
Copy link

psql -d postgres -U postgres -W
Password:
psql (13.18 (Debian 13.18-1.pgdg120+1))
Type "help" for help.

postgres=# \dt
Did not find any relations.
postgres=#

@olympia
Copy link
Contributor Author

olympia commented Nov 25, 2024

and the docker logs?

@prsmith777
Copy link

--auth-local and --auth-host, the next time you run initdb.
2024-11-25 16:41:38.806 MST [1] LOG: starting PostgreSQL 13.18 (Debian 13.18-1.pgdg120+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit
2024-11-25 16:41:38.806 MST [1] LOG: listening on IPv4 address "0.0.0.0", port 5432
2024-11-25 16:41:38.806 MST [1] LOG: listening on IPv6 address "::", port 5432
2024-11-25 16:41:38.812 MST [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2024-11-25 16:41:38.822 MST [61] LOG: database system was shut down at 2024-11-25 16:41:38 MST
2024-11-25 16:41:38.830 MST [1] LOG: database system is ready to accept connections
2024-11-25 16:43:54.361 MST [1] LOG: received fast shutdown request
2024-11-25 16:43:54.369 MST [1] LOG: aborting any active transactions
2024-11-25 16:43:54.369 MST [82] FATAL: terminating connection due to administrator command
2024-11-25 16:43:54.371 MST [1] LOG: background worker "logical replication launcher" (PID 67) exited with exit code 1
2024-11-25 16:43:54.372 MST [62] LOG: shutting down
2024-11-25 16:43:54.465 MST [1] LOG: database system is shut down
initdb: warning: enabling "trust" authentication for local connections
You can change this by editing pg_hba.conf or using the option -A, or
--auth-local and --auth-host, the next time you run initdb.
2024-11-25 16:46:47.368 MST [1] LOG: starting PostgreSQL 13.18 (Debian 13.18-1.pgdg120+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit
2024-11-25 16:46:47.368 MST [1] LOG: listening on IPv4 address "0.0.0.0", port 5432
2024-11-25 16:46:47.368 MST [1] LOG: listening on IPv6 address "::", port 5432
2024-11-25 16:46:47.402 MST [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2024-11-25 16:46:47.424 MST [62] LOG: database system was shut down at 2024-11-25 16:46:47 MST
2024-11-25 16:46:47.441 MST [1] LOG: database system is ready to accept connections

Success. You can now start the database server using:

pg_ctl -D /var/lib/postgresql/data -l logfile start

waiting for server to start....2024-11-25 16:41:38.554 MST [48] LOG: starting PostgreSQL 13.18 (Debian 13.18-1.pgdg120+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit
2024-11-25 16:41:38.558 MST [48] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2024-11-25 16:41:38.569 MST [49] LOG: database system was shut down at 2024-11-25 16:41:36 MST
2024-11-25 16:41:38.577 MST [48] LOG: database system is ready to accept connections
done
server started

/usr/local/bin/docker-entrypoint.sh: ignoring /docker-entrypoint-initdb.d/

2024-11-25 16:41:38.678 MST [48] LOG: received fast shutdown request
waiting for server to shut down....2024-11-25 16:41:38.681 MST [48] LOG: aborting any active transactions
2024-11-25 16:41:38.682 MST [48] LOG: background worker "logical replication launcher" (PID 55) exited with exit code 1
2024-11-25 16:41:38.683 MST [50] LOG: shutting down
2024-11-25 16:41:38.707 MST [48] LOG: database system is shut down
done
server stopped

PostgreSQL init process complete; ready for start up.

The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.

The database cluster will be initialized with locale "en_US.utf8".
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".

Data page checksums are disabled.

fixing permissions on existing directory /var/lib/postgresql/data ... ok
creating subdirectories ... ok
selecting dynamic shared memory implementation ... posix
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
selecting default time zone ... America/Denver
creating configuration files ... ok
running bootstrap script ... ok
performing post-bootstrap initialization ... ok
syncing data to disk ... ok

Success. You can now start the database server using:

pg_ctl -D /var/lib/postgresql/data -l logfile start

waiting for server to start....2024-11-25 16:46:47.003 MST [49] LOG: starting PostgreSQL 13.18 (Debian 13.18-1.pgdg120+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit
2024-11-25 16:46:47.026 MST [49] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2024-11-25 16:46:47.064 MST [50] LOG: database system was shut down at 2024-11-25 16:46:44 MST
2024-11-25 16:46:47.078 MST [49] LOG: database system is ready to accept connections
done
server started

/usr/local/bin/docker-entrypoint.sh: ignoring /docker-entrypoint-initdb.d/

2024-11-25 16:46:47.208 MST [49] LOG: received fast shutdown request
waiting for server to shut down...2024-11-25 16:46:47.225 MST [49] LOG: aborting any active transactions
.2024-11-25 16:46:47.227 MST [49] LOG: background worker "logical replication launcher" (PID 56) exited with exit code 1
2024-11-25 16:46:47.227 MST [51] LOG: shutting down
2024-11-25 16:46:47.318 MST [49] LOG: database system is shut down
done
server stopped

PostgreSQL init process complete; ready for start up.

@olympia
Copy link
Contributor Author

olympia commented Nov 26, 2024

IT looks like now it doesn't find an existing db, yet ignoring the entrypoint:
/usr/local/bin/docker-entrypoint.sh: ignoring /docker-entrypoint-initdb.d/

No ideas, and it's 1am past here.
I will try to recrate another postrgres docker tomorrow and see what happens.

@algertc
Copy link
Owner

algertc commented Nov 26, 2024

Interestingly, the whole db already exists ignoring entrypoint thing does usually show up and things still work in most cases.

Also, if the database exists and has a schema created, whether or not it is actually correct, that means that the connection issue probably isn't because of that.

I'd double check that your schema.sql isn't empty and was correctly obtained.

These shutdowns in the logs are you right? The container isn't exiting?

The only other thing I could think of that might cause this is the config directory not working correctly on unraid. While it shouldn't be necessary normally to manually set an environment variable for the db host since you can change it in the settings, maybe try it. Note that the variable is actually called DB_HOST, not DBHOST.

I would try to deploy the postgres container and see if you can connect to it on its own with something like pgadmin. This will help isolate the issue.

@prsmith777
Copy link

@algertc
@olympia

Guys, thank you both for your help yesterday. I appreciate the effort and I have learned a lot. It seems getting this working with my UnRaid is a lost cause.... but then I had a thought....

I decided to try a different approach.. I spun up a Linux VM in UnRaid and set up docker. Then I set up ALPR and it is working.

One thing I noticed is that the postgres container wasn't starting on reboot of Linux VM, so I added
restart: unless-stopped
to the compose file for db

Not sure if this is the proper approach, but it seems to work.

@olympia
Copy link
Contributor Author

olympia commented Nov 26, 2024

@prsmith777

Glad you had it working. Running a VM is a perfectly proper approach; it just seems an unnecessary burden on the server.

I really don't know why it is not working for your.
I just added a new postgres container. I actually only created the scheme folder before deploying the docker and it worked instantly:

2024-11-26 21:27:56.160 CET [1] LOG:  starting PostgreSQL 13.18 (Debian 13.18-1.pgdg120+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit
2024-11-26 21:27:56.160 CET [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
2024-11-26 21:27:56.160 CET [1] LOG:  listening on IPv6 address "::", port 5432
2024-11-26 21:27:56.175 CET [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2024-11-26 21:27:56.189 CET [64] LOG:  database system was shut down at 2024-11-26 21:27:56 CET
2024-11-26 21:27:56.198 CET [1] LOG:  database system is ready to accept connections

waiting for server to start....2024-11-26 21:27:55.544 CET [49] LOG:  starting PostgreSQL 13.18 (Debian 13.18-1.pgdg120+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit
2024-11-26 21:27:55.556 CET [49] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2024-11-26 21:27:55.574 CET [50] LOG:  database system was shut down at 2024-11-26 21:27:54 CET
2024-11-26 21:27:55.583 CET [49] LOG:  database system is ready to accept connections
 done
server started

/usr/local/bin/docker-entrypoint.sh: running /docker-entrypoint-initdb.d/schema.sql
SET
SET
SET
SET
SET
 set_config 
------------
 
(1 row)

SET
SET
SET
SET
CREATE EXTENSION
COMMENT
CREATE EXTENSION
COMMENT
CREATE FUNCTION
ALTER FUNCTION
SET
SET
CREATE TABLE
ALTER TABLE
CREATE TABLE
ALTER TABLE
CREATE SEQUENCE
ALTER TABLE
ALTER SEQUENCE
CREATE TABLE
ALTER TABLE
CREATE SEQUENCE
ALTER TABLE
ALTER SEQUENCE
CREATE TABLE
ALTER TABLE
CREATE TABLE
ALTER TABLE
CREATE TABLE
ALTER TABLE
CREATE SEQUENCE
ALTER TABLE
ALTER SEQUENCE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
ALTER TABLE


waiting for server to shut down....2024-11-26 21:27:55.934 CET [49] LOG:  received fast shutdown request
2024-11-26 21:27:55.940 CET [49] LOG:  aborting any active transactions
2024-11-26 21:27:55.941 CET [49] LOG:  background worker "logical replication launcher" (PID 56) exited with exit code 1
2024-11-26 21:27:55.941 CET [51] LOG:  shutting down
2024-11-26 21:27:56.082 CET [49] LOG:  database system is shut down
 done
server stopped

PostgreSQL init process complete; ready for start up.

@algertc algertc changed the title THANK YOU and a feature request unRAID Deployment Dec 4, 2024
@kimocal
Copy link

kimocal commented Feb 19, 2025

@prsmith777

Glad you had it working. Running a VM is a perfectly proper approach; it just seems an unnecessary burden on the server.

I really don't know why it is not working for your. I just added a new postgres container. I actually only created the scheme folder before deploying the docker and it worked instantly:

Hi @olympia ,

I followed all your steps above with running postgresql13 as a separate container then running alpr-dashboard via ADD CONTAINER in unraid. It's kind of working though getting some errors. Here are all the logs I have.

Postgresql13 logs after wiping out data and restarting container:


2025-02-19 13:15:57.916 PST [1] LOG:  received fast shutdown request
2025-02-19 13:15:57.926 PST [1] LOG:  aborting any active transactions
2025-02-19 13:15:57.926 PST [88] FATAL:  terminating connection due to administrator command
2025-02-19 13:15:57.928 PST [1] LOG:  background worker "logical replication launcher" (PID 70) exited with exit code 1
2025-02-19 13:15:57.929 PST [65] LOG:  shutting down
2025-02-19 13:15:57.992 PST [1] LOG:  database system is shut down
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.

The database cluster will be initialized with locale "en_US.utf8".
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".

Data page checksums are disabled.

fixing permissions on existing directory /var/lib/postgresql/data ... ok
creating subdirectories ... ok
selecting dynamic shared memory implementation ... posix
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
selecting default time zone ... America/Los_Angeles
creating configuration files ... ok
running bootstrap script ... ok
performing post-bootstrap initialization ... ok
initdb: warning: enabling "trust" authentication for local connections
You can change this by editing pg_hba.conf or using the option -A, or
--auth-local and --auth-host, the next time you run initdb.
syncing data to disk ... ok


Success. You can now start the database server using:

    pg_ctl -D /var/lib/postgresql/data -l logfile start

waiting for server to start....2025-02-19 13:17:23.162 PST [48] LOG:  starting PostgreSQL 13.19 (Debian 13.19-1.pgdg120+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit
2025-02-19 13:17:23.180 PST [48] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2025-02-19 13:17:23.200 PST [49] LOG:  database system was shut down at 2025-02-19 13:17:15 PST
2025-02-19 13:17:23.213 PST [48] LOG:  database system is ready to accept connections
 done
server started

/usr/local/bin/docker-entrypoint.sh: running /docker-entrypoint-initdb.d/schema.sql
SET
SET
SET
SET
SET
 set_config 
------------
 
(1 row)

SET
SET
SET
SET
CREATE EXTENSION
COMMENT
CREATE EXTENSION
COMMENT
CREATE FUNCTION
ALTER FUNCTION
SET
SET
CREATE TABLE
ALTER TABLE
CREATE TABLE
ALTER TABLE
CREATE SEQUENCE
ALTER TABLE
ALTER SEQUENCE
CREATE TABLE
ALTER TABLE
CREATE SEQUENCE
ALTER TABLE
ALTER SEQUENCE
CREATE TABLE
ALTER TABLE
CREATE TABLE
ALTER TABLE
CREATE FUNCTION
ALTER FUNCTION
CREATE TRIGGER
CREATE INDEX
CREATE TABLE
ALTER TABLE
CREATE SEQUENCE
ALTER TABLE
ALTER SEQUENCE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
ALTER TABLE


waiting for server to shut down...2025-02-19 13:17:23.936 PST [48] LOG:  received fast shutdown request
.2025-02-19 13:17:23.943 PST [48] LOG:  aborting any active transactions
2025-02-19 13:17:23.945 PST [48] LOG:  background worker "logical replication launcher" (PID 55) exited with exit code 1
2025-02-19 13:17:23.945 PST [50] LOG:  shutting down
2025-02-19 13:17:24.600 PST [48] LOG:  database system is shut down
 done
server stopped

PostgreSQL init process complete; ready for start up.

2025-02-19 13:17:24.677 PST [1] LOG:  starting PostgreSQL 13.19 (Debian 13.19-1.pgdg120+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit
2025-02-19 13:17:24.677 PST [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
2025-02-19 13:17:24.677 PST [1] LOG:  listening on IPv6 address "::", port 5432
2025-02-19 13:17:24.698 PST [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2025-02-19 13:17:24.713 PST [63] LOG:  database system was shut down at 2025-02-19 13:17:24 PST
2025-02-19 13:17:24.725 PST [1] LOG:  database system is ready to accept connections
2025-02-19 13:20:42.379 PST [73] ERROR:  relation "devmgmt" does not exist at character 21
2025-02-19 13:20:42.379 PST [73] STATEMENT:  SELECT update1 FROM devmgmt WHERE id = 1
2025-02-19 13:20:42.811 PST [73] ERROR:  relation "devmgmt" does not exist at character 21
2025-02-19 13:20:42.811 PST [73] STATEMENT:  SELECT update1 FROM devmgmt WHERE id = 1
2025-02-19 13:20:42.912 PST [73] ERROR:  relation "devmgmt" does not exist at character 21
2025-02-19 13:20:42.912 PST [73] STATEMENT:  SELECT update1 FROM devmgmt WHERE id = 1
2025-02-19 13:20:43.056 PST [73] ERROR:  relation "devmgmt" does not exist at character 21
2025-02-19 13:20:43.056 PST [73] STATEMENT:  SELECT update1 FROM devmgmt WHERE id = 1
2025-02-19 13:20:45.263 PST [73] ERROR:  relation "devmgmt" does not exist at character 21
2025-02-19 13:20:45.263 PST [73] STATEMENT:  SELECT update1 FROM devmgmt WHERE id = 1

postgresql13 console comands

# psql -d postgres -U postgres -W
Password: 
psql (13.19 (Debian 13.19-1.pgdg120+1))
Type "help" for help.

postgres=# \dt
                List of relations
 Schema |        Name         | Type  |  Owner   
--------+---------------------+-------+----------
 public | known_plates        | table | postgres
 public | plate_notifications | table | postgres
 public | plate_reads         | table | postgres
 public | plate_tags          | table | postgres
 public | plates              | table | postgres
 public | tags                | table | postgres
(6 rows)

postgres=# 

alpr-dashboard logs

Error checking update status: error: relation "devmgmt" does not exist
    at <unknown> (/app/node_modules/pg/lib/client.js:535:17)
    at async (/app/.next/server/chunks/8079.js:431:188)
    at async l (/app/.next/server/chunks/8079.js:1:1464)
    at async n (/app/.next/server/app/api/check-update/route.js:1:892)
    at async te.do (/app/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:18:17826)
    at async te.handle (/app/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:18:22492)
    at async doRender (/app/node_modules/next/dist/server/base-server.js:1455:42)
    at async responseGenerator (/app/node_modules/next/dist/server/base-server.js:1814:28)
    at async NextNodeServer.renderToResponseWithComponentsImpl (/app/node_modules/next/dist/server/base-server.js:1824:28) {
  length: 106,
  severity: 'ERROR',
  code: '42P01',
  detail: undefined,
  hint: undefined,
  position: '21',
  internalPosition: undefined,
  internalQuery: undefined,
  where: undefined,
  schema: undefined,
  table: undefined,
  column: undefined,
  dataType: undefined,
  constraint: undefined,
  file: 'parse_relation.c',
  line: '1373',
  routine: 'parserOpenTable'
}
Error checking update status: error: relation "devmgmt" does not exist
    at <unknown> (/app/node_modules/pg/lib/client.js:535:17)
    at async (/app/.next/server/chunks/8079.js:431:188)
    at async l (/app/.next/server/chunks/8079.js:1:1464)
    at async n (/app/.next/server/app/api/check-update/route.js:1:892)
    at async te.do (/app/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:18:17826)
    at async te.handle (/app/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:18:22492)
    at async doRender (/app/node_modules/next/dist/server/base-server.js:1455:42)
    at async responseGenerator (/app/node_modules/next/dist/server/base-server.js:1814:28)
    at async NextNodeServer.renderToResponseWithComponentsImpl (/app/node_modules/next/dist/server/base-server.js:1824:28) {
  length: 106,
  severity: 'ERROR',
  code: '42P01',
  detail: undefined,
  hint: undefined,
  position: '21',
  internalPosition: undefined,
  internalQuery: undefined,
  where: undefined,
  schema: undefined,
  table: undefined,
  column: undefined,
  dataType: undefined,
  constraint: undefined,
  file: 'parse_relation.c',
  line: '1373',
  routine: 'parserOpenTable'
}
Error checking update status: error: relation "devmgmt" does not exist
    at <unknown> (/app/node_modules/pg/lib/client.js:535:17)
    at async (/app/.next/server/chunks/8079.js:431:188)
    at async l (/app/.next/server/chunks/8079.js:1:1464)
    at async n (/app/.next/server/app/api/check-update/route.js:1:892)
    at async te.do (/app/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:18:17826)
    at async te.handle (/app/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:18:22492)
    at async doRender (/app/node_modules/next/dist/server/base-server.js:1455:42)
    at async responseGenerator (/app/node_modules/next/dist/server/base-server.js:1814:28)
    at async NextNodeServer.renderToResponseWithComponentsImpl (/app/node_modules/next/dist/server/base-server.js:1824:28) {
  length: 106,
  severity: 'ERROR',
  code: '42P01',
  detail: undefined,
  hint: undefined,
  position: '21',
  internalPosition: undefined,
  internalQuery: undefined,
  where: undefined,
  schema: undefined,
  table: undefined,
  column: undefined,
  dataType: undefined,
  constraint: undefined,
  file: 'parse_relation.c',
  line: '1373',
  routine: 'parserOpenTable'
}
GET /live_feed?page=1&hourFrom=08&hourTo=08
POST /api/verify-session
GET /api/check-update
GET /settings
POST /api/verify-session
GET /api/check-update

After I "Trigger now" on the LPR camera there is some action in the alpr logs:

PzDqO1SFFaTzQ2d3Y9frSTwBkZN/y5wSO3vUZswEXD5wR9OKAPMkcu7BkVieCw7EdyaldIF3SzO8hzgxr2HoWqpExUsmfv8AXB/TFWJnh2JDHuAJxkdx649c1ztO53kl5cNPMoVfuAKqEZAPfFQlDgvkfLgjbwVI/wAKtuu22DhVBILYIw35+9UUEm5WKkls7QOc+9JbB1JbYrHullPC/Koz834UNEfKWXb5auxw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SKrmInouOF67vc1nKSWtyucbCrGMlivPAzxmljT5sE/UA9aFUKpA2rgDp607adxYEnjHJxilzBzGRrKqGRiFI6HI6Go7K4QW6EqCcH7varurQFraMhVyWznGcCqmkxeZAQE5Vm4BxWsmuRNGTl7xeQytFIoVhnhVIBVh35qtJM6xF1wo3bGynzAf1rWtYvKZ1CsTyfl9PT61VvLaKLeiDLBdy4P3fx9azUncbmnsJaqu1cOxYk/NtwzewHatL5UKjLKFXklc4J6CsWOYi1jjHzPjlmfBJ7jNWVmyqYLMApAy2Tn1+lRMhs0GKsfTHemuoZcBuR096pByfkLEYFNM0/m4HT1qbiuWwdrowHbFWCwMbAEMMZxVCR2A3HkjpUnmhVXPJI7VSGmXFXeAh5UjPPY08gbsYc46YHBqit2EXhGPcEmport3I3uUXBAxVWW5Y6dcKrg7WVunejAZWcEbuhWkkAMR3Plge/Q1VkujGrsELnHA6YosBbVV2jKgnryOMUpMSzKfMAK/NtHGB6VBBcNJGhIAyBkVPKqDY42kqf8/WgdhjqkkbLu3FiWBP+FKy5KKUAUruLVNCqO2GwWDcEen1pSHctkqAoKjNHKFiuspWQjGR0A9anKjAIG0g/XFV5GCyouck9fYVOFCl2YFlH'... 407884 more characters,
  camera: 'lpr',
  ALERT_PATH: 'lpr.20250219_130000.3273772.3-1.jpg',
  ALERT_CLIP: '@371175905733468',
  timestamp: '2025-02-19T21:55:02.056Z'
}
Database connection established
[FileStorage] Successfully saved image
Error processing request: error: column "bi_path" of relation "plate_reads" does not exist
    at <unknown> (/app/node_modules/pg/lib/client.js:535:17)
    at async p (/app/.next/server/app/api/plate-reads/route.js:1:4464)
    at async te.do (/app/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:18:17826)
    at async te.handle (/app/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:18:22492)
    at async doRender (/app/node_modules/next/dist/server/base-server.js:1455:42)
    at async responseGenerator (/app/node_modules/next/dist/server/base-server.js:1814:28)
    at async NextNodeServer.renderToResponseWithComponentsImpl (/app/node_modules/next/dist/server/base-server.js:1824:28)
    at async NextNodeServer.renderPageComponent (/app/node_modules/next/dist/server/base-server.js:2240:24)
    at async NextNodeServer.renderToResponseImpl (/app/node_modules/next/dist/server/base-server.js:2278:32) {
  length: 132,
  severity: 'ERROR',
  code: '42703',
  detail: undefined,
  hint: undefined,
  position: '370',
  internalPosition: undefined,
  internalQuery: undefined,
  where: undefined,
  schema: undefined,
  table: undefined,
  column: undefined,
  dataType: undefined,
  constraint: undefined,
  file: 'parse_target.c',
  line: '1047',
  routine: 'checkInsertTargets'
}
POST /api/plate-reads
Received plate read data: {
  plate_number: '9RCM793',
  Image: '/9j/4AAQSkZJRgABAQEAYABgAAD/4QDwRXhpZgAATU0AKgAAAAgAAwEOAAIAAAAMAAAAMgExAAIAAAAKAAAAPodpAAQAAAABAAAASAAAAAA5UkNNNzkzOjk0JQBCbHVlIElyaXMAAAOQAwACAAAAFAAAAHKShgAHAAAAYgAAAIaSkQACAAAAAzU2AAAAAAAAMjAyNTowMjoxOSAxMzo1NTowMgAxAC4AMwAyADcAMwA3ADcAMgAuADYAMQA0ADcALQAxAC4AOQBSAEMATQA3ADkAMwAuADUAMAA5ADEALgA3ADIAMgAzAC4AMQA3ADQAMAAwADAAMgAxADAAMgAwADUANgAAAP/bAEMACAYGBwYFCAcHBwkJCAoMFA0MCwsMGRITDxQdGh8eHRocHCAkLicgIiwjHBwoNyksMDE0NDQfJzk9ODI8LjM0Mv/bAEMBCQkJDAsMGA0NGDIhHCEyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMv/AABEIBDgHgAMBIgACEQEDEQH/xAAfAAABBQEBAQEBAQAAAAAAAAAAAQIDBAUGBwgJCgv/xAC1EAACAQMDAgQDBQUEBAAAAX0BAgMABBEFEiExQQYTUWEHInEUMoGRoQgjQrHBFVLR8CQzYnKCCQoWFxgZGiUmJygpKjQ1Njc4OTpDREVGR0hJSlNUVVZX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E/UA9aFUKpA2rgDp607adxYEnjHJxilzBzGRrKqGRiFI6HI6Go7K4QW6EqCcH7varurQFraMhVyWznGcCqmkxeZAQE5Vm4BxWsmuRNGTl7xeQytFIoVhnhVIBVh35qtJM6xF1wo3bGynzAf1rWtYvKZ1CsTyfl9PT61VvLaKLeiDLBdy4P3fx9azUncbmnsJaqu1cOxYk/NtwzewHatL5UKjLKFXklc4J6CsWOYi1jjHzPjlmfBJ7jNWVmyqYLMApAy2Tn1+lRMhs0GKsfTHemuoZcBuR096pByfkLEYFNM0/m4HT1qbiuWwdrowHbFWCwMbAEMMZxVCR2A3HkjpUnmhVXPJI7VSGmXFXeAh5UjPPY08gbsYc46YHBqit2EXhGPcEmport3I3uUXBAxVWW5Y6dcKrg7WVunejAZWcEbuhWkkAMR3Plge/Q1VkujGrsELnHA6YosBbVV2jKgnryOMUpMSzKfMAK/NtHGB6VBBcNJGhIAyBkVPKqDY42kqf8/WgdhjqkkbLu3FiWBP+FKy5KKUAUruLVNCqO2GwWDcEen1pSHctkqAoKjNHKFiuspWQjGR0A9anKjAIG0g/XFV5GCyouck9fYVOFCl2YFlH'... 407884 more characters,
  camera: 'lpr',
  ALERT_PATH: 'lpr.20250219_130000.3273772.3-1.jpg',
  ALERT_CLIP: '@371175905733468',
  timestamp: '2025-02-19T21:55:02.056Z'
}
Database connection established
[FileStorage] Successfully saved image
Error processing request: error: column "bi_path" of relation "plate_reads" does not exist
    at <unknown> (/app/node_modules/pg/lib/client.js:535:17)
    at async p (/app/.next/server/app/api/plate-reads/route.js:1:4464)
    at async te.do (/app/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:18:17826)
    at async te.handle (/app/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:18:22492)
    at async doRender (/app/node_modules/next/dist/server/base-server.js:1455:42)
    at async responseGenerator (/app/node_modules/next/dist/server/base-server.js:1814:28)
    at async NextNodeServer.renderToResponseWithComponentsImpl (/app/node_modules/next/dist/server/base-server.js:1824:28)
    at async NextNodeServer.renderPageComponent (/app/node_modules/next/dist/server/base-server.js:2240:24)
    at async NextNodeServer.renderToResponseImpl (/app/node_modules/next/dist/server/base-server.js:2278:32) {
  length: 132,
  severity: 'ERROR',
  code: '42703',
  detail: undefined,
  hint: undefined,
  position: '370',
  internalPosition: undefined,
  internalQuery: undefined,
  where: undefined,
  schema: undefined,
  table: undefined,
  column: undefined,
  dataType: undefined,
  constraint: undefined,
  file: 'parse_target.c',
  line: '1047',
  routine: 'checkInsertTargets'
}

Here are screenshots of the container configs:

Image

Image

I have verified that the API is correct.

Here are the ALPR Settings

Image

Image

BI Camera Alert Settings:

Image

Any insight would be appreciated. Thanks in advance.

@olympia
Copy link
Contributor Author

olympia commented Feb 19, 2025

I think this is because schema.sql hasn't been updated to create the new devmgmt column in the table, so it doesn't get generated when you run postgres_db for the first time. Not sure why, maybe the new install scripts are running the migrations.sql right away? @algertc can probably clarify on this.

To workaround this, you would need to download and mount migrations.sql on the same way as schema.sql, then open postgres docker console and run psql -U postgres -d postgres -f /migrations.sql.

@kimocal
Copy link

kimocal commented Feb 19, 2025

I think this is because schema.sql hasn't been updated to create the new devmgmt column in the table, so it doesn't get generated when you run postgres_db for the first time. Not sure why, maybe the new install scripts are running the migrations.sql right away? @algertc can probably clarify on this.

To workaround this, you would need to download and mount migrations.sql on the same way as schema.sql, then open postgres docker console and run psql -U postgres -d postgres -f /migrations.sql.

@olympia That seems to have fixed it.

Image

I also added the images path to alpr-dashboard container as I was comparing against the docker-compose.yml

@olympia
Copy link
Contributor Author

olympia commented Feb 19, 2025

Great, glad it worked out for you!

I also added the images path to alpr-dashboard container as I was comparing against the docker-compose.yml

Yes, this is indeed needed as well. This new folder requirement is pretty recent, hence the steps above doesn't include this yet.

@kimocal
Copy link

kimocal commented Feb 19, 2025

Great, glad it worked out for you!

I also added the images path to alpr-dashboard container as I was comparing against the docker-compose.yml

Yes, this is indeed needed as well. This new folder requirement is pretty recent, hence the steps above doesn't include this yet.

All good. Thanks again for your feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants