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]master-web image fails to run but master-omnibus works fine #409

Closed
icsy7867 opened this issue Nov 30, 2022 · 6 comments
Closed

[BUG]master-web image fails to run but master-omnibus works fine #409

icsy7867 opened this issue Nov 30, 2022 · 6 comments
Labels
bug Something isn't working

Comments

@icsy7867
Copy link

icsy7867 commented Nov 30, 2022

Describe the bug
I am deploying on a pretty vanilla k3s server. If I use the master-web container, it fails every time. I am happy to use the omnibus container if that is what works though. But wanted to share. For some reason, it seems to be dialing localhost to ipv6 instead of ipv4.

Start the scrutiny server
time="2022-11-30T02:27:15Z" level=info msg="Trying to connect to scrutiny sqlite db: /opt/scrutiny/config/scrutiny.db\n" type=web
time="2022-11-30T02:27:15Z" level=info msg="Successfully connected to scrutiny sqlite db: /opt/scrutiny/config/scrutiny.db\n" type=web
panic: failed to check influxdb setup status - Get "http://localhost:8086/api/v2/setup": dial tcp [::1]:8086: connect: connection refused

goroutine 1 [running]:
github.com/analogj/scrutiny/webapp/backend/pkg/web/middleware.RepositoryMiddleware({0x11a4330?, 0xc000010070?}, {0x11a58f0?, 0xc0000d7730?})
	/go/src/github.com/analogj/scrutiny/webapp/backend/pkg/web/middleware/repository.go:15 +0xd6
github.com/analogj/scrutiny/webapp/backend/pkg/web.(*AppEngine).Setup(0xc00000e348, 0x10066ab?)
	/go/src/github.com/analogj/scrutiny/webapp/backend/pkg/web/server.go:26 +0xa5
github.com/analogj/scrutiny/webapp/backend/pkg/web.(*AppEngine).Start(0xc00000e348)
	/go/src/github.com/analogj/scrutiny/webapp/backend/pkg/web/server.go:90 +0x12c
main.main.func2(0xc000081200)
	/go/src/github.com/analogj/scrutiny/webapp/backend/cmd/scrutiny/scrutiny.go:126 +0x398
github.com/urfave/cli/v2.(*Command).Run(0xc0000e2240, 0xc000081080)
	/go/src/github.com/analogj/scrutiny/vendor/github.com/urfave/cli/v2/command.go:164 +0x5bb
github.com/urfave/cli/v2.(*App).RunContext(0xc0000e4000, {0x119e898?, 0xc000136020}, {0xc000134000, 0x2, 0x2})
	/go/src/github.com/analogj/scrutiny/vendor/github.com/urfave/cli/v2/app.go:306 +0xbc5
github.com/urfave/cli/v2.(*App).Run(...)
	/go/src/github.com/analogj/scrutiny/vendor/github.com/urfave/cli/v2/app.go:215
main.main()
	/go/src/github.com/analogj/scrutiny/webapp/backend/cmd/scrutiny/scrutiny.go:151 +0x659

However, using the omnibus image it seems to work fine. Exact same deployment. To test, I did not use any static storage so all deployments were starting as a fresh instance.

Expected behavior
Web interface would load as expected.

Screenshots
Log above has all of the details.

@icsy7867 icsy7867 added the bug Something isn't working label Nov 30, 2022
@AnalogJ
Copy link
Owner

AnalogJ commented Nov 30, 2022

The omnibus image contains 3 services:

  • collector
  • web-server/api-server
  • influxdb

If you're running the web image without providing Scrutiny with an InfluxDB server to communicate with, the service will fail with the message you've included above.

Can you provide some more information about your k3 deployment?

@icsy7867
Copy link
Author

icsy7867 commented Nov 30, 2022

Man you reply fast!

I think this is user error then, nothing wrong with rancher/k3s.

The main github is a little confusing to me:

For the master-web container it is described as:
ghcr.io/analogj/scrutiny:master-web - Contains the Web UI, API and Database. Only one container necessary

However you docker-compose hub/spoke example does show a separate influxDB. But I am still not sure how the master-web "knows" about the influxDB. Is scrutiny:master-web hardcoded to talk to "scrutiny-influxdb" on port 8086? Or does it just try to docker host on port 8086? Or is there another way to specify host, port, auth?

docker run --rm -p 8086:8086 \
  -v `pwd`/influxdb2:/var/lib/influxdb2 \
  --name scrutiny-influxdb \
  influxdb:2.2

docker run --rm -p 8080:8080 \
  -v `pwd`/scrutiny:/opt/scrutiny/config \
  --name scrutiny-web \
  ghcr.io/analogj/scrutiny:master-web

Since i am deploying in rancher, things like namespaces, and containers in pods all will communicate with one another a little differently.

@AnalogJ
Copy link
Owner

AnalogJ commented Nov 30, 2022

Apologies, looks like I need to fix the documentation, its out of date.

When using Hub/Spoke deployments, you can configure the influxdb hostname using the following environmental variable: SCRUTINY_WEB_INFLUXDB_HOST

See here for an example in the docker-compose file:
https://github.com/AnalogJ/scrutiny/blob/master/docker/example.hubspoke.docker-compose.yml#L23-L24

You can also configure the influxdb host (and port) using a config file: https://github.com/AnalogJ/scrutiny/blob/master/example.scrutiny.yaml#L44-L45

AnalogJ added a commit that referenced this issue Nov 30, 2022
@AnalogJ
Copy link
Owner

AnalogJ commented Nov 30, 2022

I updated the README with the influxdb requirement.

@icsy7867
Copy link
Author

icsy7867 commented Nov 30, 2022

Beautiful!

One last requested change. For the master-web description, I would change it from saying:

Only one container necessary

To something a bit clearer like:

Also requires additional influxDB container or service. See configuration examples here (link to anchored section)

@AnalogJ
Copy link
Owner

AnalogJ commented Jan 12, 2023

this has been fixed in the README, closing.

Thanks for the feedback @icsy7867 If you have any further issues please comment/reopen this issue

@AnalogJ AnalogJ closed this as completed Jan 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants