motioneye-project / motioneye

A web frontend for the motion daemon.
GNU General Public License v3.0
3.94k stars 650 forks source link

motioneye.service: Failed #2869

Open filippecha opened 10 months ago

filippecha commented 10 months ago

Hello, please advice for a beginner.

Raspberry zero W

after command "sudo service motioneye status" i get this error. Thanks for any advice advice.

`motioneye.service - motionEye Server Loaded: loaded (/etc/systemd/system/motioneye.service; enabled; vendor pre> Active: failed (Result: exit-code) since Sat 2023-11-04 15:52:27 CET; 1min> Process: 360 ExecStart=/usr/local/bin/meyectl startserver -c /etc/motioneye> Main PID: 360 (code=exited, status=255/EXCEPTION) CPU: 14.135s

lis 04 15:51:03 raspberrypi systemd[1]: Started motionEye Server. lis 04 15:52:23 raspberrypi meyectl[360]: configure_logging cmd motioneye: False lis 04 15:52:23 raspberrypi meyectl[360]: configure logging to file: None lis 04 15:52:24 raspberrypi meyectl[360]: INFO: hello! this is motionEye se> lis 04 15:52:24 raspberrypi meyectl[360]: CRITICAL: log directory "/var/log" do> lis 04 15:52:27 raspberrypi systemd[1]: motioneye.service: Main process exited,> lis 04 15:52:27 raspberrypi systemd[1]: motioneye.service: Failed with result '> lis 04 15:52:27 raspberrypi systemd[1]: motioneye.service: Consumed 14.135s CPU> lines 1-15/15 (END)...skipping...

lis 04 15:51:03 raspberrypi systemd[1]: Started motionEye Server. lis 04 15:52:23 raspberrypi meyectl[360]: configure_logging cmd motioneye: False lis 04 15:52:23 raspberrypi meyectl[360]: configure logging to file: None lis 04 15:52:24 raspberrypi meyectl[360]: INFO: hello! this is motionEye server 0.43.0 lis 04 15:52:24 raspberrypi meyectl[360]: CRITICAL: log directory "/var/log" does not exist or is not writable lis 04 15:52:27 raspberrypi systemd[1]: motioneye.service: Main process exited, code=exited, status=255/EXCEPTION lis 04 15:52:27 raspberrypi systemd[1]: motioneye.service: Failed with result 'exit-code'. lis 04 15:52:27 raspberrypi systemd[1]: motioneye.service: Consumed 14.135s CPU time. ~ `

zagrim commented 10 months ago

This: CRITICAL: log directory "/var/log" does not exist or is not writable How are the permissions set for /var/log? Please try with ls -dl /var/log and post the output.

Also, what value, if any, do you have set for log_path on /etc/motioneye/motioneye.conf?

patrick-GH commented 10 months ago

Hello, I'm having the same issue as well after switching to dev branch log_path: '/var/log`

On a new install with dev branch it's now: /var/log/motion 'drwxr-xr-x 8 root root 4.0K Nov 8 14:56 log'

I'm getting a different error now though

meyectl[331]: sock.bind(sockaddr) meyectl[331]: PermissionError: [Errno 13] Permission denied meyectl[331]: Exception ignored in: <function Pool.del at 0xb32ecc40> meyectl[331]: Traceback (most recent call last): meyectl[331]: File "/usr/lib/python3.9/multiprocessing/pool.py", line 268, in del meyectl[331]: File "/usr/lib/python3.9/multiprocessing/queues.py", line 372, in put meyectl[331]: AttributeError: 'NoneType' object has no attribute 'dumps' systemd[1]: motioneye.service: Main process exited, code=exited, status=1/FAILURE

zagrim commented 10 months ago

Well, MotionEye needs to be allowed to write to the logging directory whatever it is. Earlier ME ran as root, but the systemd service installed by default by motioneye_init on systems that have systemd runs ME as user "motion", so for in an upgrade over existing setup one needs to 1) Change the log_path on /etc/motioneye/motioneye.conf to not be /var/log (since that needs to be owned by root user), the default for new installs is /var/log/motioneye so that's probably a good choice. If it already was something like /var/log/motion there's probably no need to change it. 2) If you changed the log_path, create the new log directory with sudo mkdir /var/log/motioneye (substitute your choice of directory if needed). 3) Assign the ownership of logging directory to "motion" user with sudo chown motion /var/log/motioneye (substitute your choice of directory if needed).

For a new install I would assume permissions be ok (please inform me if it is not the case), but if they are not, the command in the third step above should fix it.