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

Testing influx version and get password and username not found #234

Closed
woolmonkey opened this issue May 8, 2022 · 18 comments
Closed

Testing influx version and get password and username not found #234

woolmonkey opened this issue May 8, 2022 · 18 comments
Labels
bug Something isn't working waiting for response

Comments

@woolmonkey
Copy link

woolmonkey commented May 8, 2022

This is run on a new docker container now settings from old version where left.

`Docker:~/docker-compose$ docker logs scrutiny
[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 01-timezone: executing...
[cont-init.d] 01-timezone: exited 0.
[cont-init.d] 50-config: executing...
[cont-init.d] 50-config: exited 0.
[cont-init.d] done.
[services.d] starting services
waiting for influxdb
waiting for scrutiny service to start
starting cron
[services.d] done.
starting influxdb
influxdb not ready
scrutiny api not ready
ts=2022-05-08T15:12:02.531330Z lvl=info msg="Welcome to InfluxDB" log_id=0aL3UZtl000 version=v2.2.0 commit=a2f8538837 build_date=2022-04-06T17:36:40Z
ts=2022-05-08T15:12:02.535848Z lvl=info msg="Resources opened" log_id=0aL3UZtl000 service=bolt path=/scrutiny/influxdb/influxd.bolt
ts=2022-05-08T15:12:02.535900Z lvl=info msg="Resources opened" log_id=0aL3UZtl000 service=sqlite path=/scrutiny/influxdb/influxd.sqlite
ts=2022-05-08T15:12:02.536757Z lvl=info msg="Bringing up metadata migrations" log_id=0aL3UZtl000 service="KV migrations" migration_count=19
ts=2022-05-08T15:12:02.615243Z lvl=info msg="Bringing up metadata migrations" log_id=0aL3UZtl000 service="SQL migrations" migration_count=5
ts=2022-05-08T15:12:02.629517Z lvl=info msg="Using data dir" log_id=0aL3UZtl000 service=storage-engine service=store path=/scrutiny/influxdb/engine/data
ts=2022-05-08T15:12:02.629583Z lvl=info msg="Compaction settings" log_id=0aL3UZtl000 service=storage-engine service=store max_concurrent_compactions=8 throughput_bytes_per_second=50331648 throughput_bytes_per_second_burst=50331648
ts=2022-05-08T15:12:02.629595Z lvl=info msg="Open store (start)" log_id=0aL3UZtl000 service=storage-engine service=store op_name=tsdb_open op_event=start
ts=2022-05-08T15:12:02.629632Z lvl=info msg="Open store (end)" log_id=0aL3UZtl000 service=storage-engine service=store op_name=tsdb_open op_event=end op_elapsed=0.039ms
ts=2022-05-08T15:12:02.629654Z lvl=info msg="Starting retention policy enforcement service" log_id=0aL3UZtl000 service=retention check_interval=30m
ts=2022-05-08T15:12:02.629659Z lvl=info msg="Starting precreation service" log_id=0aL3UZtl000 service=shard-precreation check_interval=10m advance_period=30m
ts=2022-05-08T15:12:02.630081Z lvl=info msg="Starting query controller" log_id=0aL3UZtl000 service=storage-reads concurrency_quota=1024 initial_memory_bytes_quota_per_query=9223372036854775807 memory_bytes_quota_per_query=9223372036854775807 max_memory_bytes=0 queue_size=1024
ts=2022-05-08T15:12:02.631198Z lvl=info msg="Configuring InfluxQL statement executor (zeros indicate unlimited)." log_id=0aL3UZtl000 max_select_point=0 max_select_series=0 max_select_buckets=0
ts=2022-05-08T15:12:02.636081Z lvl=info msg=Listening log_id=0aL3UZtl000 service=tcp-listener transport=http addr=:8086 port=8086
scrutiny api not ready
starting scrutiny
2022/05/08 09:12:07 No configuration file found at /scrutiny/config/scrutiny.yaml. Using Defaults.
time="2022-05-08T09:12:07-06:00" level=info msg="Trying to connect to scrutiny sqlite db: \n"


/ ) / )( _ ( )( )( )( )( ( )( / )
_
( (
) / )(
)( )( )( ) ( \ /
(
/ _)()_)() () ()()_) (__)
github.com/AnalogJ/scrutiny dev-0.3.12

Start the scrutiny server
[GIN-debug] [WARNING] Running in "debug" mode. Switch to "release" mode in production.

  • using env: export GIN_MODE=release
  • using code: gin.SetMode(gin.ReleaseMode)

time="2022-05-08T09:12:07-06:00" level=info msg="Successfully connected to scrutiny sqlite db: \n"
panic: a username and password is required for a setup

goroutine 1 [running]:
github.com/analogj/scrutiny/webapp/backend/pkg/web/middleware.RepositoryMiddleware(0x129e540, 0xc000114078, 0x12a3720, 0xc000482230, 0x129e5c0)
/go/src/github.com/analogj/scrutiny/webapp/backend/pkg/web/middleware/repository.go:14 +0xe6
github.com/analogj/scrutiny/webapp/backend/pkg/web.(*AppEngine).Setup(0xc000113290, 0x12a3720, 0xc000482230, 0x1)
/go/src/github.com/analogj/scrutiny/webapp/backend/pkg/web/server.go:26 +0xcf
github.com/analogj/scrutiny/webapp/backend/pkg/web.(*AppEngine).Start(0xc000113290, 0x0, 0x0)
/go/src/github.com/analogj/scrutiny/webapp/backend/pkg/web/server.go:91 +0x234
main.main.func2(0xc00011b380, 0x4, 0x6)
/go/src/github.com/analogj/scrutiny/webapp/backend/cmd/scrutiny/scrutiny.go:112 +0x198
github.com/urfave/cli/v2.(*Command).Run(0xc000484480, 0xc00011b200, 0x0, 0x0)
/go/pkg/mod/github.com/urfave/cli/[email protected]/command.go:164 +0x4e0
github.com/urfave/cli/v2.(*App).RunContext(0xc000102600, 0x128d440, 0xc0001a8010, 0xc0001a0020, 0x2, 0x2, 0x0, 0x0)
/go/pkg/mod/github.com/urfave/cli/[email protected]/app.go:306 +0x814
github.com/urfave/cli/v2.(*App).Run(...)
/go/pkg/mod/github.com/urfave/cli/[email protected]/app.go:215
main.main()
/go/src/github.com/analogj/scrutiny/webapp/backend/cmd/scrutiny/scrutiny.go:137 +0x65a
waiting for influxdb
starting scrutiny
2022/05/08 09:12:07 No configuration file found at /scrutiny/config/scrutiny.yaml. Using Defaults.
`

