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

Build fails with apt-get not found #34

Closed
ridizy opened this issue Feb 16, 2022 · 18 comments
Closed

Build fails with apt-get not found #34

ridizy opened this issue Feb 16, 2022 · 18 comments

Comments

@ridizy
Copy link

ridizy commented Feb 16, 2022

Docker compose file contains:

    build:
      context: https://github.com/mdhiggins/radarr-sma.git#build
      args:
        - radarr_tag=nightly
        - ffmpeg_tag=snapshot-vaapi

Get the following error on docker-compose build

Step 11/17 : RUN   apt-get update &&   apt-get install -y     git     wget     python3     python3-pip     ${extra_packages} &&   mkdir ${SMA_PATH} &&   git clone https://github.com/mdhiggins/sickbeard_mp4_automator.git ${SMA_PATH} &&   python3 -m pip install --user --upgrade pip &&   python3 -m pip install --user virtualenv &&   python3 -m virtualenv ${SMA_PATH}/venv &&   ${SMA_PATH}/venv/bin/pip install -r ${SMA_PATH}/setup/requirements.txt &&   chgrp users /usr/local/bin/ffmpeg &&   chgrp users /usr/local/bin/ffprobe &&   chmod g+x /usr/local/bin/ffmpeg &&   chmod g+x /usr/local/bin/ffprobe &&   apt-get purge --auto-remove -y &&   apt-get clean &&   rm -rf     /tmp/*     /var/lib/apt/lists/*     /var/tmp/*
 ---> Running in 42f3bb45e964
/bin/sh: apt-get: not found

LinuxServer.io rebased the nightly tag to Alpine: https://info.linuxserver.io/issues/2022-02-03-radarr/

Can this be accounted for in your dockerfile?

@mdhiggins
Copy link
Owner

I will probably need to make a separate build container for alpine, I did already update the nightly tag for alpine but the dockerfile can't handle the conditionals

I'll see if I can come up with something

@ridizy
Copy link
Author

ridizy commented Feb 16, 2022

Thank you. Looks like they are rebasing a few containers to Alpine: https://info.linuxserver.io/affected/notifications/

Not sure if this will eventually apply to other tags as well, or if it's just being done for space efficiency with the nightly builds.

@mdhiggins
Copy link
Owner

mdhiggins commented Feb 16, 2022

Just pushed an update, I already had accounted for most of this in the 90-sma-config file when I made the sma-mod so since the build dockerfile can be alpine or ubuntu I just removed most of the packages from that and will let 90-sma-config do the work

Only thing I wasn't sure of is if alpine has an equivalent package to libva-drm2 as I couldn't find one (libva2 -> libva and i965-va-driver -> libva-intel-driver)

Let me know if that works

@ridizy
Copy link
Author

ridizy commented Feb 16, 2022

Thanks again. Build works now. Will have to wait for the next grab to see how the tag/conversion goes.

@mdhiggins
Copy link
Owner

Double check your docker logs when starting the container for the first time for any errors (from 90-sma-config) since I moved most of the container setup to occur on the first launch and they might be hiding in there and not immediately apparent

@ridizy
Copy link
Author

ridizy commented Feb 16, 2022

Here's what I found...

ERROR: unable to select packages:
[90-sma-config] Installing additional hardware acceleration packages
chown: changing ownership of '/usr/local/sma/config/autoProcess.ini.bak': Operation not permitted
<<--above error repeated for every file in the directory-->>
Traceback (most recent call last):
  File "/usr/local/sma/update.py", line 8, in <module>
    from resources.readsettings import ReadSettings
ModuleNotFoundError: No module named 'resources'

I think I've always had the chown errors but it's worked fine. Not sure about the other errors

@mdhiggins
Copy link
Owner

Looks like it isn't doing the initial git pull, script won't work

Made a tweak, try the latest update (the permissions error looks like you have a .bak file that it cannot access, you could probably fix the ownership on that .bak or move it out of your mounted directory to make that go away)

433e2b5

@ridizy
Copy link
Author

