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

Crash on debian, docker (probably AVX issue) #431

Closed
pacjo opened this issue Sep 7, 2022 · 12 comments
Closed

Crash on debian, docker (probably AVX issue) #431

pacjo opened this issue Sep 7, 2022 · 12 comments
Labels
bug Something isn't working

Comments

@pacjo
Copy link

pacjo commented Sep 7, 2022

I'm having trouble getting Mediatracker's docker container to work on my machine. Using latest doesn't provide any logs. Unstable (and the self built one) give llegal instruction and exit with code 132.

System info:
CPU: Core 2 Duo - E6750
OS: 5.10.120-1 (2022-06-09)

logs (unstable / self built):

PUID: 1000
PGID: 1000
Illegal instruction

PUID: 1000
PGID: 1000
Illegal instruction

(looping due to restart: unless-stopped)

compose:

version: "2.1"
services:
  mediatracker:
    image: bonukai/mediatracker:test
    container_name: mediatracker
    ports:
      - 7481:7481
    volumes:
      - /mnt/sdb1/docker/mediatracker/data:/storage
      - /mnt/sdb1/docker/mediatracker/assets:/assets
      - /mnt/sdb1/docker/mediatracker/logs:/logs
    environment:
      - PUID=1000
      - PGID=1000
#      - SERVER_LANG=en
#      - TMDB_LANG=en
#      - AUDIBLE_LANG=us
      - TZ=Europe/Warsaw
    restart: unless-stopped
@bonukai bonukai added the bug Something isn't working label Sep 7, 2022
@bonukai
Copy link
Owner

bonukai commented Sep 7, 2022

Yes, this is probably an issue with AVX instructions set. Here is a similar issue imgproxy/imgproxy#856. Could you try to install it without docker, with npm:

npm install -g mediatracker
mediatracker

to see, if it can work

@bonukai
Copy link
Owner

bonukai commented Sep 7, 2022

This is most likely caused by sharp, lovell/sharp#2723

@pacjo
Copy link
Author

pacjo commented Sep 7, 2022

Yes, this is probably an issue with AVX instructions set. Here is a similar issue imgproxy/imgproxy#856. Could you try to install it without docker, with npm:

Didn't help. It installed fine, but running mediatracker command gives Illegal Instruction

@pacjo pacjo changed the title Crash on debian, docker (porbably AVX issue) Crash on debian, docker (probably AVX issue) Sep 7, 2022
@bonukai
Copy link
Owner

bonukai commented Sep 7, 2022

Could you test if sharp@0.31.0 does work with this script

mkdir mediatracker-test
cd mediatracker-test
npm init -y
npm i sharp@0.31.0
node -e "const sharp = require('sharp'); sharp({ create: { width: 48, height: 48, channels: 4, background: { r: 255, g: 0, b: 0, alpha: 0.5 } } }) .png() .toBuffer()"

If not, then hopefully build libvips from source code should resolve this issue

@pacjo
Copy link
Author

pacjo commented Sep 7, 2022

It's the same

kamil@kronos:~/mediatester-test$ node -e "const sharp = require('sharp'); sharp({ create: { width: 48, height: 48, channels: 4, background: { r: 255, g: 0, b: 0, alpha: 0.5 } } }) .png() .toBuffer()"
Błędna instrukcja
kamil@kronos:~/mediatester-test$

@bonukai
Copy link
Owner

bonukai commented Sep 7, 2022

Could you try building libvips from source,

mkdir libvips-test
cd libvips-test

cat > Dockerfile <<- EOM
FROM node:17-alpine as libvips

WORKDIR /libvips
RUN apk add --no-cache meson gobject-introspection-dev wget g++ make expat-dev glib-dev python3 libwebp-dev jpeg-dev fftw-dev orc-dev libpng-dev tiff-dev lcms2-dev librsvg-dev libheif-dev
RUN wget https://github.com/libvips/libvips/releases/download/v8.13.1/vips-8.13.1.tar.gz
RUN tar xf vips-8.13.1.tar.gz
WORKDIR /libvips/vips-8.13.1
RUN meson setup build-dir
WORKDIR /libvips/vips-8.13.1/build-dir
RUN ninja
RUN ninja test
RUN ninja install

