linuxserver / docker-netbox

GNU General Public License v3.0
84 stars 17 forks source link

Migrate from 3.1 to 3.2 error, pillow version not match #31

Closed Rogver closed 2 years ago

Rogver commented 2 years ago

linuxserver.io


Expected Behavior

auto migrate from 3.1 to 3.2

Current Behavior

Migrate raise error

/usr/lib/python3.9/site-packages/PIL/Image.py:153: RuntimeWarning: The _imaging extension was built for another version of Pillow or PIL:
Core version: 8.4.0
Pillow version: 9.1.0
  warnings.warn(str(v), RuntimeWarning)

Steps to Reproduce

  1. docker run netbox 3.1.11
  2. only change lscr.io/linuxserver/netbox:3.1.11 to lscr.io/linuxserver/netbox:3.2.0

when check python modules it show there are Pillow-8.4.0-py3.9.egg-info

root@5d2d24de674a:/# ls -al /usr/lib/python3.9/site-packages/ | grep Pillow
drwxr-xr-x   2 root root    4096 Apr  6 05:26 Pillow-8.4.0-py3.9.egg-info
drwxr-xr-x   2 root root    4096 Apr  6 05:27 Pillow-9.1.0.dist-info
drwxr-xr-x   2 root root    4096 Apr  6 05:27 Pillow.libs

after uninstall Pillow 8.4.0,then reinstall Pillow and restart netbox container everything is work again

root@5d2d24de674a:/# pip3 uninstall Pillow
Found existing installation: Pillow 8.4.0
Uninstalling Pillow-8.4.0:
  Would remove:
    /usr/lib/python3.9/site-packages/PIL
    /usr/lib/python3.9/site-packages/Pillow-8.4.0-py3.9.egg-info
Proceed (Y/n)? y
  Successfully uninstalled Pillow-8.4.0

Environment

OS: debian bullseye CPU architecture: x86_64 How docker service was installed: user portainer manage docker compse

Command used to create docker container (run/create/compose/screenshot)

Docker logs

dcim.DeviceType.rear_image: (fields.E210) Cannot use ImageField because Pillow is not installed.
    HINT: Get Pillow at https://pypi.org/project/Pillow/ or run command "python -m pip install Pillow".
extras.ImageAttachment.image: (fields.E210) Cannot use ImageField because Pillow is not installed.
    HINT: Get Pillow at https://pypi.org/project/Pillow/ or run command "python -m pip install Pillow".
Superuser creation skipped. Already exists.
[cont-init.d] 50-config: exited 0.
[cont-init.d] 90-custom-folders: executing... 
[cont-init.d] 90-custom-folders: exited 0.
[cont-init.d] 99-custom-files: executing... 
[custom-init] no custom files found exiting...
[cont-init.d] 99-custom-files: exited 0.
[cont-init.d] done.
[services.d] starting services
[uWSGI] getting INI configuration from uwsgi.ini
[uwsgi-static] added mapping for /static => static
*** Starting uWSGI 2.0.19.1 (64bit) on [Wed Apr  6 16:50:23 2022] ***
compiled with version: 10.3.1 20210921 on 05 April 2021 18:18:03
os: Linux-5.10.0-9-amd64 #1 SMP Debian 5.10.70-1 (2021-09-30)
nodename: 5d2d24de674a
machine: x86_64
clock source: unix
pcre jit disabled
detected number of CPU cores: 1
current working directory: /app/netbox/netbox
detected binary path: /usr/sbin/uwsgi
your memory page size is 4096 bytes
detected max file descriptor number: 1048576
building mime-types dictionary from file /etc/mime.types...1311 entry found
lock engine: pthread robust mutexes
thunder lock: disabled (you can enable it with --thunder-lock)
uwsgi socket 0 bound to TCP address :8000 fd 3
Python version: 3.9.7 (default, Nov 24 2021, 21:15:59)  [GCC 10.3.1 20211027]
[services.d] done.
Python main interpreter initialized at 0x7fc735f06bf0
python threads support enabled
your server socket listen backlog is limited to 100 connections
your mercy for graceful operations on workers is 60 seconds
mapped 145840 bytes (142 KB) for 1 cores
*** Operational MODE: single process ***
running "exec:/usr/bin/python3 ./manage.py collectstatic --noinput" (pre app)...

239 static files copied to '/app/netbox/netbox/static'.
running "exec:/usr/bin/python3 ./manage.py remove_stale_contenttypes --no-input" (pre app)...
/usr/lib/python3.9/site-packages/PIL/Image.py:153: RuntimeWarning: The _imaging extension was built for another version of Pillow or PIL:
Core version: 8.4.0
Pillow version: 9.1.0
  warnings.warn(str(v), RuntimeWarning)
/usr/lib/python3.9/site-packages/PIL/Image.py:153: RuntimeWarning: The _imaging extension was built for another version of Pillow or PIL:
Core version: 8.4.0
Pillow version: 9.1.0
  warnings.warn(str(v), RuntimeWarning)
/usr/lib/python3.9/site-packages/PIL/Image.py:153: RuntimeWarning: The _imaging extension was built for another version of Pillow or PIL:
Core version: 8.4.0
Pillow version: 9.1.0
  warnings.warn(str(v), RuntimeWarning)