ridizy commented Feb 16, 2022

Now getting this:

ERROR: unable to select packages:
[90-sma-config] Installing additional hardware acceleration packages
[90-sma-config] Pulling SMA from github master
./90-sma-config: line 55: git: command not found
<<-- my perms errors -->>
Traceback (most recent call last):
  File "/usr/local/sma/update.py", line 8, in <module>
    from resources.readsettings import ReadSettings
ModuleNotFoundError: No module named 'resources'

@mdhiggins
Copy link
Owner

mdhiggins commented Feb 16, 2022

Alright I spun up a test container and think I have everything sorted now, try one more time

The from resources.readsettings import ReadSettings error comes from the main part of the script not being pulled from github (update.py comes from the docker container) so hopefully that's fixed now

@ridizy
Copy link
Author

ridizy commented Feb 16, 2022

Looking pretty good now...

[cont-init.d] 10-adduser: exited 0.
[cont-init.d] 30-config: executing... 
[cont-init.d] 30-config: exited 0.
[cont-init.d] 50-gid-video: executing... 
groupadd: 'videozb2Z7vzD' is not a valid group name
groupmod: group 'videozb2Z7vzD' does not exist
usermod: group 'videozb2Z7vzD' does not exist
groupadd: 'videoiYiboXEP' is not a valid group name
groupmod: group 'videoiYiboXEP' does not exist
usermod: group 'videoiYiboXEP' does not exist
[cont-init.d] 50-gid-video: exited 0.
[cont-init.d] 90-custom-folders: executing... 
[cont-init.d] 90-custom-folders: exited 0.
[cont-init.d] 90-sma-config: executing... 
[90-sma-config] Init SMA from github master
[90-sma-config] Creating python virtual environment and installing requirements
[cont-init.d] 90-sma-config: 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
[services.d] done.
[Info] Bootstrap: Starting Radarr - /app/radarr/bin/Radarr - Version 4.0.5.5923 

@mdhiggins
Copy link
Owner

Sweet, alright the build container should be universal now alpine or ubuntu, thanks for the tests

Closing this out reopen if you have any issues

@ridizy
Copy link
Author

ridizy commented Feb 16, 2022

