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

Web UI login fail without error #33

Closed
aswen opened this issue Jan 2, 2024 · 2 comments
Closed

Web UI login fail without error #33

aswen opened this issue Jan 2, 2024 · 2 comments

Comments

@aswen
Copy link

aswen commented Jan 2, 2024

I'm not sure this is actually an issue with the docker Observium image, more likely an error made by me, so consider this a request for help and feel free to close it if you feel this issue shouldn't be posted here.

After updating to latest version the login page returns to the login page without any error message.

Browser used: Firefox 121.0 (On Fedora 39, 6.6.8-200.fc39.x86_64)
MySQL version: `ii percona-server-server 8.0.35-27-1.bookworm amd64
Docker pull looks like:

Using default tag: latest
latest: Pulling from mbixtech/observium
Digest: sha256:b7aa35ba6412744cab1b3c8496e23c9e0a0f405747c71ed132af2bb3762b38ce
Status: Image is up to date for mbixtech/observium:latest
docker.io/mbixtech/observium:latest

In the container I see:

/opt/observium# cat VERSION
Observium CE 23.9

Docker inspect Labels:

                "com.docker.compose.container-number": "1",
                "com.docker.compose.oneoff": "False",
                "com.docker.compose.project": "observium",
                "com.docker.compose.project.config_files": "/srv/docker/observium/observium.yml",
                "com.docker.compose.project.working_dir": "/srv/docker/observium",
                "com.docker.compose.service": "observium",
                "com.docker.compose.version": "1.29.2",
                "description": "Docker container for Observium Community Edition",
                "fetch_version": "latest",
                "maintainer": "[email protected]",
                "org.opencontainers.image.ref.name": "ubuntu",
                "org.opencontainers.image.version": "20.04",
                "version": "1.6"

compose yaml file:

version: '3.3'

services:
  observium:
    container_name: observium
    image: mbixtech/observium:latest
    network_mode: host
    environment:
      - OBSERVIUM_ADMIN_USER=REDACTED
      - OBSERVIUM_ADMIN_PASS=REDACTED
      - OBSERVIUM_DB_HOST=IP REDACTED
      - OBSERVIUM_DB_NAME=observium
      - OBSERVIUM_DB_USER=REDACTED
      - OBSERVIUM_DB_PASS=REDACTED
      - OBSERVIUM_BASE_URL=REDACTED
      - TZ=Europe/Amsterdam
    volumes:
      - ./logs:/opt/observium/logs
      - ./rrd:/opt/observium/rrd
      - ./apache2/ports.conf:/etc/apache2/ports.conf
      - ./apache2/sites-available/000-default.conf:/etc/apache2/sites-available/000-default.conf
    restart: unless-stopped

(So, I know I'm not running the default config)

The logs of the container:

$ docker logs observium
2024-01-02 22:46:32,719 CRIT Supervisor is running as root.  Privileges were not dropped because no user is specified in the config file.  If you intend to run as root, you can set user=root in the config file to avoid this message.
2024-01-02 22:46:32,721 INFO supervisord started with pid 1
2024-01-02 22:46:33,723 INFO spawned: 'apache2' with pid 7
2024-01-02 22:46:33,725 INFO spawned: 'cron' with pid 8
2024-01-02 22:46:33,726 INFO spawned: 'init' with pid 9
[1] Verifying coonection to observium database.
Connected to observium database successfully.
Database schema initialization has been done already.
2024-01-02 22:46:34,758 INFO success: apache2 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2024-01-02 22:46:34,758 INFO success: cron entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2024-01-02 22:46:34,758 INFO success: init entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
Setting system timezone to specific Europe/Amsterdam.
'/etc/localtime' -> '/usr/share/zoneinfo/Europe/Amsterdam'
2024-01-02 22:46:38,756 INFO exited: init (exit status 0; expected)

The logs/observium.log file has entries like:

[2024/01/02 23:10:11 +0100] poller.php(3696): poller.php: raspi3.REDACTED - 1 devices polled in 6.073 secs
[2024/01/02 23:10:11 +0100] poller-wrapper.py(3284): /opt/observium/poller-wrapper.py: processed 20 devices in 10.61 seconds with 8 threads, load average (5min) 0.12

I obviously double checked:

  • That the user I try to login with matches the one in the env settings ADMIN_USER and ADMIN_PASS.
  • That the users table hasn't changed (by checking the file date of the MySQL files of the MySQL server).

I tried to get the container in a more verbose logging mode by setting OBSERVIUM_WEB_DEBUG_UNPRIVILEGED=TRUE as environment variable but that didn't result in more logs anywhere. I learned later that this is because the config.php doesn't include the required getenv('...') line.

I'm fairly sure the following is not to blame, but for completeness:
I run Observium at a docker server with a separate MySQL server and it's accessed via a nginx proxy with this config:

upstream observium {
  server REDACTED:81;
}

server {
 if ($host = REDACTED) {
   return 301 https://$host$request_uri;
 } # managed by Certbot


  listen 80;
  server_name REDACTED;

  access_log /var/log/observium/nginx_access.log;
  error_log  /var/log/observium/nginx_error.log;

  rewrite ^ https://$server_name$request_uri? permanent;


}

server {
  server_name REDACTED;
  listen 443 ssl http2;
  root /var/www/html;

  add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
  ssl_certificate /etc/letsencrypt/live/REDACTED/fullchain.pem; # managed by Certbot
  ssl_certificate_key /etc/letsencrypt/live/REDACTED/privkey.pem; # managed by Certbot

  include conf.d/location.defaults;
  include conf.d/proxy.params;

  access_log /var/log/observium/nginx_access.log;
  error_log  /var/log/observium/nginx_error.log;

  # Access control
  satisfy any;
  allow REDACTED/16;   # My network
  deny all;

  location / {
    include conf.d/proxy.params;
    proxy_set_header X-Scheme $scheme;
    proxy_pass http://observium;
  }

}
@aswen
Copy link
Author

aswen commented Jan 3, 2024

Next day I look, try it again, login works? I don't know what caused this, fixed this or why it suddenly works.

@aswen aswen closed this as completed Jan 3, 2024
@somsakc
Copy link
Owner

somsakc commented Jan 9, 2024

I reviewed you post. It looks fine. BTW, you have solved it already. It is great thing to here from you. I am so happy and appreciate with you, enjoy Obvervium and container world.

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

2 participants