@AnalogJ
Copy link
Owner

AnalogJ commented May 8, 2022

Hey @woolmonkey this is incredibly strange.

Do you have a config file which overrides the web.influxdb.init_username and/or web.influxdb.init_password values?

Do you have environmental variables setup for SCRUTINY_WEB_INFLUXDB_INIT_USERNAME and/or SCRUTINY_WEB_INFLUXDB_INIT_PASSWORD ?

@AnalogJ AnalogJ added the bug Something isn't working label May 8, 2022
@woolmonkey
Copy link
Author

woolmonkey commented May 8, 2022

Ok not sure why but figured out. I guess I was running linuxserver.io version and one of these

  • SCRUTINY_API_ENDPOINT=http://localhost:8080
    • SCRUTINY_WEB=true
      caused the issue. Once removed it is now working.
      Now just have to wait for it to collect data.

@AnalogJ
Copy link
Owner

AnalogJ commented May 9, 2022

weird. Not quite sure why that unused envar overrode the default config, but I'm glad you got it figured out. I'll close this issue for now, but feel free to re-open if this issue comes back.

@AnalogJ AnalogJ closed this as completed May 9, 2022
@amatriain
Copy link

I'm experiencing the same error. If I remove the SCRUTINY_WEB env var the error disappears, but the app has no web UI. This is not a proper fix IMHO.

@joshuakohut77
Copy link

