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

Add support of Ubuntu 23+, Debian 12 #683

Merged
merged 25 commits into from
Jul 10, 2024

Conversation

andrey-utkin
Copy link
Contributor

@andrey-utkin andrey-utkin commented Jun 28, 2024

FFmpeg is updated to 6.1.1 to resolve compilation failure.
It bails out gracefully of installing pip and certbot from pip, which failed and which is heavily discouraged by distro maintainers. Speaking frankly, I'd rather leave certbot (and other external packages) workability in responsibility of distro maintainers, and support customers having problems with it they can't resolve themselves.
Was tested on Ubuntu 24.04 and Debian 12, compilation and installation passed, tests seemed to work.

andrey-utkin and others added 14 commits June 28, 2024 16:01
On Ubuntu 23.10, FFmpeg won't build due to the issue which is now solved
in upstream FFmpeg, see
https://trac.ffmpeg.org/ticket/10405
https://git.ffmpeg.org/gitweb/ffmpeg.git/commit/effadce6c756247ea8bae32dc13bb3e6f464f0eb
lavf_device.cpp: In member function 'virtual int lavf_device::start()':
lavf_device.cpp:102:49: error: invalid conversion from 'const AVInputFormat*' to 'AVInputFormat*' [-fpermissive]
  102 |                 input_fmt = av_find_input_format("mjpeg");
      |                             ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~
      |                                                 |
      |                                                 const AVInputFormat*
media_writer.cpp: In member function 'int media_writer::open(const string&, const stream_properties&)':
media_writer.cpp:281:50: error: invalid conversion from 'const AVOutputFormat*' to 'AVOutputFormat*' [-fpermissive]
  281 |         AVOutputFormat *fmt_out = av_guess_format("mp4", NULL, "video/mp4");
      |                                   ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                                  |
      |                                                  const AVOutputFormat*
It's not obvious that this hack is still in use.
Muxing without reencoding should be possible with current ffmpeg API so
the original explanation is moot.
This API was obsoleted and doesn't exist anymore:

2017-12-26 - a04c2c707d - lavc 58.9.100 - avcodec.h
  Deprecate av_lockmgr_register(). You need to build FFmpeg with threading
  support enabled to get basic thread-safety (which is the default build
  configuration).
@andrey-utkin andrey-utkin requested a review from curtishall June 28, 2024 15:22
Because of this warning which is shown at build time:

WARNING: Disabled https_protocol because some selected dependency is unsatisfied: tls_protocol
Because it makes apt update fail:

+ apt -y update
...
Hit:10 http://archive.ubuntu.com/ubuntu mantic-updates InRelease
Ign:11 https://ppa.launchpadcontent.net/ondrej/php/ubuntu mantic InRelease
Err:12 https://ppa.launchpadcontent.net/ondrej/php/ubuntu mantic Release
  404  Not Found [IP: 185.125.190.80 443]
Reading package lists... Done
E: The repository 'https://ppa.launchpadcontent.net/ondrej/php/ubuntu mantic Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
It is preferable to not have to add such a file for every distro - a lot
of work and risk of manual error.

Encountered this error while testing Ubuntu 23.10 (Mantic).

Setting up nginx (1.24.0-1ubuntu1) ...
Job for nginx.service failed because the control process exited with error code.
See "systemctl status nginx.service" and "journalctl -xeu nginx.service" for details.
invoke-rc.d: initscript nginx, action "start" failed.
× nginx.service - A high performance web server and a reverse proxy server
     Loaded: loaded (/lib/systemd/system/nginx.service; enabled; preset: enabled)
     Active: failed (Result: exit-code) since Mon 2024-07-01 01:10:56 UTC; 8ms ago
       Docs: man:nginx(8)
    Process: 12474 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=1/FAILURE)
	CPU: 5ms

Jul 01 01:10:56 ubuntu-23-10-p systemd[1]: Starting nginx.service - A high performance web server and a reverse proxy server...
Jul 01 01:10:56 ubuntu-23-10-p nginx[12474]: 2024/07/01 01:10:56 [emerg] 12474#12474: open() "/usr/share/bluecherry/nginx-includes/mantic.conf" failed (2: No such file or directory) in /etc/nginx/sites-enabled/bluecherry.conf:12
Jul 01 01:10:56 ubuntu-23-10-p nginx[12474]: nginx: configuration file /etc/nginx/nginx.conf test failed
Jul 01 01:10:56 ubuntu-23-10-p systemd[1]: nginx.service: Control process exited, code=exited, status=1/FAILURE
Jul 01 01:10:56 ubuntu-23-10-p systemd[1]: nginx.service: Failed with result 'exit-code'.
Jul 01 01:10:56 ubuntu-23-10-p systemd[1]: Failed to start nginx.service - A high performance web server and a reverse proxy server.
dpkg: error processing package nginx (--configure):
 installed nginx package post-installation script subprocess returned error exit status 1

...

dpkg: dependency problems prevent configuration of bluecherry:
 bluecherry depends on nginx; however:
  Package nginx is not configured yet.

dpkg: error processing package bluecherry (--configure):
 dependency problems - leaving unconfigured
On Debian 10, using our installer, `apt install bluecherry` step fails.
We still want a recent certbot on Debian 10, not the extra-old deb-packaged one.

