Motion-Project / motionplus

MotionPlus Home Page: https://motion-project.github.io/
GNU General Public License v3.0
293 stars 38 forks source link

cannot open shared object file: Libcamera.so.0.0.4 not found #84

Closed oave closed 1 year ago

oave commented 1 year ago

Did you read the guide?

Yes

What is the base version number of MotionPlus being used?

0.1.x

What was the install method?

Installed via package tool

What is base architecture?

ARM-64bit

What is the distro being used?

Raspbian

Disto version number

Bullseye

Camera/Sound type(s) being used?

PI cam via libcamerify, PI camera via libcam

Describe the issue/problem and steps to reproduce

I have Motionplus installed on a raspberrypi 3B+ (bullseye). Installed via .deb (bullseye_motionplus_0.1.1-1_arm64.deb) Since yesterday motionplus has stopped working, it stops before any log is saved. What i have tried: $ sudo service motionplus start $ sudo service motionplus status

I got: motionplus.service - MotionPlus - Enhanced security camera monitoring software. Loaded: loaded (/lib/systemd/system/motionplus.service; enabled; vendor preset: enabled) Active: activating (auto-restart) (Result: exit-code) since Wed 2023-07-19 15:35:08 CEST; 3s ago Docs: man:motionplus(1) Process: 5220 ExecStartPre=/bin/mkdir -p /var/log/motionplus (code=exited, status=0/SUCCESS) Process: 5221 ExecStartPre=/bin/chown motion:adm /var/log/motionplus (code=exited, status=0/SUCCESS) Process: 5222 ExecStart=/usr/bin/motionplus (code=exited, status=127) Main PID: 5222 (code=exited, status=127) CPU: 55ms

I tried: $ libcamerify motionplus

I got motionplus: error while loading shared libraries: libcamera.so.0.0.4: cannot open shared object file: No such file or directory

Indeed libcamera.so.0.0.4 does not exist, instead I found libcamera.so.0.0.5. As it was working perfectly last week I guess that libcamera got updated and replace libcamera.so.0.0.4 by libcamera.so.0.0.5.

I thought that creating symbolic links could solve the problem but it doesn't. It bypass the "not such file or directory" issue but Motionplus still does not run correctly.

Relevant MotionPlus log output (at log_level 8)

Motionplus stops working before any log is generated
Mr-Dave commented 1 year ago

I was able to reproduce this but it seems to be caused by an upstream revision. Once Motionplus is recompiled and reinstalled, things seem to work fine.

Copying @kbingham for visibility.

kbingham commented 1 year ago

If raspberry pi os updates libcamera to a newer soname version, then indeed motion would need to be rebuilt against the new soname. What's happened here I think is that perhaps someone has self compiled motion, and then raspberry pi os has removed the version of libcamera that it was compiled against. They could keep the old versions, or libcamera would need to be recompiled. Alternatively - motionplus could be packaged by debian/raspberrypiOS and then when libcamera is updated, the associated updated packages would be provided too.

libcamera has now moved to the v0.1.0 series where the soname will only be updated when an ABI breakage occurs on the development branch. This should reduce (but not prevent) this issue from occuring in the future until it gets a stable API/ABI. Once we declare a stable API we will move to v1.x releases.

oave commented 1 year ago

I see that there is a hyperlink call libcamera.so.0.0 pointing to libcamera.so.0.0.x. is not possible to force motionplus to look for libcamera.so.0.0 instead of libcamera.so.0.0.x. ? such to avoid to recompile motionplus each time libcamera share is renamed ?

kbingham commented 1 year ago

Those renames are the effect of the soname change. They represent implementations of the library which are binary compatible, and where it is compatible without a recompile the links will point correctly. If the links change - then it absolutely requires a recompile of motionplus.

oave commented 1 year ago

Got it, Thank you !

rhk commented 1 year ago

Bumped into the same on Raspberry, first time trying Motionplus (have been using motion for quite some years)

rhk@mycabin:~ $ lsb_release -a No LSB modules are available. Distributor ID: Raspbian Description: Raspbian GNU/Linux 11 (bullseye) Release: 11 Codename: bullseye

Installed pi_bullseye_motionplus_0.1.1-1_armhf.deb from website.

rhk@mycabin:~ $ motionplus motionplus: error while loading shared libraries: libcamera.so.0.0.4: cannot open shared object file: No such file or directory

(didn't now know how to check libcamera version)

Could someone elaborate, what should a 'normal' user do? Wait for a new build of motionplus to appear on the website or wait for motionplus to be packaged for debian/raspbian - and use motion while waiting?

Mr-Dave commented 1 year ago

I'm locking this issue from further comments. Use the discussion section/page of this for further comments.