I am also experiencing this same issue. @amatriain is correct that removing SCRUTINY_WEB stops the error but it also stops the web UI. I would like to see this opened again.

@AnalogJ
Copy link
Owner

AnalogJ commented May 10, 2022

Hey @amatriain @joshuakohut77
Sure I can re-open this.

Can you help me with some debugging steps?

  • are you using the official omnibus Docker image (which includes InfluxDB)? ghcr.io/analogj/scrutiny:master-omnibus
  • What environmental variables do you have for the container?
  • can you attach your logs below in a comment.

@AnalogJ AnalogJ reopened this May 10, 2022
@nickbock
Copy link

I had the same issue.

Fixed it by switching from the linuxserver image to the official one and removed the following from the docker compose:

      - SCRUTINY_API_ENDPOINT=http://localhost:8080
      - SCRUTINY_WEB=true
      - SCRUTINY_COLLECTOR=true

@joshuakohut77
Copy link

So I think you already figured it out but this is a problem with the linuxserver image not supporting influxdb. They told us it was not a problem with their image at first and to ask about it here. However I saw you comment on their discord so you're up to speed. You can probably close this now. Thanks for your assistance.

@derekcentrico
Copy link

Can you cite where in their Discord chat you reached out to LinuxServer? I don't want to change up my docker-compose if I don't have to so very curious if they will fix their influxdb issue cited above?

@derekcentrico
Copy link

Found their conversation on the issue. I tried to simply convert over from LinuxServer after reading their Discord conversation as it didn't seem immediately promising. However, making the three changes above results in a "This site can’t be reached" error:

  scrutiny:
    ports:
      - '85:80'
      - '8885:8080'
    volumes:
      - '/var/run/docker.sock:/tmp/docker.sock:ro'
      - '/home/derek/docker/scrutiny:/config'
      - '/run/udev:/run/udev:ro'
    restart: always
    logging:
      options:
        max-size: 1g
    container_name: scrutiny
    environment:
      - PUID=1000
      - PGID=996
      - TZ=America/New_York
#      - 'SCRUTINY_API_ENDPOINT=http://localhost:8080'
#      - SCRUTINY_WEB=true
#      - SCRUTINY_COLLECTOR=true
    devices:
##homeserver##
      - '/dev/nvme0n1p1:/dev/nvme0n1p1'
      - '/dev/nvme1n1p1:/dev/nvme1n1p1'
      - '/dev/sde:/dev/sde'
      - '/dev/sdd:/dev/sdd'
      - '/dev/sdc:/dev/sdc'
      - '/dev/sdg:/dev/sdg'
      - '/dev/sdb:/dev/sdb'
      - '/dev/sdf:/dev/sdf'
      - '/dev/sda:/dev/sda'
    cap_add:
      - SYS_ADMIN
      - SYS_RAWIO
#    image: ghcr.io/linuxserver/scrutiny:latest
    image: ghcr.io/analogj/scrutiny:master-omnibus
    networks:
      vpnsys_net:
        ipv4_address: '172.22.0.104'

Where am I erring here?

@joshuakohut77
Copy link

So the above information is misleading and removes the error by removing the code which makes the website work.
In short, the env variable SCRUTINY_WEB is what makes the webservice produce a website to browse. With that commented out, you will get "that site can't be reached" because it's not loading it. If you want to switch the the analogj/scrutiny image, I recommend making a backup of your current docker-compose file and making a new one with the analogj examples. The two are not one to one the same.

you are right tho, the linuxserver image does not seem promising for them to fix.

@amatriain
Copy link

The analogj/omnibus:latest image works and has a web UI without the SCRUTINY_WEB env var. I moved to that image without issue.

@derekcentrico your compose file doesn't look right. Moving from the linuxserver image to the official one is not just a matter of changing the image file. Take a look at the GitHub README (do not look at the docker hub instructions, they are outdated and I've written a bug report about it). The path for configs is not /config but /opt/scrutiny/config. Also you're missing a volume for influxdb, it should be mounted in /opt/scrutiny/influxdb.

