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

Volume Mounting Issue: Unable to Access import_logs.py from Python Container #163

Open
3 tasks done
WeLoTech opened this issue Oct 13, 2024 · 0 comments
Open
3 tasks done

Comments

@WeLoTech
Copy link

Support guidelines

I've found a bug and checked that ...

  • ... the documentation does not mention anything about my problem
  • ... there are no open or closed issues that are related to my problem

Description

I am experiencing an issue where the import_logs.py script, which is present in the Matomo container, is not accessible when attempting to mount the volume in a separate python:3-alpine container. The script is located at /var/www/matomo/misc/log-analytics/import_logs.py within the Matomo container.

Original container instructions
https://hub.docker.com/_/matomo
docker run --rm --volumes-from="matomo-app-1" --link matomo-app-1 python:3-alpine python /var/www/html/misc/log-analytics/import_logs.py --url=http://ip.of.your.matomo.example --login=yourlogin --password=yourpassword --idsite=1 --recorders=4 /var/www/html/logs/access.log

Expected behaviour

The import_logs.py script should be accessible from the python:3-alpine container.

docker run --rm --volumes-from="matomo-matomo-1" --link matomo-matomo-1 python:3-alpine python /var/www/matomo/misc/log-analytics/import_logs.py --url=http://ip.of.your.matomo.example --login=yourlogin --password=yourpassword --idsite=1 --recorders=4 /var/www/html/logs/access.log

Actual behaviour

The import_logs.py script is not found in the expected directory when the volume is mounted in the python:3-alpine container.

Also not in /data/misc

Steps to reproduce

  1. run the docker compose.yml
  2. docker exec -it matomo-matomo-1 sh -c "ls /var/www/matomo/misc/log-analytics/" , confirm script exists
  3. docker run --rm -v matomo_matomo:/data -it python:3-alpine sh
  4. cd /data/www/matomo/misc/log-analytics ls
  5. Observe that the import_logs.py script is not present.

Docker info

Version:    24.0.5
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.11.2
    Path:     /usr/libexec/docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v2.20.2
    Path:     /usr/libexec/docker/cli-plugins/docker-compose

Server:
 Containers: 6
  Running: 5
  Paused: 0
  Stopped: 1
 Images: 11
 Server Version: 24.0.5
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Using metacopy: false
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: systemd
 Cgroup Version: 2
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: X
 runc version: v1.1.8-0-g82f18fe
 init version: de40ad0
 Security Options:
  apparmor
  seccomp
   Profile: builtin
  cgroupns
 Kernel Version: 5.15.0-122-generic
 Operating System: Ubuntu 22.04.3 LTS
 OSType: linux
 Architecture: x86_64
 CPUs: 2
 Total Memory: 3.727GiB
 Name: Y
 ID: Z
 Docker Root Dir: /mnt/external_volume/docker-data/docker
 Debug Mode: false
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

Docker Compose config

No response

Logs

n/a

Additional info

Would be great to have add in the readme how to run import logs!

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

No branches or pull requests

1 participant