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

Container auto crashing #9

Closed
cactusrent opened this issue Jun 1, 2023 · 6 comments · Fixed by #10
Closed

Container auto crashing #9

cactusrent opened this issue Jun 1, 2023 · 6 comments · Fixed by #10
Labels
enhancement New feature or request

Comments

@cactusrent
Copy link

Hello, upon starting up the npmgrafstats container it seems to be auto crashing immediately with the following logs posted:

Startup: lets get logs data and send them to influx
Redirection Logs activated
tail: cannot open '/logs/proxy-host-*_access.log' for reading: No such file or directory
tail: no files remaining
/root/.config/NPMGRAF/sendips.sh: line 38: reboot: command not found

I was just wondering if there is something I'm clearly doing wrong to get this started. Weirdly it kept looping a French IP address over and over again in the logs (possible it was looping through one entry?)

Attaching my config below----------

Redacted npmgrafstats docker-compose:

version: '3.8'
services:

  npmgraf:
    image: smilebasti/npmgrafstats:latest
    restart: unless-stopped
    environment:
      HOME_IPS: 'externalIP'
      REDIRECTION_LOGS: 'TRUE' # TRUE or FALSE
      INFLUX_HOST: 'hostip:8086' # use host IP
      INFLUX_BUCKET: 'npmgrafstats'
      INFLUX_ORG: 'npmgrafstats'
      INFLUX_TOKEN: 'cooltokennumber' # insert after first run and manual token creation
    volumes:
      - /data/compose/1/data/logs:/logs #nginx log location
      - ./geolite:/geolite
     
  influxdb:
    image: influxdb:2.7-alpine
    environment:
      DOCKER_INFLUXDB_INIT_MODE: 'setup'
      DOCKER_INFLUXDB_INIT_USERNAME: 'CoolUserName'
      DOCKER_INFLUXDB_INIT_PASSWORD: 'coolpassword' # atleast 8 characters
      DOCKER_INFLUXDB_INIT_ORG: 'npmgrafstats'
      DOCKER_INFLUXDB_INIT_BUCKET: 'npmgrafstats'
    volumes:
      # Mount for influxdb data directory and configuration
      - ./influxdbv2:/var/lib/influxdb2
    ports:
      - '8086:8086'

  geoipupdate:
    image: maxmindinc/geoipupdate
    environment:
      GEOIPUPDATE_ACCOUNT_ID: 'accountid'
      GEOIPUPDATE_LICENSE_KEY: 'geoiplicense'
      GEOIPUPDATE_EDITION_IDS: 'GeoLite2-City'
      GEOIPUPDATE_FREQUENCY: 24
    volumes:
      - ./geolite:/usr/share/GeoIP
@smilebasti
Copy link
Owner

smilebasti commented Jun 1, 2023

Hi,
it seems that there is no proxy-host-*_access.log file in /data/compose/1/data/logs
(Star means any number)

  • Is there any file in this directory?
  • Are you only using redirects and no reverse proxy?

The French IP shouldn't be a problem but i can test it if you want to share any proxy-host-*_access.log

Otherwise all looks fine :)

@cactusrent
Copy link
Author

Thanks for getting back!

Yes there are files but we are currently only using NPM for redirects. I wonder if that could be the issue causing it to loop?

This is what we have in the /logs folder with our config:

fallback_access.log       fallback_error.log.2.gz  fallback_error.log.9.gz
fallback_access.log.1.gz  fallback_error.log.3.gz  redirection-host-1_access.log
fallback_access.log.2.gz  fallback_error.log.4.gz  redirection-host-1_access.log.1.gz
fallback_access.log.3.gz  fallback_error.log.5.gz  redirection-host-1_access.log.2.gz
fallback_access.log.4.gz  fallback_error.log.6.gz  redirection-host-1_access.log.3.gz
fallback_error.log        fallback_error.log.7.gz  redirection-host-1_access.log.4.gz
fallback_error.log.1.gz   fallback_error.log.8.gz  redirection-host-1_error.log

@smilebasti smilebasti added the enhancement New feature or request label Jun 2, 2023
@smilebasti
Copy link
Owner

smilebasti commented Jun 2, 2023

Ok. As i didn't plan it, it's currently not working without a reverse-proxy.

Give a me bit of time to release the redirection only.

Do you also need to monitor fallback?

@cactusrent
Copy link
Author

Might be nice to have but realistically nothing that we'll need to monitor in this case. Thanks for the great work, I appreciate you looking into this!

@smilebasti
Copy link
Owner

Ok. I had a look at that file and it's to much useless information to display something interesting. As there is no use case currently i am not planning to implement it.

Tomorrow i'm planning to release (v2.2.1) the redirection-only function but with an additional feature. An ip-exclusion list for ip's from Monitoring Service's.

Glad to help

@smilebasti smilebasti linked a pull request Jun 3, 2023 that will close this issue
@smilebasti
Copy link
Owner

With the latest image you can set the REDIRECTION_LOGS to ONLY.
This now only logs redirections which should fix your problem.

Let me know if it's not working as intended :)

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

Successfully merging a pull request may close this issue.

2 participants