It worked for me. I used a new config directory, created by the image on first run, instead of trying to carry over the config volume from te linuxserver image, not sure if that can cause problems.

@derekcentrico
Copy link

Well this is fascinating. I have it operational and all my ATAs are "failed" whereas on linuxserver's variant none were. Head scratcher.

@AnalogJ
Copy link
Owner

AnalogJ commented May 12, 2022

here's a couple of confirmed working docker-compose files that you may want to look at:

Some notes:

  • SCRUTINY_WEB=true is unnecessary with the official image, as the web/api service is always running.
  • You must always persist the influxdb folder (omnibus: /opt/scrutiny/influxdb, vanilla image: /var/lib/influxdb2) otherwise the influx database will not be persisted and the credentials stored in the config file will be incorrect (and your database will be empty between restarts).

@derekcentrico I had some UI issues which mixed up warn vs failed disks, which could be why your disks are all classified as failed now. Can you send me over the output of the following command for your devices?

smartctl -x -j /dev/[DEVICE_NAME_HERE]

Thanks!

@derekcentrico
Copy link

derekcentrico commented May 12, 2022

@AnalogJ Thanks for the followup. Happy to split this into a new ticket if needed.

Here's my docker-compose:

  scrutinyanalogj:
    ports:
      - '86:80'
      - '8886:8080'
    volumes:
      - '/var/run/docker.sock:/tmp/docker.sock:ro'
      - '/home/derek/docker/scrutinyanalogj:/opt/scrutiny/config'
      - '/home/derek/docker/influxdb2:/opt/scrutiny/influxdb'
      - '/run/udev:/run/udev:ro'
    restart: always
    logging:
      options:
        max-size: 1g
    container_name: scrutinyanalogj
    environment:
      - PUID=1000
      - PGID=996
      - TZ=America/New_York
    devices:
##homeserver##
      - '/dev/nvme0n1p1:/dev/nvme0n1p1'
      - '/dev/nvme1n1p1:/dev/nvme1n1p1'
      - '/dev/sde:/dev/sde'
      - '/dev/sdd:/dev/sdd'
      - '/dev/sdc:/dev/sdc'
      - '/dev/sdg:/dev/sdg'
      - '/dev/sdb:/dev/sdb'
      - '/dev/sdf:/dev/sdf'
      - '/dev/sda:/dev/sda'
    cap_add:
      - SYS_ADMIN
      - SYS_RAWIO
    image: ghcr.io/analogj/scrutiny:master-omnibus
    networks:
      vpnsys_net:
        ipv4_address: '172.22.0.109'

Here's the output you requested for one of the six disks showing failure (sde): https://pastebin.com/iZAKVP6w

Also, the two SSDs do not display at all whereas they did fine on linuxserver's variant.

@AnalogJ
Copy link
Owner

AnalogJ commented May 12, 2022

@derekcentrico - '/var/run/docker.sock:/tmp/docker.sock:ro' is unnecessary, personally I'd be really careful about volume mounting the docker socket in random containers, its a huge security hole.

I'm still looking into your sde error message.


For everyone else following this thread, I've created an InfluxDB troubleshooting guide:

https://github.com/AnalogJ/scrutiny/blob/master/docs/TROUBLESHOOTING_INFLUXDB.md

@derekcentrico
Copy link

@AnalogJ copy that, deleted that line.

@AnalogJ
Copy link
Owner

AnalogJ commented May 25, 2022

This should be fixed with the later v0.4.x releases.

There were a couple semi-related changes causing influxdb failures:

  • SCRUTINY_WEB=true is required for LSIO scrutiny images, but breaks the official image (ghcr.io/analogj/scrutiny:master-omnibus) - just delete this env variable.
  • you must persist the influxdb data directory (omnibus: /opt/scrutiny/influxdb or vanilla image: /var/lib/influxdb2)
  • the influxdb SDK did not previously support a pre-determined api token (they've since merged my PR)

I'm going to close this issue for now. if anyone is still running into a similar influxDB related problem, please comment/reopen this issue.

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

No branches or pull requests

6 participants