WORKDIR /app
RUN npm i sharp
EOM

docker build . -t libvips-test
docker run --rm libvips-test node -e "const sharp = require('sharp'); sharp({ create: { width: 48, height: 48, channels: 4, background: { r: 255, g: 0, b: 0, alpha: 0.5 } } }) .png() .toBuffer()"

@pacjo
Copy link
Author

pacjo commented Sep 7, 2022

doesn't throw an error now

kamil@kronos:~/libvips-test$ sudo docker run --rm libvips-test node -e "const sharp = require('sharp'); sharp({ create:
{ width: 48, height: 48, channels: 4, background: { r: 255, g: 0, b: 0, alpha: 0.5 } } }) .png() .toBuffer()"
kamil@kronos:~/libvips-test$

should there be no output?

@bonukai
Copy link
Owner

bonukai commented Sep 7, 2022

No, building libvips from source solves this issue. I am now working on a Dockerfile

@pacjo
Copy link
Author

pacjo commented Sep 8, 2022

Thanks! It's all working on 0.1.0-beta.35 (had to build myself). No more Illegal instruction in logs.

Should I close the issue, or is there more to do?

@bonukai
Copy link
Owner

bonukai commented Sep 8, 2022

Could you also try prebuild image from bonukai/mediatracker:0.1.0-beta.35, but I'm afraid it may not be working, and you will always have to build it yourself. If that's the case, you can replace image: bonukai/MediaTracker with build: https://github.com/bonukai/MediaTracker.git#main or build: https://github.com/bonukai/MediaTracker.git#v0.1.0-beta.35 for specific version, in your docker-compse.yaml

@pacjo
Copy link
Author

pacjo commented Sep 8, 2022

It's working just as well with the prebuilt one. Logs below

PUID: 1000
PGID: 1000
info:  Creating config directory at /home/abc/.mediatracker
info:  Running migrations
info:  Batch 1 run: 22 migrations
info:  20210818142342_init.js
info:  20220121025651_ratingColumnFloat.js
info:  20220122003141_bigIntToFloat.js
info:  20220127224112_configuration.js
info:  20220202231058_image.js
info:  20220208203349_traktId_goodreadsId.js
info:  20220208230635_numberOfPages.js
info:  20220208234441_watchlist.js
info:  20220209000937_seen.js
info:  20220209005700_list.js
info:  20220209014700_userPreferences.js
info:  20220209034100_userPreferences.js
info:  20220217012900_progress.js
info:  20220222153600_removeMetadataProviderCredentials.js
info:  20220222195700_audibleCountryCode.js
info:  20220310180600_userSlug.js
info:  20220312002700_mediaItemSlug.js
info:  20220317214800_tvdbIdTraktId.js
info:  20220404141200_seenDateToNull.js
info:  20220406165800_uniqueSeasonAndEpisodeNumbers.js
info:  20220427211100_list.js
info:  20220427212000_watchlistToList.js
info:  Server timezone: Europe/Warsaw
info:  Server time: 9/8/2022, 10:12:16 PM
info:  MediaTracker 0.1.0-beta.35 listening at http://d1e190552685:7481
info:  Updating metadata for 0 items
info:  Everything up to date
info:  Updating: Cosmos (last updated at: 9/8/2022, 10:13:17 PM)
--------------------------- (manual container restart from portainer's dashboard)
PUID: 1000
PGID: 1000
info:  Server timezone: Europe/Warsaw
info:  Server time: 9/8/2022, 10:13:47 PM
info:  MediaTracker 0.1.0-beta.35 listening at http://d1e190552685:7481
info:  Updating metadata for 1 item
info:  Everything up to date

@bonukai
Copy link
Owner

bonukai commented Sep 8, 2022

That's great :)

@bonukai bonukai closed this as completed Sep 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants