Community
OpenEnergyMonitor

OpenEnergyMonitor Community

Emoncms access issue (403) on docker

I posted the issue also in GitHub:
I installed on ubuntu 20.04 server in docker emoncms and I always get the error at access (with localhost:8080) -> 403 -Forbidden, you don’t have the permission to access/ on this server (Apache 2.4.38 (Debian Server). I stopped apache on the ubuntu server already, stopped the firewall, changed port settings to 8070/70 but I always get the same issue. Before I used this setup on a Synology Nas and it worked… (with an older Emoncms Docker image).

during docker-compose up I get these messages:

[email protected]:/etc/emoncms-docker# docker-compose up
Creating emoncms-docker_redis_1 ... done
Creating emoncms-docker_db_1 ... done
Creating emoncms-docker_web_1 ... done
Attaching to emoncms-docker_db_1, emoncms-docker_redis_1, emoncms-docker_web_1
db_1 | 2020-08-30 22:17:18+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 1:10.5.5+maria<del>focal started.
db_1 | 2020-08-30 22:17:18+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
db_1 | 2020-08-30 22:17:18+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 1:10.5.5+maria</del>focal started.
redis_1 | 1:C 30 Aug 2020 22:17:18.439 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
redis_1 | 1:C 30 Aug 2020 22:17:18.439 # Redis version=5.0.9, bits=64, commit=00000000, modified=0, pid=1, just started
redis_1 | 1:C 30 Aug 2020 22:17:18.439 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
db_1 | 2020-08-30 22:17:19 0 [Note] mysqld (mysqld 10.5.5-MariaDB-1:10.5.5+maria<del>focal) starting as process 1 ...
redis_1 | 1:M 30 Aug 2020 22:17:18.442 * Running mode=standalone, port=6379.
redis_1 | 1:M 30 Aug 2020 22:17:18.442 # Server initialized
redis_1 | 1:M 30 Aug 2020 22:17:18.442 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
redis_1 | 1:M 30 Aug 2020 22:17:18.442 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.
db_1 | 2020-08-30 22:17:19 0 [Note] InnoDB: Using Linux native AIO
db_1 | 2020-08-30 22:17:19 0 [Note] InnoDB: Uses event mutexes
db_1 | 2020-08-30 22:17:19 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
db_1 | 2020-08-30 22:17:19 0 [Note] InnoDB: Number of pools: 1
redis_1 | 1:M 30 Aug 2020 22:17:18.443 * DB loaded from disk: 0.002 seconds
redis_1 | 1:M 30 Aug 2020 22:17:18.444 * Ready to accept connections
db_1 | 2020-08-30 22:17:19 0 [Note] InnoDB: Using SSE4.2 crc32 instructions
db_1 | 2020-08-30 22:17:19 0 [Note] mysqld: O_TMPFILE is not supported on /tmp (disabling future attempts)
db_1 | 2020-08-30 22:17:19 0 [Note] InnoDB: Initializing buffer pool, total size = 134217728, chunk size = 134217728
db_1 | 2020-08-30 22:17:19 0 [Note] InnoDB: Completed initialization of buffer pool
db_1 | 2020-08-30 22:17:19 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
db_1 | 2020-08-30 22:17:19 0 [Note] InnoDB: 128 rollback segments are active.
db_1 | 2020-08-30 22:17:19 0 [Note] InnoDB: Creating shared tablespace for temporary tables
db_1 | 2020-08-30 22:17:19 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
db_1 | 2020-08-30 22:17:19 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
db_1 | 2020-08-30 22:17:19 0 [Note] InnoDB: 10.5.5 started; log sequence number 45139; transaction id 21
db_1 | 2020-08-30 22:17:19 0 [Note] Plugin 'FEEDBACK' is disabled.
db_1 | 2020-08-30 22:17:19 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
db_1 | 2020-08-30 22:17:19 0 [Note] InnoDB: Buffer pool(s) load completed at 200830 22:17:19
db_1 | 2020-08-30 22:17:19 0 [Note] Server socket created on IP: '::'.
db_1 | 2020-08-30 22:17:19 0 [Warning] 'proxies_priv' entry '@% [email protected]' ignored in --skip-name-resolve mode.
db_1 | 2020-08-30 22:17:19 0 [Note] Reading of all Master_info entries succeeded
db_1 | 2020-08-30 22:17:19 0 [Note] Added new Master_info '' to hash table
db_1 | 2020-08-30 22:17:19 0 [Note] mysqld: ready for connections.
db_1 | Version: '10.5.5-MariaDB-1:10.5.5+maria</del>focal' socket: '/run/mysqld/mysqld.sock' port: 3306 mariadb.org binary distribution
web_1 | AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.18.0.4. Set the 'ServerName' directive globally to suppress this message
web_1 | AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.18.0.4. Set the 'ServerName' directive globally to suppress this message
web_1 | [Sun Aug 30 22:17:20.308514 2020] [mpm_prefork:notice] [pid 1] AH00163: Apache/2.4.38 (Debian) PHP/7.3.9 configured -- resuming normal operations
web_1 | [Sun Aug 30 22:17:20.308574 2020] [core:notice] [pid 1] AH00094: Command line: 'apache2 -D FOREGROUND'
web_1 | localhost:80 172.18.0.1 - - [30/Aug/2020:22:18:05 +0000] "GET / HTTP/1.1" 403 503 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:80.0) Gecko/20100101 Firefox/80.0"

