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

Permission denied: '/opt/prom2teams/config.ini' #307

Closed
re-mscho opened this issue Sep 1, 2022 · 6 comments
Closed

Permission denied: '/opt/prom2teams/config.ini' #307

re-mscho opened this issue Sep 1, 2022 · 6 comments
Labels

Comments

@re-mscho
Copy link

re-mscho commented Sep 1, 2022

Description

I get an error on startup when mounting a custom config file readonly in docker.

NOTE: We are not allowed to have config files which are not readonly. It's a very bad idea anyway to have configuration files that are writable. This is very special to prom2teams and I've not seen any other software that needs this.

Steps to Reproduce

  1. Run idealista/prom2teams:4.0.0 docker image using docker-compose

Expected behavior:
Service should start

Actual behavior:
Service crashes with following error:

PermissionError: [Errno 13] Permission denied: '/opt/prom2teams/config.ini'
Traceback (most recent call last):
  File "/opt/prom2teams/replace_config.py", line 13, in <module>
    with open('/opt/prom2teams/config.ini', 'w') as file:

Reproduces how often:
Always

Environment

  • The release version/s you are using: 4.0.0
  • OS: Debian buster
  • Others: docker-compose version 1.29.2

Additional Information

docker-compose.yml

...
  prom2teams:
    image: idealista/prom2teams:4.0.0
    container_name: prom2teams
    volumes:
      - /etc/prom2teams/config.ini:/opt/prom2teams/config.ini:ro
    restart: unless-stopped
    expose:
      - 8089
    networks:
      - monitoring_net
    labels:
      org.label-schema.group: "monitoring"

@re-mscho re-mscho added the bug label Sep 1, 2022
@pierrediancourt
Copy link
Contributor

I'm also facing this issue but my volume is NOT read-only !
OS : Ubuntu 20.04
docker compose : v2.10.2

Full error log :

[uWSGI] getting INI configuration from /opt/prom2teams/uwsgi.ini
*** Starting uWSGI 2.0.20 (64bit) on [Thu Sep  1 16:41:24 2022] ***
compiled with version: 11.2.1 20220219 on 16 August 2022 11:04:57
os: Linux-5.4.0-125-generic #141-Ubuntu SMP Wed Aug 10 13:42:03 UTC 2022
nodename: prom2teams
machine: x86_64
clock source: unix
pcre jit disabled
detected number of CPU cores: 12
current working directory: /opt/prom2teams
detected binary path: /usr/local/bin/uwsgi
chdir() to /opt/prom2teams
your memory page size is 4096 bytes
detected max file descriptor number: 1048576
lock engine: pthread robust mutexes
thunder lock: disabled (you can enable it with --thunder-lock)
uwsgi socket 0 bound to TCP address uwsgihost:uwsgiport fd 3
unable to find protocol uwsgiprotocol
Traceback (most recent call last):
  File "/opt/prom2teams/replace_config.py", line 13, in <module>
    with open('/opt/prom2teams/config.ini', 'w') as file:
PermissionError: [Errno 13] Permission denied: '/opt/prom2teams/config.ini'

docker-compose.yml :

  prom2teams:
    image: idealista/prom2teams:4.0.0
    hostname: prom2teams
    container_name: monitoring_prom2teams
    restart: unless-stopped
    volumes:
      - ./prom2teams/config.ini:/opt/prom2teams/config.ini
      - ./prom2teams/template.j2:/opt/prom2teams/template.j2
    expose:
      - 8089
    labels:
      org.label-schema.group: "monitoring"
    networks:
      - default
 

@stale
Copy link

stale bot commented Nov 1, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Nov 1, 2022
@pierrediancourt
Copy link
Contributor

Up !
I had to go back to release 3.3.0 because of this issue :)

@abdennour
Copy link

Same issue in Openshift 4.x !
Please expedite reviewing #316

santi-eidu pushed a commit that referenced this issue Dec 7, 2022
@santi-eidu
Copy link
Contributor

New release 4.2.1 should fix the error.

@kevin-sedimentum
Copy link

Can confirm. This is fixed in version 4.2.1

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

No branches or pull requests

5 participants