[don't have rights to reopen]

The conversion is failing. Here is the log file...

2022-02-16 14:24:24 - RadarrPostProcess - INFO - Radarr extra script post processing started.
2022-02-16 14:24:24 - resources.readsettings - INFO - /usr/local/sma/venv/bin/python3
2022-02-16 14:24:24 - resources.readsettings - INFO - Loading config file /usr/local/sma/config/
autoProcess.ini.
2022-02-16 14:24:24 - resources.mediaprocessor - ERROR - isValidSource unexpectedly threw an exc
eption, returning None.
Traceback (most recent call last):
  File "/usr/local/sma/resources/mediaprocessor.py", line 318, in isValidSource
    info = self.converter.probe(inputfile)
  File "/usr/local/sma/converter/__init__.py", line 336, in probe
    return self.ffmpeg.probe(fname, posters_as_video)
  File "/usr/local/sma/converter/ffmpeg.py", line 587, in probe
    stdout_data = self._get_stdout([
  File "/usr/local/sma/converter/ffmpeg.py", line 537, in _get_stdout
    p = self._spawn(cmds)
  File "/usr/local/sma/converter/ffmpeg.py", line 530, in _spawn
    return Popen(cmds, shell=False, stdin=PIPE, stdout=PIPE, stderr=PIPE,
  File "/usr/lib/python3.9/subprocess.py", line 951, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.9/subprocess.py", line 1821, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: '/usr/local/bin/ffprobe'
2022-02-16 14:24:24 - resources.mediaprocessor - INFO - File /videos/Movies/SomeFile (2022)/SomeFile
 (2022).mkv is not valid
2022-02-16 14:24:24 - RadarrPostProcess - INFO - Processing returned False.
2022-02-16 14:24:24 - RadarrPostProcess - ERROR - Error processing file.
Traceback (most recent call last):
  File "/usr/local/sma/postRadarr.py", line 301, in <module>
    sys.exit(1)
SystemExit: 1

ffprobe is there but gives an error when you try to execute it:

root@50ce4818a9ca:/root# ls -l /usr/local/bin/ffprobe
-rwxr-xr-x 1 root users 133768 Apr 12  2021 /usr/local/bin/ffprobe
root@50ce4818a9ca:/root# /usr/local/bin/ffprobe
bash: /usr/local/bin/ffprobe: No such file or directory

If I switch the ffmpeg tag to ffmpeg_tag=snapshot-alpine, I get a little further, but still not looking great (not to mention I think no VAAPI). Probably related to your earlier comment.

Error loading shared library libgomp.so.1: No such file or directory (needed by /usr/local/lib/libvidstab.so.1.1)
Error relocating /usr/local/lib/libvidstab.so.1.1: omp_get_num_threads: symbol not found
Error relocating /usr/local/lib/libvidstab.so.1.1: omp_get_thread_num: symbol not found
Error relocating /usr/local/lib/libvidstab.so.1.1: omp_set_num_threads: symbol not found
Error relocating /usr/local/lib/libvidstab.so.1.1: GOMP_parallel: symbol not found
Error relocating /usr/local/lib/libvidstab.so.1.1: GOMP_critical_name_start: symbol not found
Error relocating /usr/local/lib/libvidstab.so.1.1: GOMP_critical_name_end: symbol not found
Error relocating /usr/local/lib/libvidstab.so.1.1: omp_get_max_threads: symbol not found

@mdhiggins mdhiggins reopened this Feb 17, 2022
@mdhiggins
Copy link
Owner

mdhiggins commented Feb 17, 2022

Yeah looks like the FFMPEG build from the ubuntu containers does not work on alpine and the jrottenberg container only goes up to alpine 313 (linuxserver radarr container on 315)

The ffmpeg APK included in alpine however appears to contain VAAPI so I added some new options and this appears to be working for me. You'll need to include your hw devices and volumes etc but that's the environment variables needed

  radarr:
    image: ghcr.io/mdhiggins/radarr-sma:nightly
    container_name: radarr
    environment:
      - PUID=${PUID}
      - PGIG=${PGID}
      - TZ=${TZ}
      - SMA_USE_REPO=true
      - SMA_HWACCEL=true

7f36952

Update: SMA_USE_REPO defaults to true on nightly, can leave that out on latest build

@ridizy
Copy link
Author

ridizy commented Feb 17, 2022

Thank you. Rebuilt container and will test with a file later.

@ridizy
Copy link
Author

ridizy commented Feb 19, 2022

So the conversion and tagging worked, but the rename failed:

2022-02-19 07:54:22 - RadarrPostProcess - ERROR - Failed to trigger Radarr renam
e.
Traceback (most recent call last):
  File "/usr/local/sma/venv/lib/python3.9/site-packages/requests/models.py", lin
e 910, in json
    return complexjson.loads(self.text, **kwargs)
  File "/usr/lib/python3.9/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python3.9/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python3.9/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/sma/postRadarr.py", line 288, in <module>
    rename = renameRequest(baseURL, headers, movieinfo['movieFile']['id'], movie
id, log)
  File "/usr/local/sma/postRadarr.py", line 56, in renameRequest
    rstate = r.json()
  File "/usr/local/sma/venv/lib/python3.9/site-packages/requests/models.py", lin
e 917, in json
    raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: [Errno Expecting value] : 0

However, the file is named correctly. Side note, I have force-rename set to false.

@mdhiggins
Copy link
Owner

Hm it almost looks like the API just failed to return anything. Is it doing this for every file or was this a one off error?

If it's doing it for every file could you turn on debug logging and send a full log from postRadarr

@ridizy
Copy link
Author

ridizy commented Feb 20, 2022

Looks like every file.

Here's a debug log: https://pastebin.com/bx3xhZwk

@mdhiggins
Copy link
Owner

Fixed in latest version of SMA

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

2 participants