SystemCheckError: System check identified some issues:

ERRORS:
dcim.DeviceType.front_image: (fields.E210) Cannot use ImageField because Pillow is not installed.
    HINT: Get Pillow at https://pypi.org/project/Pillow/ or run command "python -m pip install Pillow".
dcim.DeviceType.rear_image: (fields.E210) Cannot use ImageField because Pillow is not installed.
    HINT: Get Pillow at https://pypi.org/project/Pillow/ or run command "python -m pip install Pillow".
extras.ImageAttachment.image: (fields.E210) Cannot use ImageField because Pillow is not installed.
    HINT: Get Pillow at https://pypi.org/project/Pillow/ or run command "python -m pip install Pillow".
command "/usr/bin/python3 ./manage.py remove_stale_contenttypes --no-input" exited with non-zero code: 1
Wed Apr  6 16:50:42 2022 - FATAL hook failed, destroying instance
SIGINT/SIGQUIT received...killing workers...
WSGI app 0 (mountpoint='') ready in 5 seconds on interpreter 0x7fc735f06bf0 pid: 316 (default app)
*** uWSGI is running in multiple interpreter mode ***
spawned uWSGI master process (pid: 316)
spawned uWSGI worker 1 (pid: 334, cores: 1)
[uwsgi-daemons] spawning "/usr/bin/python3 ./manage.py rqworker" (uid: 1000 gid: 1000)
/usr/lib/python3.9/site-packages/PIL/Image.py:153: RuntimeWarning: The _imaging extension was built for another version of Pillow or PIL:
Core version: 8.4.0
Pillow version: 9.1.0
  warnings.warn(str(v), RuntimeWarning)
/usr/lib/python3.9/site-packages/PIL/Image.py:153: RuntimeWarning: The _imaging extension was built for another version of Pillow or PIL:
Core version: 8.4.0
Pillow version: 9.1.0
  warnings.warn(str(v), RuntimeWarning)
/usr/lib/python3.9/site-packages/PIL/Image.py:153: RuntimeWarning: The _imaging extension was built for another version of Pillow or PIL:
Core version: 8.4.0
Pillow version: 9.1.0
  warnings.warn(str(v), RuntimeWarning)
SystemCheckError: System check identified some issues:

ERRORS:
dcim.DeviceType.front_image: (fields.E210) Cannot use ImageField because Pillow is not installed.
    HINT: Get Pillow at https://pypi.org/project/Pillow/ or run command "python -m pip install Pillow".
dcim.DeviceType.rear_image: (fields.E210) Cannot use ImageField because Pillow is not installed.
    HINT: Get Pillow at https://pypi.org/project/Pillow/ or run command "python -m pip install Pillow".
extras.ImageAttachment.image: (fields.E210) Cannot use ImageField because Pillow is not installed.
    HINT: Get Pillow at https://pypi.org/project/Pillow/ or run command "python -m pip install Pillow".
daemon "/usr/bin/python3 ./manage.py rqworker" (pid: 335) annihilated
[pid: 334|app: 0|req: 1/1] 172.27.0.3 () {58 vars in 1062 bytes} [Wed Apr  6 08:53:09 2022] GET / => generated 2343 bytes in 4382 msecs (HTTP/1.1 500) 7 headers in 255 bytes (1 switches on core 0)
[pid: 334|app: -1|req: -1/2] 172.27.0.3 () {52 vars in 957 bytes} [Wed Apr  6 08:53:14 2022] GET /static/netbox-light.css => generated 232175 bytes in 2 msecs via sendfile() (HTTP/1.1 200) 3 headers in 113 bytes (1 switches on core 0)
Wed Apr  6 08:53:14 2022 - SIGPIPE: writing to a closed pipe/socket/fd (probably the client disconnected) on request /favicon.ico (ip 172.27.0.3) !!!
Wed Apr  6 08:53:14 2022 - uwsgi_response_write_body_do(): Broken pipe [core/writer.c line 341] during GET /favicon.ico (172.27.0.3)
OSError: write error
[pid: 334|app: 0|req: 2/3] 172.27.0.3 () {54 vars in 960 bytes} [Wed Apr  6 08:53:14 2022] GET /favicon.ico => generated 109803 bytes in 447 msecs (HTTP/1.1 404) 7 headers in 245 bytes (0 switches on core 0)
github-actions[bot] commented 2 years ago

Thanks for opening your first issue here! Be sure to follow the bug or feature issue templates!

jhueppauff commented 2 years ago

I am still seeing this issue with ghcr.io/linuxserver/netbox:3.2.1

ERRORS:
dcim.DeviceType.front_image: (fields.E210) Cannot use ImageField because Pillow is not installed.
    HINT: Get Pillow at https://pypi.org/project/Pillow/ or run command "python -m pip install Pillow".
dcim.DeviceType.rear_image: (fields.E210) Cannot use ImageField because Pillow is not installed.
    HINT: Get Pillow at https://pypi.org/project/Pillow/ or run command "python -m pip install Pillow".
extras.ImageAttachment.image: (fields.E210) Cannot use ImageField because Pillow is not installed.
    HINT: Get Pillow at https://pypi.org/project/Pillow/ or run command "python -m pip install Pillow".
daemon "/usr/bin/python3 ./manage.py rqworker" (pid: 347) annihilated