Any idea? Thank you very much for your help!

How did you install? Suspect the Apache configuration is listening on port 80 (the usual HTTP Port).

I used the description in https://github.com/emoncms/emoncms-docker -so I used:
$ git clone https://github.com/emoncms/emoncms-docker
$ cd emoncms-docker
$ docker pull openenergymonitor/emoncms:latest
$ docker-compose up

and I also tried the manual way described - both resulted in the same issue

OK. Sorry, but I know nothing about this image @glyn.hudson may be able to help.

Is there another docker image you recommend?

Hello @ger73 you could try if you like v2 of the docker image, it is a paused development so never fully reached the release stage, but I think it does work from what I remember https://github.com/emoncms/emoncms-docker/tree/v2

I’ve just tested myself and the emoncms/emoncms-docker image works for me, maybe double-check the firewall is open on port 8080?

The terminal output from you posted from the container startup all looks good, and is identical to the output I have with no errors. This indicates the issue may not be with the container:

Try running this simple port checker image:

docker run -it --rm -p 8080:8000/tcp qmcgaw/port-checker

If it’s working you should see some info text on port 8080

The emoncms-docker uses port 8080 by default, this can be changed here if needed:

1 Like

I don’t understand it - having not the emoncms container running the port checker is checking - as soon as I start the emoncms container I get the error the port is allocated.

So it seems for me the 8080 is open (ufw firewall is inactive currently). In parallel I installed the full version (what was not my plan ) and it seems to work (even with the data on a nfs share)… So for now I think I will stick with the normal installation instead of container. Thank you very much for your help! BR Gerald

You must still have the emoncms container running, or some other service using port 8080. To see what docker containers are running use:

$ docker ps

To stop all running containers use:

$ docker stop $(docker ps -a -q)

If there arent any docker containers running on port 8080 then maybe there is another service, use

$ netstat -tulpn

Then you can try the port tester again.

1 Like

@ger73, Please copy the text and paste it here rather than pasting images that are impossible to read.

When posting code or bash output, please put in 3 ‘backticks’ (found at the top left of the keyboard normally) on a line on their own, then the code, then 3 more backticks on a line following the code.

    ```
    code
    ```

If it is something like php you can add a language identifier that after the first 3 backticks so ```php

Agree with you 100% on posting code vice images, but when clicked on,

the image expands to nearly full screen width and is quite readable.

Hi, I have the same issue. emoncms installed using docker and latest from github https://github.com/emoncms/emoncms-docker/
I get a 403 error form the web server but installation goes fine that the get request comes across fine in the logs.
This is on a brand new 20.04 ubuntu server install.
I can provide whatever logs you need.
When I stop the containers and run netstat -tulpn, nothing is shown on 8080.
the port-checker command shows text on 8080

sudo ufw status shows ‘inactive’.

I’m trying to move my emoncms from a raspi zero to a server running docker.

Error message in Firefox/Chrome
" Forbidden

You don’t have permission to access / on this server."

Hi Aaron, at the end I changed the port to 8090:80 and now it is running - the crazy thing is I didn’t see anything on 8080… Where to change: https://github.com/emoncms/emoncms-docker/blob/master/docker-compose.override.yml#L9
BR Gerald