netdisco / netdisco-docker

Docker images for App::Netdisco
BSD 3-Clause "New" or "Revised" License
47 stars 14 forks source link

docker-compose up fails with DB error and I can't access web GUI #73

Open thatlostboy opened 1 month ago

thatlostboy commented 1 month ago

Provide a general summary of the issue in the Title above

when including netdisco config snippets, whitespace matters since it's a yaml file for github issues it really helps if you include the relevant config parts in a codeblock (code fencing) see the "code" subject on https://guides.github.com/features/mastering-markdown/ for that) this should preserve spaces in the issue tracker and make troubleshooting quicker -->

Expected Behavior

When i run docker-compose up, the containers should come up and i shoudl be able to access the web interface.

Current Behavior

When I run docker-compose up, I get the following error. And I cannot acess the website at https://localhost:5000

netdisco-test docker-compose up
[+] Running 3/0
 ✔ Container netdisco-test-netdisco-postgresql-1  Created                                                                                                                                                                       0.0s
 ✔ Container netdisco-test-netdisco-backend-1     Created                                                                                                                                                                       0.0s
 ✔ Container netdisco-test-netdisco-web-1         Created                                                                                                                                                                       0.0s
Attaching to netdisco-backend-1, netdisco-postgresql-1, netdisco-web-1
netdisco-postgresql-1  | chown: /var/lib/postgresql/data: Permission denied
netdisco-postgresql-1 exited with code 1
netdisco-backend-1     | config watcher: watching /home/netdisco/environments for updates.
netdisco-web-1         | config watcher: watching /home/netdisco/environments for updates.
netdisco-web-1         | 2024/09/03-17:45:53 Starman::Server (type Net::Server::PreFork) starting! pid(13)
netdisco-web-1         | Binding to TCP port 5000 on host * with IPv4
netdisco-web-1         | [21] 2024-09-03 17:46:00  warn App::Netdisco 2.078000 web
netdisco-web-1         | [20] 2024-09-03 17:46:00  warn App::Netdisco 2.078000 web
netdisco-web-1         | [16] 2024-09-03 17:46:00  warn App::Netdisco 2.078000 web
netdisco-web-1         | [17] 2024-09-03 17:46:00  warn App::Netdisco 2.078000 web
netdisco-web-1         | [22] 2024-09-03 17:46:00  warn App::Netdisco 2.078000 web
netdisco-web-1         | DBIx::Class::Schema::Versioned::_on_connect(): Your DB is currently unversioned. Please call upgrade on your schema to sync the DB. at /home/netdisco/perl5/lib/perl5/DBICx/Sugar.pm line 121
netdisco-web-1         | DBIx::Class::Schema::Versioned::_on_connect(): Your DB is currently unversioned. Please call upgrade on your schema to sync the DB. at /home/netdisco/perl5/lib/perl5/DBICx/Sugar.pm line 121
netdisco-web-1         | DBIx::Class::Schema::Versioned::_on_connect(): Your DB is currently unversioned. Please call upgrade on your schema to sync the DB. at /home/netdisco/perl5/lib/perl5/DBICx/Sugar.pm line 121
netdisco-web-1         | Error while loading /home/netdisco/perl5/bin/netdisco-web-fg: The setting session_cookie_key must be defined at /home/netdisco/perl5/lib/perl5/Dancer/Session/Cookie.pm line 38.
netdisco-web-1         | Compilation failed in require at /home/netdisco/perl5/bin/netdisco-web-fg line 59.
netdisco-web-1         | BEGIN failed--compilation aborted at /home/netdisco/perl5/bin/netdisco-web-fg line 59.
netdisco-web-1         | Child process 16 exited with status 22
netdisco-web-1         | Error while loading /home/netdisco/perl5/bin/netdisco-web-fg: The setting session_cookie_key must be defined at /home/netdisco/perl5/lib/perl5/Dancer/Session/Cookie.pm line 38.
netdisco-web-1         | Compilation failed in require at /home/netdisco/perl5/bin/netdisco-web-fg line 59.
netdisco-web-1         | BEGIN failed--compilation aborted at /home/netdisco/perl5/bin/netdisco-web-fg line 59.

Possible Solution

Steps to Reproduce (for bugs)

I following the steps in: https://hub.docker.com/r/netdisco/netdisco

  1. mkdir netdisco-test
  2. cd netdisco-test
  3. curl -Ls -o docker-compose.yml https://tinyurl.com/nd2-dockercompose\ndocker-compose up\n
  4. mkdir -p netdisco/{logs,config,nd-site-local}
  5. docker-compose up