++ wget --output-document=/tmp/get-pip.py https://bootstrap.pypa.io/get-pip.py
--2024-07-05 09:34:20--  https://bootstrap.pypa.io/get-pip.py
Resolving bootstrap.pypa.io (bootstrap.pypa.io)... 199.232.72.175, 2a04:4e42:52::175
Connecting to bootstrap.pypa.io (bootstrap.pypa.io)|199.232.72.175|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2277800 (2.2M) [text/x-python]
Saving to: ‘/tmp/get-pip.py’

/tmp/get-pip.py                         100%[==============================================================================>]   2.17M  --.-KB/s    in 0.06s

2024-07-05 09:34:20 (34.0 MB/s) - ‘/tmp/get-pip.py’ saved [2277800/2277800]

++ python3 /tmp/get-pip.py
ERROR: This script does not work on Python 3.7. The minimum supported Python version is 3.8. Please use https://bootstrap.pypa.io/pip/3.7/get-pip.py instead.
++ return
dpkg: error processing package bluecherry (--configure):
 installed bluecherry package post-installation script subprocess returned error exit status 1
Processing triggers for libc-bin (2.28-10+deb10u4) ...
Errors were encountered while processing:
 bluecherry
E: Sub-process /usr/bin/dpkg returned an error code (1)
We do supply lacking "alternatives" link in /run/php/, but /run is
ephemeral mount so the link has to be installed on every system startup,
which is cumbersome.
Fixed the condition (was test -f, now test -L), made the wildcard more
specific just in case.

++ [[ -f /run/php/php-fpm.sock ]]
++ update-alternatives --install /run/php/php-fpm.sock php-fpm.sock /run/php/php-fpm.sock /run/php/php7.4-fpm.sock 0
update-alternatives: <link> and <path> can't be the same

Use 'update-alternatives --help' for program usage information.
dpkg: error processing package bluecherry (--configure):
 installed bluecherry package post-installation script subprocess returned error exit status 2
Setting up libcgi-fast-perl (1:2.15-1) ...
Processing triggers for rsyslog (8.2112.0-2ubuntu2.2) ...
Processing triggers for libc-bin (2.35-0ubuntu3.8) ...
Errors were encountered while processing:
 bluecherry
E: Sub-process /usr/bin/dpkg returned an error code (1)
Was:

 bluecherrydvr#4 {main}                                                                                                                                                                                                              thrown in /usr/share/bluecherry/www/lib/lib.php on line 883" while reading response header from upstream, client: 192.168.86.151, server: , request: "POST /discover-cameras/add HTTP/1.1", upstream: "fastcgi://unix:/etc/alternatives/php-fpm.sock:", host: "192.168.86.115:7001"
 2024/07/10 19:10:06 [error] 279#279: *15 FastCGI sent in stderr: "
PHP message: PHP Warning:  Undefined array key "query" in /usr/share/bluecherry/www/ajax/discoverCameras.php on line 362;
PHP message: PHP Fatal error:  Uncaught Error: Non-static method ipCamera::checkLimitDevices() cannot be called statically in /usr/share/bluecherry/www/lib/lib.php:883
 Stack trace:
 #0 /usr/share/bluecherry/www/ajax/discoverCameras.php(381): ipCamera::create()
 bluecherrydvr#1 /usr/share/bluecherry/www/lib/Controller.php(119): discoverCameras->postAdd()
 bluecherrydvr#2 /usr/share/bluecherry/www/lib/Route.php(75): Controller->start()                                                                                                                                                  bluecherrydvr#3 /usr/share/bluecherry/www/index.php(16): Route->start()
 bluecherrydvr#4 {main}                                                                                                                                                                                                              thrown in /usr/share/bluecherry/www/lib/lib.php on line 883" while reading response header from upstream, client: 192.168.86.151, server: , request: "POST /discover-cameras/add HTTP/1.1", upstream: "fastcgi://unix:/etc/alternatives/php-fpm.sock:", host: "192.168.86.115:7001"

Became:

 2024/07/10 19:20:18 [error] 281#281: *21 FastCGI sent in stderr: "
PHP message: PHP Warning:  Undefined array key "query" in /usr/share/bluecherry/www/ajax/discoverCameras.php on line 362;
PHP message: PHP Warning:  Undefined array key "hls_segment_duration" in /usr/share/bluecherry/www/lib/lib.php on line 855;
PHP message: PHP Warning:  Undefined array key "hls_segment_size" in /usr/share/bluecherry/www/lib/lib.php on line 856;
PHP message: PHP Warning:  Trying to access array offset on value of type bool in /usr/share/bluecherry/www/lib/lib.php on line 861;
PHP message: PHP Warning:  Trying to access array offset on value of type null in /usr/share/bluecherry/www/lib/lib.php on line 861" while reading response header from upstream, client: 192.168.86.151, server: , request: "POST /discover-cameras/add HTTP/1.1", upstream: "fastcgi://unix:/etc/alternatives/php-fpm.sock:", host: "192.168.86.115:7001"

Both were processed with %s/PHP message:/^M&/g
@andrey-utkin andrey-utkin merged commit cab3f77 into bluecherrydvr:master Jul 10, 2024
2 checks passed
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

Successfully merging this pull request may close these issues.

2 participants