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

Install on a container drops with errors: ERROR: For req: check-synology==1.0.0. #48

Open
linuxmail opened this issue Dec 4, 2022 · 2 comments

Comments

@linuxmail
Copy link

Hello,

I want to add the check on a container, based on Icinga/icinga2 image with something like this:

  • Dockerfile
FROM icinga/icinga2
ENV DEBIAN_FRONTEND=noninteractive
USER root
...
RUN apt install libcrypt-des-perl libdigest-hmac-perl python3 python3-pip netbase git -y
RUN pip install git+https://github.com/wernerfred/check_synology

but if gives me:

...
Building wheels for collected packages: check-synology
  Building wheel for check-synology (setup.py): started
  Building wheel for check-synology (setup.py): finished with status 'done'
  Created wheel for check-synology: filename=check_synology-1.0.0-py3-none-any.whl size=8176 sha256=f2f1cf3d04bd4484081d705530aed3cb0a0188667e1fca7fe46793d881267fd2
  Stored in directory: /tmp/pip-ephem-wheel-cache-nfvqtxp6/wheels/9e/5c/da/0bc31cf4a7ae73363ff391329abd3040ee651168e9307ddaa3
Successfully built check-synology
Installing collected packages: easysnmp, check-synology
ERROR: For req: check-synology==1.0.0. Invalid script entry point: <ExportEntry check_synology = check_synology:None []> - A callable suffix is required. Cf https://packaging.python.org/specifications/entry-points/#use-for-scripts for more information.
The command '/bin/sh -c pip install git+https://github.com/wernerfred/check_synology' returned a non-zero code: 1
...

it seems, that .. If I do this on an interactive shell .. the command itself works:

root@home:/# chmod +x  /usr/local/lib/python3.9/dist-packages/check_synology.py
root@home:/#   /usr/local/lib/python3.9/dist-packages/check_synology.py
usage: check_synology.py [-h] [-w W] [-c C] [-p PORT] [-t T] [-r R] hostname username authkey privkey {load,memory,disk,storage,update,status}
check_synology.py: error: the following arguments are required: hostname, username, authkey, privkey, mode

also, if I try to install v0.3.1

root@home:/# pip install git+https://github.com/wernerfred/[email protected]
Collecting git+https://github.com/wernerfred/[email protected]
  Cloning https://github.com/wernerfred/check_synology.git (to revision v0.3.1) to /tmp/pip-req-build-lyo9y90o
  Running command git clone -q https://github.com/wernerfred/check_synology.git /tmp/pip-req-build-lyo9y90o
  Running command git checkout -q 888097f25519f460d50b2a099d0e2a04827be527
    ERROR: Command errored out with exit status 1:
     command: /usr/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-lyo9y90o/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-lyo9y90o/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-hdyion9b
         cwd: /tmp/pip-req-build-lyo9y90o/
    Complete output (5 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/usr/lib/python3.9/tokenize.py", line 392, in open
        buffer = _builtin_open(filename, 'rb')
    FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pip-req-build-lyo9y90o/setup.py'
    ----------------------------------------
WARNING: Discarding git+https://github.com/wernerfred/[email protected]. Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

is there maybe something, I miss ?

cu denny

@HoRaX1804
Copy link

I have the same issue. Im running Icinga2 on an Ubuntu VM.

root@monitor:~# pip install git+https://github.com/wernerfred/check_synology Collecting git+https://github.com/wernerfred/check_synology Cloning https://github.com/wernerfred/check_synology to /tmp/pip-req-build-9fjfuili Running command git clone --filter=blob:none --quiet https://github.com/wernerfred/check_synology /tmp/pip-req-build-9fjfuili Resolved https://github.com/wernerfred/check_synology to commit d9029c7fe4e0408c7d31d1a8a32b9ec114e335ab Preparing metadata (setup.py) ... done Collecting easysnmp<1,>=0.2.6 Downloading easysnmp-0.2.6-cp310-cp310-manylinux_2_24_x86_64.whl (1.5 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.5/1.5 MB 863.4 kB/s eta 0:00:00 Building wheels for collected packages: check-synology Building wheel for check-synology (setup.py) ... done Created wheel for check-synology: filename=check_synology-1.0.0-py3-none-any.whl size=8190 sha256=d27a92d9c84faed67cdef5e27af7fbeaf8f1ce89ac7a03c3f2f6b799d3ce407f Stored in directory: /tmp/pip-ephem-wheel-cache-l4cy3dk7/wheels/bd/c6/dc/1a9de5574019dee3bc45c6089d41f1eec244754f10b69eedb6 Successfully built check-synology Installing collected packages: easysnmp, check-synology ERROR: For req: check-synology==1.0.0. Invalid script entry point: <ExportEntry check_synology = check_synology:None []> - A callable suffix is required. Cf https://packaging.python.org/specifications/entry-points/#use-for-scripts for more information.

tried like Denny did:

root@monitor:/usr/local/lib/python3.10/dist-packages# pip install git+https://github.com/wernerfred/[email protected] Collecting git+https://github.com/wernerfred/[email protected] Cloning https://github.com/wernerfred/check_synology.git (to revision v0.3.1) to /tmp/pip-req-build-tn62dtf4 Running command git clone --filter=blob:none --quiet https://github.com/wernerfred/check_synology.git /tmp/pip-req-build-tn62dtf4 Running command git checkout -q 888097f25519f460d50b2a099d0e2a04827be527 Resolved https://github.com/wernerfred/check_synology.git to commit 888097f25519f460d50b2a099d0e2a04827be527 ERROR: git+https://github.com/wernerfred/[email protected] does not appear to be a Python project: neither 'setup.py' nor 'pyproject.toml' found.

but on CLI it looks like it would work

root@monitor:/usr/local/lib/python3.10/dist-packages# ./check_synology.py usage: check_synology.py [-h] [-w W] [-c C] [-p PORT] [-t T] [-r R] hostname username authkey privkey {load,memory,disk,storage,update,status} check_synology.py: error: the following arguments are required: hostname, username, authkey, privkey, mode

Any Ideas?

Regards
Mario

@fibberblank
Copy link
Contributor

You need to update setup.py script.
Take a look at my pull request #49

Regards,
Jack

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

3 participants