Context

I cannot test netdisco for our environment.

Your Environment

I am not sure how to check the postgresql and backend versions. Here is the relevant output from the docker image ls

(t4i-wired-mac-scripts) ➜  switch_mac_config_info git:(IEDV-2461) ✗ docker image ls
REPOSITORY                                          TAG                    IMAGE ID       CREATED         SIZE
netdisco/netdisco                                   latest-backend         e303ceacaffc   7 days ago      837MB
netdisco/netdisco                                   latest-web             4e8cfcff6652   7 days ago      324MB
netdisco/netdisco                                   latest-postgresql      83f0962f18ae   7 days ago      199MB
## Config info (deployment.yml and docker env settings)
<!--- if possible include all options you added to your deployment.yml file and -->
<!--- your docker environment, since some options can change the behaviour in drastic ways -->

Device information

thatlostboy commented 1 month ago

I am using rancher 1.14.2 on my laptop (not docker directly) as we are not allowed to use docker at our company. Is this issue on netdisco related to: https://github.com/rancher-sandbox/rancher-desktop/issues/1209

benjofalanga commented 2 weeks ago

Hello Im having a similar issue asking for upgrade of db

followed the instructions as per README

cd $directory_of_your_choice
mkdir -p netdisco/{logs,config,nd-site-local} 
sudo chown -R 901:901 netdisco
~ ls -al
total 16
drwxr-xr-x 6      901      901 4096 Sep 18 11:46 netdisco
netdisco-web_1         | DBIx::Class::Schema::Versioned::_on_connect(): Your DB is currently unversioned. Please call upgrade on your schema to sync the DB. at /home/netdisco/perl5/lib/perl5/DBICx/Sugar.pm line 121
netdisco-web_1         | Error while loading /home/netdisco/perl5/bin/netdisco-web-fg: The setting session_cookie_key must be defined at /home/netdisco/perl5/lib/perl5/Dancer/Session/Cookie.pm line 38.
netdisco-web_1         | Compilation failed in require at /home/netdisco/perl5/bin/netdisco-web-fg line 59.
netdisco-web_1         | BEGIN failed--compilation aborted at /home/netdisco/perl5/bin/netdisco-web-fg line 59.
netdisco-web_1         | Child process 9 exited with status 115
netdisco-web_1         | DBIx::Class::Schema::Versioned::_on_connect(): Your DB is currently unversioned. Please call upgrade on your schema to sync the DB. at /home/netdisco/perl5/lib/perl5/DBICx/Sugar.pm line 121
netdisco-web_1         | Error while loading /home/netdisco/perl5/bin/netdisco-web-fg: The setting session_cookie_key must be defined at /home/netdisco/perl5/lib/perl5/Dancer/Session/Cookie.pm line 38.
netdisco-web_1         | Compilation failed in require at /home/netdisco/perl5/bin/netdisco-web-fg line 59.
netdisco-web_1         | BEGIN failed--compilation aborted at /home/netdisco/perl5/bin/netdisco-web-fg line 59.
netdisco-web_1         | Child process 12 exited with status 115
netdisco-web_1         | DBIx::Class::Schema::Versioned::_on_connect(): Your DB is currently unversioned. Please call upgrade on your schema to sync the DB. at /home/netdisco/perl5/lib/perl5/DBICx/Sugar.pm line 121
netdisco-web_1         | Error while loading /home/netdisco/perl5/bin/netdisco-web-fg: The setting session_cookie_key must be defined at /home/netdisco/perl5/lib/perl5/Dancer/Session/Cookie.pm line 38.
netdisco-web_1         | Compilation failed in require at /home/netdisco/perl5/bin/netdisco-web-fg line 59.
netdisco-web_1         | BEGIN failed--compilation aborted at /home/netdisco/perl5/bin/netdisco-web-fg line 59.
netdisco-web_1         | Child process 10 exited with status 115
netdisco-web_1         | DBIx::Class::Schema::Versioned::_on_connect(): Your DB is currently unversioned. Please call upgrade on your schema to sync the DB. at /home/netdisco/perl5/lib/perl5/DBICx/Sugar.pm line 121
netdisco-web_1         | Error while loading /home/netdisco/perl5/bin/netdisco-web-fg: The setting session_cookie_key must be defined at /home/netdisco/perl5/lib/perl5/Dancer/Session/Cookie.pm line 38.

I can actually enter the web gui ,seems to be working .

Any clue how to solve this?