Mailing List Archive

Mythzmserver doesn't start: "This version of ZM is to old you need 1.24.0 or later ''"
Hello everyone,

Running

MythTV 30.0+fixes20210328.git7d297b1fb8-dm from deb-multimedia, on Debian
10.9 (stable) totally up-to-date.
Mythzoneminder 1:30.0+fixes20200514.gitc6b20b072e- also from deb-multimetia.
Zoneminder 2:1.32.3-dmo4+deb10v2

As is obvious, the error message:

"This version of ZM is to old you need 1.24.0 or later ''"

is not true since I'm running 1.32. Additioanlly, mythzmserver also
looks for the zm configuration in /etc/zm.conf. In Debian it is in
/etc/zm/zm.conf so I had to attempt to start mythzmserver like this:

$ sudo mythzmserver -c /etc/zm/zm.conf
loading zm config from /etc/zm/zm.conf
This version of ZM is to old you need 1.24.0 or later ''

This happens whether zoneminder is running or not.

Mythtv has been running just fine in other respects. Before I set up
zoneminder, going to the zoneminder page in mythtv did nothing. After I
changed the location from 127.0.0.1 to localhost there is a brief pop-up
on front-end startup that says: "Can't connect to the mythzmserver".
Zoneminder works fine from the web browser. I have changed nothing in
the default configuration of zoneminder.

Any ideas as to why mythzmserver is failing to start? I have added myself
to the www-data group and the video group has me in it as well as mythtv,
motion and www-data. Is anyone aware of a fix or work-around?

Thanks.

Augustine
_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Mythzmserver doesn't start: "This version of ZM is to old you need 1.24.0 or later ''" [ In reply to ]
On 25/04/2021 22:17, A. F. Cano wrote:

> Hello everyone,
>
> Running
>
> MythTV 30.0+fixes20210328.git7d297b1fb8-dm from deb-multimedia, on Debian
> 10.9 (stable) totally up-to-date.
> Mythzoneminder 1:30.0+fixes20200514.gitc6b20b072e- also from deb-multimetia.
> Zoneminder 2:1.32.3-dmo4+deb10v2
>
> As is obvious, the error message:
>
> "This version of ZM is to old you need 1.24.0 or later ''"
>
> is not true since I'm running 1.32. Additioanlly, mythzmserver also
> looks for the zm configuration in /etc/zm.conf. In Debian it is in
> /etc/zm/zm.conf so I had to attempt to start mythzmserver like this:
>
> $ sudo mythzmserver -c /etc/zm/zm.conf
> loading zm config from /etc/zm/zm.conf
> This version of ZM is to old you need 1.24.0 or later ''
>
> This happens whether zoneminder is running or not.
>
> Mythtv has been running just fine in other respects. Before I set up
> zoneminder, going to the zoneminder page in mythtv did nothing. After I
> changed the location from 127.0.0.1 to localhost there is a brief pop-up
> on front-end startup that says: "Can't connect to the mythzmserver".
> Zoneminder works fine from the web browser. I have changed nothing in
> the default configuration of zoneminder.
>
> Any ideas as to why mythzmserver is failing to start? I have added myself
> to the www-data group and the video group has me in it as well as mythtv,
> motion and www-data. Is anyone aware of a fix or work-around?
>
> Thanks.
>
> Augustine


Try adding to /etc/zm/zm.conf


ZM_VERSION=1.32.3


Previous versions of ZM added that automatically but newer version seem
to not add it.


Paul H.

_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Mythzmserver doesn't start: "This version of ZM is to old you need 1.24.0 or later ''" [ In reply to ]
On Sun, Apr 25, 2021 at 10:40:25PM +0100, Paul Harrison wrote:
> On 25/04/2021 22:17, A. F. Cano wrote:
>
> > Hello everyone,
> >
> > Running
> >
> > MythTV 30.0+fixes20210328.git7d297b1fb8-dm from deb-multimedia, on Debian
> > 10.9 (stable) totally up-to-date.
> > Mythzoneminder 1:30.0+fixes20200514.gitc6b20b072e- also from deb-multimetia.
> > Zoneminder 2:1.32.3-dmo4+deb10v2
> >
> > As is obvious, the error message:
> >
> > "This version of ZM is to old you need 1.24.0 or later ''"
> >
> > ...
>
> Try adding to /etc/zm/zm.conf
>
>
> ZM_VERSION=1.32.3
>
>
> Previous versions of ZM added that automatically but newer version seem to
> not add it.

Thank you! That took care of that weird error message, but I think I
now have a permissions problem.

2021-04-25 21:53:05.216873 I Connecting to zm server: localhost:6548 (try 1 of 2)
2021-04-25 21:53:05.217841 E MythSocket(55f503c45550:-1): Failed to connect to (::1:6548) Connection refused
2021-04-25 21:53:06.218151 I Connecting to zm server: localhost:6548 (try 2 of 2)
2021-04-25 21:53:06.218553 E MythSocket(55f503c45550:-1): Failed to connect to (::1:6548) Connection refused

Or maybe it's not a permissions problem:

mythzmserver says:

loading zm config from /etc/zm/zm.conf
ZM is version '1.32.3'
Listening on port: 6548

Failed to get mysql row
Failed to shmget for monitor: 2
ENOENT - no segment exists for the given key
new connection from 192.168.200.9 on socket 5
socket 5 hung up

Failed to get mysql row
Failed to shmget for monitor: 2
ENOENT - no segment exists for the given key
new connection from 192.168.200.9 on socket 5
socket 5 hung up

The last 2 blocks occurred with any operation on the frontend. I then
changed the mythzoneminder address from localhost to 192.168.200.9 and
I now get this:

Failed to get mysql row
Failed to shmget for monitor: 2
ENOENT - no segment exists for the given key
new connection from 127.0.0.1 on socket 5
Failed to get mysql row
Failed to shmget for monitor: 2
ENOENT - no segment exists for the given key
new connection from 192.168.200.9 on socket 6
socket 6 hung up

But now at least I see the ZoneMinder Console and I see the one camera
listed. The "Source" (/dev/video0(0)) is marked as [S] (Stopped) even
though on the web browser it says Capturing at 17.48MB/s. The
"Function" (Monitor) is marked as [R] (Running). The top field says
"Running" or "Stopped" depending on what I select with the web browser.

Show Live View only shows the test pattern. Clicking on the name of the
camera in the web browser brings on a live view so I know the zoneminder
part works.

There are apparently some compatibility problems with the database. I
created it with /usr/share/zoneminder/db/zm_create.sql
and I see no errors when running it from the web browser.

Has anyone seen this before? Any possible solutions or work-arounds?

> Paul H.

Thank you Paul for quickly solving the first issue.

Augustine
_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Mythzmserver doesn't start: "This version of ZM is to old you need 1.24.0 or later ''" [ In reply to ]
On 26/04/2021 03:52, A. F. Cano wrote:

> Failed to get mysql row
> Failed to shmget for monitor: 2
> ENOENT - no segment exists for the given key
> new connection from 192.168.200.9 on socket 5
> socket 5 hung up
>
>
> Augustine


I suspect this is the problem where ZoneMinder uses the reserved word
'Function' as a field name in the database.

I forget if it's MySQL or MariaDB that has the problem and exactly which
versions but I do know older versions of both worked OK.

If you know MySQL you can test this by running the following query and
if it fails retry by adding quote marks (") around Function and it
should then work.

SELECT Id, Name, Type, Device, Host, Channel, Function, Enabled FROM
Monitors;


If that is the problem then we can look at ways to fix this. Master
already has a fix but fixes/31 and fixes/30 don't.


Paul H.

_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Mythzmserver DB problems. Was: doesn't start:... [ In reply to ]
On Mon, Apr 26, 2021 at 06:19:22PM +0100, Paul Harrison wrote:
> On 26/04/2021 03:52, A. F. Cano wrote:
>
> > Failed to get mysql row
> > Failed to shmget for monitor: 2
> > ENOENT - no segment exists for the given key
> > new connection from 192.168.200.9 on socket 5
> > socket 5 hung up
> >
> >
> > Augustine
>
>
> I suspect this is the problem where ZoneMinder uses the reserved word
> 'Function' as a field name in the database.
>
> I forget if it's MySQL or MariaDB that has the problem and exactly which
> versions but I do know older versions of both worked OK.
>
> If you know MySQL you can test this by running the following query and if it
> fails retry by adding quote marks (") around Function and it should then
> work.
>
> SELECT Id, Name, Type, Device, Host, Channel, Function, Enabled FROM
> Monitors;

$ sudo mysql -u root
[sudo] password for afc:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 55845
Server version: 10.3.27-MariaDB-0+deb10u1 Debian 10

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> use zm;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
MariaDB [zm]> select Id, Name, Type, Device, Host, Channel, Function, Enabled from Monitors;
+----+-----------+-------+-------------+------+---------+----------+---------+
| Id | Name | Type | Device | Host | Channel | Function | Enabled |
+----+-----------+-------+-------------+------+---------+----------+---------+
| 2 | Desk-C600 | Local | /dev/video0 | NULL | 0 | Monitor | 1 |
+----+-----------+-------+-------------+------+---------+----------+---------+
1 row in set (0.001 sec)

MariaDB [zm]>

It seems to work. Not sure why the Host is NULL. It doesn't seem to
affect operation from the web browser.


> If that is the problem then we can look at ways to fix this. Master already
> has a fix but fixes/31 and fixes/30 don't.

Anything else I should try?

Thanks.

Augustine
_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Mythzmserver doesn't start: "This version of ZM is to old you need 1.24.0 or later ''" [ In reply to ]
On Mon, Apr 26, 2021 at 5:21 PM Paul Harrison <mythtv@mythqml.net> wrote:

> I forget if it's MySQL or MariaDB that has the problem and exactly which
> versions but I do know older versions of both worked OK.

Function become a reserved keyword in
MySQL 8.0.1.

I did not think mysql-server-8.0 was in
debian 10's normal repo set, but since
I only occasionally dabble with debian
I could have easily missed its inclusion.
_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Mythzmserver doesn't start: "This version of ZM is to old you need 1.24.0 or later ''" [ In reply to ]
On 26/04/2021 18:53, Gary Buhrmaster wrote:

> On Mon, Apr 26, 2021 at 5:21 PM Paul Harrison <mythtv@mythqml.net> wrote:
>
>> I forget if it's MySQL or MariaDB that has the problem and exactly which
>> versions but I do know older versions of both worked OK.
> Function become a reserved keyword in
> MySQL 8.0.1.
>
> I did not think mysql-server-8.0 was in
> debian 10's normal repo set, but since
> I only occasionally dabble with debian
> I could have easily missed its inclusion.


OK thanks Gary for digging that up. It's unlikely to be that then.


Paul H.

_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Mythzmserver DB problems. Was: doesn't start:... [ In reply to ]
On 26/04/2021 18:52, A. F. Cano wrote:

> On Mon, Apr 26, 2021 at 06:19:22PM +0100, Paul Harrison wrote:
>> On 26/04/2021 03:52, A. F. Cano wrote:
>>
>>> Failed to get mysql row
>>> Failed to shmget for monitor: 2
>>> ENOENT - no segment exists for the given key
>>> new connection from 192.168.200.9 on socket 5
>>> socket 5 hung up
>>>
>>>
>>> Augustine
>>
>> I suspect this is the problem where ZoneMinder uses the reserved word
>> 'Function' as a field name in the database.
>>
>> I forget if it's MySQL or MariaDB that has the problem and exactly which
>> versions but I do know older versions of both worked OK.
>>
>> If you know MySQL you can test this by running the following query and if it
>> fails retry by adding quote marks (") around Function and it should then
>> work.
>>
>> SELECT Id, Name, Type, Device, Host, Channel, Function, Enabled FROM
>> Monitors;
> $ sudo mysql -u root
> [sudo] password for afc:
> Welcome to the MariaDB monitor. Commands end with ; or \g.
> Your MariaDB connection id is 55845
> Server version: 10.3.27-MariaDB-0+deb10u1 Debian 10
>
> Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
>
> Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
>
> MariaDB [(none)]> use zm;
> Reading table information for completion of table and column names
> You can turn off this feature to get a quicker startup with -A
>
> Database changed
> MariaDB [zm]> select Id, Name, Type, Device, Host, Channel, Function, Enabled from Monitors;
> +----+-----------+-------+-------------+------+---------+----------+---------+
> | Id | Name | Type | Device | Host | Channel | Function | Enabled |
> +----+-----------+-------+-------------+------+---------+----------+---------+
> | 2 | Desk-C600 | Local | /dev/video0 | NULL | 0 | Monitor | 1 |
> +----+-----------+-------+-------------+------+---------+----------+---------+
> 1 row in set (0.001 sec)
>
> MariaDB [zm]>
>
> It seems to work. Not sure why the Host is NULL. It doesn't seem to
> affect operation from the web browser.
>
>
>> If that is the problem then we can look at ways to fix this. Master already
>> has a fix but fixes/31 and fixes/30 don't.
> Anything else I should try?
>
> Thanks.
>
> Augustine

OK so it's not that then. It does look like a query is failing for some
reason and that is cascading to other errors.

Can you try adding -v or --verbose to the command line flags and start
mythzmserver like that. Maybe the extra debugging will give a clue.

I think having NULL for the host is OK for a Local camera only remote
cameras like IP cameras will have a Host set.


Paul H.
Re: Mythzmserver DB problems. Was: doesn't start:... [ In reply to ]
On Mon, Apr 26, 2021 at 07:29:45PM +0100, Paul Harrison wrote:
>...
> OK so it's not that then. It does look like a query is failing for some
> reason and that is cascading to other errors.
>
> Can you try adding -v or --verbose to the command line flags and start
> mythzmserver like that. Maybe the extra debugging will give a clue.

Summary:

getZMSetting: ZM_SHM_KEY Result: 0x7a6d0000
Shared memory key is: 0x7a6d0000
Failed to get mysql row
...
Failed to open mmap file [/zm.mmap.2] for monitor: 2 : No such file or directory
Falling back to the legacy shared memory method
Failed to shmget for monitor: 2
ENOENT - no segment exists for the given key
...
getZMSetting: ZM_PATH_MAP Result:
Memory path directory is:

I wonder if this ZM_PATH_MAP needs to be set explicitly and if so what
needs to be the value. Shared memory seems to be the problem. Or is
this obtained from the mysql row that fails?

About the mysql row that fails, would it help to send the
/usr/share/zoneminder/db/zm_create.sql? It is quite large: 2874 lines.

If the shared memory area is where the video frames go, no wonder only
the test pattern is displayed, there is no picture to display that
mythzmserver can find.

These seem to be the only errors. The complete log is below.

Start zm from web browser, then

# mythzmserver -v -c /etc/zm/zm.conf
loading zm config from /etc/zm/zm.conf
ZM is version '1.32.3'
Listening on port: 6548
Using server protocol version '11'
getZMSetting: ZM_SHM_KEY Result: 0x7a6d0000
Shared memory key is: 0x7a6d0000
Failed to get mysql row
getZMSetting: ZM_PATH_MAP Result:
Memory path directory is:
getZMSetting: ZM_EVENT_IMAGE_DIGITS Result: 5
Event file format is: %05d-capture.jpg
Analysis file format is: %05d-analyse.jpg
getZMSetting: ZM_USE_DEEP_STORAGE Result: 1
using deep storage directory structure
getZMSetting: ZM_CREATE_ANALYSIS_IMAGES Result: 1
using analysis images
Got 1 monitors
Failed to open mmap file [/zm.mmap.2] for monitor: 2 : No such file or directory
Falling back to the legacy shared memory method
Failed to shmget for monitor: 2
ENOENT - no segment exists for the given key
new connection from 127.0.0.1 on socket 5
Processing: 'HELLO'
Processing: 'GET_MONITOR_LIST'
We have 1 monitors
id: 2
name: Desk-C600
width: 1280
height: 720
palette: 0
byte per pixel: 4
sub pixel order:2
-------------------
Processing: 'GET_ALARM_STATES'
Processing: 'GET_ALARM_STATES'
Processing: 'GET_ALARM_STATES'
...

These repeat every second

Then there is this:

...
Processing: 'GET_ALARM_STATES'
Processing: 'GET_ALARM_STATES'
Using server protocol version '11'
getZMSetting: ZM_SHM_KEY Result: 0x7a6d0000
Shared memory key is: 0x7a6d0000
Failed to get mysql row
getZMSetting: ZM_PATH_MAP Result:
Memory path directory is:
getZMSetting: ZM_EVENT_IMAGE_DIGITS Result: 5
Event file format is: %05d-capture.jpg
Analysis file format is: %05d-analyse.jpg
getZMSetting: ZM_USE_DEEP_STORAGE Result: 1
using deep storage directory structure
getZMSetting: ZM_CREATE_ANALYSIS_IMAGES Result: 1
using analysis images
Got 1 monitors
Failed to open mmap file [/zm.mmap.2] for monitor: 2 : No such file or directory
Falling back to the legacy shared memory method
Failed to shmget for monitor: 2
ENOENT - no segment exists for the given key
new connection from 192.168.200.9 on socket 6
socket 6 hung up
ZMServer destroyed
Processing: 'GET_ALARM_STATES'
Processing: 'GET_ALARM_STATES'
...

Then when selecting "show live view":

Processing: 'GET_LIVE_FRAME'
Kicking database connection
Getting live frame from monitor: 2
Processing: 'GET_LIVE_FRAME'
Getting live frame from monitor: 2
Processing: 'GET_LIVE_FRAME'
Getting live frame from monitor: 2
Processing: 'GET_LIVE_FRAME'
Getting live frame from monitor: 2
Processing: 'GET_LIVE_FRAME'
Getting live frame from monitor: 2
Processing: 'GET_LIVE_FRAME'
Getting live frame from monitor: 2
Processing: 'GET_ALARM_STATES'
Processing: 'GET_LIVE_FRAME'
Getting live frame from monitor: 2
Processing: 'GET_LIVE_FRAME'
Getting live frame from monitor: 2
Processing: 'GET_LIVE_FRAME'
Getting live frame from monitor: 2
Processing: 'GET_LIVE_FRAME'
Getting live frame from monitor: 2
Processing: 'GET_LIVE_FRAME'
Getting live frame from monitor: 2
Processing: 'GET_LIVE_FRAME'
Getting live frame from monitor: 2
Processing: 'GET_LIVE_FRAME'
Getting live frame from monitor: 2

This kept on going until I exited "show live view". There was just the
test pattern in the live view screen.

Then there was this: (this block also reappears periodically even after
both zm and the front end are no longer running, but then another front
end is running on another screen but it was just sitting there)

Processing: 'GET_ALARM_STATES'
Processing: 'GET_ALARM_STATES'
Using server protocol version '11'
getZMSetting: ZM_SHM_KEY Result: 0x7a6d0000
Shared memory key is: 0x7a6d0000
Failed to get mysql row
getZMSetting: ZM_PATH_MAP Result:
Memory path directory is:
getZMSetting: ZM_EVENT_IMAGE_DIGITS Result: 5
Event file format is: %05d-capture.jpg
Analysis file format is: %05d-analyse.jpg
getZMSetting: ZM_USE_DEEP_STORAGE Result: 1
using deep storage directory structure
getZMSetting: ZM_CREATE_ANALYSIS_IMAGES Result: 1
using analysis images
Got 1 monitors
Failed to open mmap file [/zm.mmap.2] for monitor: 2 : No such file or directory
Falling back to the legacy shared memory method
Failed to shmget for monitor: 2
ENOENT - no segment exists for the given key
new connection from 192.168.200.9 on socket 6
socket 6 hung up
ZMServer destroyed
Processing: 'GET_ALARM_STATES'
Processing: 'GET_ALARM_STATES'
...

Then when I exited the front end:

socket 5 hung up
ZMServer destroyed

And finally when I told zm to stop via the web browser:

Kicking database connection
Kicking database connection

> I think having NULL for the host is OK for a Local camera only remote
> cameras like IP cameras will have a Host set.

Makes sense.

Thanks!

Augustine
_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Mythzmserver DB problems. Was: doesn't start:... [ In reply to ]
On 26/04/2021 21:02, A. F. Cano wrote:

> Summary:
> getZMSetting: ZM_SHM_KEY Result: 0x7a6d0000
> Shared memory key is: 0x7a6d0000
> Failed to get mysql row
> ...
> Failed to open mmap file [/zm.mmap.2] for monitor: 2 : No such file or directory
> Falling back to the legacy shared memory method
> Failed to shmget for monitor: 2
> ENOENT - no segment exists for the given key
> ...
> getZMSetting: ZM_PATH_MAP Result:
> Memory path directory is:
>
> I wonder if this ZM_PATH_MAP needs to be set explicitly and if so what
> needs to be the value. Shared memory seems to be the problem. Or is
> this obtained from the mysql row that fails?


OK thanks for the log I think I see what's happening now.


In older versions of ZM < 1.32.0 the shared memory path was stored in
the database Config table as setting "ZM_PATH_MAP" but newer version >=
1.32.0 put the ZM_PATH_MAP setting in the
/etc/zm/zm.conf or in /etc/zm/conf.d/01-system-paths.conf config files.


When mythzmserver starts up it first looks for the ZM_VERSION setting to
figure out which version of ZM we have and if it is >= 1.32.0 it looks
for the ZM_PATH_MAP setting in either of the two *.conf files. If it's
not found then as a last resort looks for the ZM_PATH_MAP setting in the
database which it looks like that setting was removed from the database
in newer versions which is why you get the 'Failed to get mysql row'
error messages. I use 1.34.26 and no longer see that setting in the DB
either.


So basically you need to make sure one of the two *.conf files contains
a setting for ZM_PATH_MAP (the Ubuntu packages I use do this
automatically, I'm guessing the deb_multimedia packages use a different
name/location for the user config file at
/etc/zm/conf.d/01-system-paths.conf?)


My ZM_PATH_MAP setting is in /etc/zm/conf.d/01-system-paths.conf and
looks like this :-


# Full Path to ZoneMinder's mapped memory files
# The web account user must have full read/write permission to this folder.
ZM_PATH_MAP=/dev/shm


Paul H.
Re: Mythzmserver DB problems. Was: doesn't start:... [ In reply to ]
On Tue, Apr 27, 2021 at 01:43:27AM +0100, Paul Harrison wrote:
> On 26/04/2021 21:02, A. F. Cano wrote:
>
> Summary:
>
> getZMSetting: ZM_SHM_KEY Result: 0x7a6d0000
> Shared memory key is: 0x7a6d0000
> Failed to get mysql row
> ...
> Failed to open mmap file [/zm.mmap.2] for monitor: 2 : No such file or directory
> Falling back to the legacy shared memory method
> Failed to shmget for monitor: 2
> ENOENT - no segment exists for the given key
> ...
> getZMSetting: ZM_PATH_MAP Result:
> Memory path directory is:
>
> I wonder if this ZM_PATH_MAP needs to be set explicitly and if so what
> needs to be the value. Shared memory seems to be the problem. Or is
> this obtained from the mysql row that fails?
>
> OK thanks for the log I think I see what's happening now.
>
> In older versions of ZM < 1.32.0 the shared memory path was stored in the
> database Config table as setting "ZM_PATH_MAP" but newer version >= 1.32.0
> put the ZM_PATH_MAP setting in the
> /etc/zm/zm.conf or in /etc/zm/conf.d/01-system-paths.conf config files.
>
> When mythzmserver starts up it first looks for the ZM_VERSION setting to
> figure out which version of ZM we have and if it is >= 1.32.0 it looks for
> the ZM_PATH_MAP setting in either of the two *.conf files. If it's not
> found then as a last resort looks for the ZM_PATH_MAP setting in the
> database which it looks like that setting was removed from the database in
> newer versions which is why you get the 'Failed to get mysql row' error
> messages. I use 1.34.26 and no longer see that setting in the DB either.
>
> So basically you need to make sure one of the two *.conf files contains a
> setting for ZM_PATH_MAP (the Ubuntu packages I use do this automatically,
> I'm guessing the deb_multimedia packages use a different name/location for
> the user config file at /etc/zm/conf.d/01-system-paths.conf?)
>
> My ZM_PATH_MAP setting is in /etc/zm/conf.d/01-system-paths.conf and looks
> like this :-
>
> # Full Path to ZoneMinder's mapped memory files
> # The web account user must have full read/write permission to this
> folder.
> ZM_PATH_MAP=/dev/shm

Same here.

$ ls -la /dev/shm
total 72024
drwxrwxrwt 2 root root 80 Apr 26 22:55 ./
drwxr-xr-x 20 root root 3780 Apr 23 19:17 ../
-rw------- 1 postgres postgres 14992 Apr 21 08:05 PostgreSQL.1073826586
-rw------- 1 www-data www-data 73733672 Apr 26 22:10 zm.mmap.2

I am a member of groups www-data and video. I start the front-end as myself.

This is what's in /etc/group for the relevant groups:

www-data:x:33:afc
video:x:44:afc,mythtv,motion,www-data

Evan after chmod g+rw /etc/shm/zm.mmap.2

$ ls -l /dev/shm
total 72024
-rw------- 1 postgres postgres 14992 Apr 21 08:05 PostgreSQL.1073826586
-rw-rw---- 1 www-data www-data 73733672 Apr 26 22:10 zm.mmap.2

The ZM_PATH_MAP is blank:

getZMSetting: ZM_PATH_MAP Result:
Memory path directory is:

and the frontend cannot access the shared memory and I only see the test
pattern. Maybe it's not a permissions issue, or is it?

Even after chmod o+rw /dev/shm/zm.mmap.2

$ ls -l /dev/shm
total 72024
-rw------- 1 postgres postgres 14992 Apr 21 08:05 PostgreSQL.1073826586
-rw-rw-rw- 1 www-data www-data 73733672 Apr 26 22:10 zm.mmap.2

the ZM_PATH_MAP is still blank, but now I get this: (this is an error
message from the frontend, not mythzmserver.

ERROR - Cannot get shared memory pointers
2021-04-26 22:37:36.565699 E The server failed to process the command. The error was:-

repeated a gazillion times while in "show live view", while still only
seeing the test pattern. Curiouser and curiouser...

The conf file says "read/write permission to the folder". It shouldn't
be necessary to chmod the file itself, right?

Even starting the frontend with sudo gives the same result.

Not sure what else to try next. Any ideas?

Thanks!

Augustine
_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Mythzmserver DB problems. Was: doesn't start:... [ In reply to ]
Hoi A.,

Tuesday, April 27, 2021, 5:12:16 AM, you wrote:

> On Tue, Apr 27, 2021 at 01:43:27AM +0100, Paul Harrison wrote:
>> On 26/04/2021 21:02, A. F. Cano wrote:
>>
>> Summary:
>>
>> getZMSetting: ZM_SHM_KEY Result: 0x7a6d0000
>> Shared memory key is: 0x7a6d0000
>> Failed to get mysql row
>> ...
>> Failed to open mmap file [/zm.mmap.2] for monitor: 2 : No such file or directory
>> Falling back to the legacy shared memory method
>> Failed to shmget for monitor: 2
>> ENOENT - no segment exists for the given key
>> ...
>> getZMSetting: ZM_PATH_MAP Result:
>> Memory path directory is:
>>
>> I wonder if this ZM_PATH_MAP needs to be set explicitly and if so what
>> needs to be the value. Shared memory seems to be the problem. Or is
>> this obtained from the mysql row that fails?
>>
>> OK thanks for the log I think I see what's happening now.
>>
>> In older versions of ZM < 1.32.0 the shared memory path was stored in the
>> database Config table as setting "ZM_PATH_MAP" but newer version >= 1.32.0
>> put the ZM_PATH_MAP setting in the
>> /etc/zm/zm.conf or in /etc/zm/conf.d/01-system-paths.conf config files.
>>
>> When mythzmserver starts up it first looks for the ZM_VERSION setting to
>> figure out which version of ZM we have and if it is >= 1.32.0 it looks for
>> the ZM_PATH_MAP setting in either of the two *.conf files. If it's not
>> found then as a last resort looks for the ZM_PATH_MAP setting in the
>> database which it looks like that setting was removed from the database in
>> newer versions which is why you get the 'Failed to get mysql row' error
>> messages. I use 1.34.26 and no longer see that setting in the DB either.
>>
>> So basically you need to make sure one of the two *.conf files contains a
>> setting for ZM_PATH_MAP (the Ubuntu packages I use do this automatically,
>> I'm guessing the deb_multimedia packages use a different name/location for
>> the user config file at /etc/zm/conf.d/01-system-paths.conf?)
>>
>> My ZM_PATH_MAP setting is in /etc/zm/conf.d/01-system-paths.conf and looks
>> like this :-
>>
>> # Full Path to ZoneMinder's mapped memory files
>> # The web account user must have full read/write permission to this
>> folder.
>> ZM_PATH_MAP=/dev/shm

> Same here.

> $ ls -la /dev/shm
> total 72024
> drwxrwxrwt 2 root root 80 Apr 26 22:55 ./
> drwxr-xr-x 20 root root 3780 Apr 23 19:17 ../
> -rw------- 1 postgres postgres 14992 Apr 21 08:05 PostgreSQL.1073826586
> -rw------- 1 www-data www-data 73733672 Apr 26 22:10 zm.mmap.2

> I am a member of groups www-data and video. I start the front-end as myself.

> This is what's in /etc/group for the relevant groups:

> www-data:x:33:afc
> video:x:44:afc,mythtv,motion,www-data

> Evan after chmod g+rw /etc/shm/zm.mmap.2

> $ ls -l /dev/shm
> total 72024
> -rw------- 1 postgres postgres 14992 Apr 21 08:05 PostgreSQL.1073826586
> -rw-rw---- 1 www-data www-data 73733672 Apr 26 22:10 zm.mmap.2

> The ZM_PATH_MAP is blank:

> getZMSetting: ZM_PATH_MAP Result:
> Memory path directory is:

> and the frontend cannot access the shared memory and I only see the test
> pattern. Maybe it's not a permissions issue, or is it?

> Even after chmod o+rw /dev/shm/zm.mmap.2

> $ ls -l /dev/shm
> total 72024
> -rw------- 1 postgres postgres 14992 Apr 21 08:05 PostgreSQL.1073826586
> -rw-rw-rw- 1 www-data www-data 73733672 Apr 26 22:10 zm.mmap.2

> the ZM_PATH_MAP is still blank, but now I get this: (this is an error
> message from the frontend, not mythzmserver.

> ERROR - Cannot get shared memory pointers
> 2021-04-26 22:37:36.565699 E The server failed to process the command. The error was:-

> repeated a gazillion times while in "show live view", while still only
> seeing the test pattern. Curiouser and curiouser...

> The conf file says "read/write permission to the folder". It shouldn't
> be necessary to chmod the file itself, right?

> Even starting the frontend with sudo gives the same result.

> Not sure what else to try next. Any ideas?

> Thanks!

> Augustine
> _______________________________________________

You should check if that user has access to the folder ?nd to the path
leading there (r+x). The easiest way to check is to try reading the
file as that user. If you need write permission, try to echo to a file
in that directory as that user.
echo test > /dev/shm/test




Tot mails,
Hika mailto:hikavdh@gmail.com

"Zonder hoop kun je niet leven
Zonder leven is er geen hoop
Het eeuwige dilemma
Zeker als je hoop moet vernietigen om te kunnen overleven!"

De lerende Mens

_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Mythzmserver DB problems. Was: doesn't start:... [ In reply to ]
On Tue, Apr 27, 2021 at 12:39:39PM +0200, Hika van den Hoven wrote:
> Hoi A.,
>
> ...

This ls was done after I added g+rw to zm.mmap.2

> > $ ls -l /dev/shm
> > total 72024
> > -rw------- 1 postgres postgres 14992 Apr 21 08:05 PostgreSQL.1073826586
> > -rw-rw---- 1 www-data www-data 73733672 Apr 26 22:10 zm.mmap.2
>
> You should check if that user has access to the folder ?nd to the path
> leading there (r+x). The easiest way to check is to try reading the
> file as that user. If you need write permission, try to echo to a file

Yes, but since the program reading and writing this file is mythzserver
and it's run as root, that shouldn't be an issue, right?

Zoneminder creates the shared memory file like this:

-rw------- 1 www-data www-data 73733672 Apr 27 09:11 zm.mmap.2

With rw permissions for root.


> in that directory as that user.
> echo test > /dev/shm/test

> echo test > /dev/shm/test

WIth soneminder not running, so the zm file is not there.

afc$ echo test > /dev/shm/test
afc$ ls -l /dev/shm
total 20
-rw------- 1 postgres postgres 14992 Apr 21 08:05 PostgreSQL.1073826586
-rw-r--r-- 1 afc afc 5 Apr 27 08:40 test
afc$ echo test >> /dev/shm/test
afc$ ls -l /dev/shm
total 20
-rw------- 1 postgres postgres 14992 Apr 21 08:05 PostgreSQL.1073826586
-rw-r--r-- 1 afc afc 10 Apr 27 08:41 test
afc$ cat /dev/shm/test
test
test
afc$ chown www-data:www-data /dev/shm/test
chown: changing ownership of '/dev/shm/test': Operation not permitted
afc$ sudo chown www-data:www-data /dev/shm/test
[sudo] password for afc:

# so once the ownership is changed, I can no longer write to it,

afc$ cat /dev/shm/test
test
test
afc$ echo test >> /dev/shm/test
bash: /dev/shm/test: Permission denied
afc$ sudo echo test >> /dev/shm/test
bash: /dev/shm/test: Permission denied
afc$ sudo www-data echo test >> /dev/shm/test
bash: /dev/shm/test: Permission denied

# But as root (like mythzmserver runs), it it still possible.

hp-i3:1:/home/afc> su
Password:
# echo test >> /dev/shm/test
# cat /dev/shm/test
test
test
test

So, running as root (su) I can write to the test file. This should be
how mythzmserver manages it since it's run as root. Or am I missing
something?

> Tot mails,
> Hika mailto:hikavdh@gmail.com

Thanks.

Augustine
_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Mythzmserver DB problems. Was: doesn't start:... [ In reply to ]
On 27/04/2021 04:12, A. F. Cano wrote:

> On Tue, Apr 27, 2021 at 01:43:27AM +0100, Paul Harrison wrote:
>> So basically you need to make sure one of the two *.conf files contains a
>> setting for ZM_PATH_MAP (the Ubuntu packages I use do this automatically,
>> I'm guessing the deb_multimedia packages use a different name/location for
>> the user config file at /etc/zm/conf.d/01-system-paths.conf?)
>>
>> My ZM_PATH_MAP setting is in /etc/zm/conf.d/01-system-paths.conf and looks
>> like this :-
>>
>> # Full Path to ZoneMinder's mapped memory files
>> # The web account user must have full read/write permission to this
>> folder.
>> ZM_PATH_MAP=/dev/shm
> Same here.
>
> $ ls -la /dev/shm
> total 72024
> drwxrwxrwt 2 root root 80 Apr 26 22:55 ./
> drwxr-xr-x 20 root root 3780 Apr 23 19:17 ../
> -rw------- 1 postgres postgres 14992 Apr 21 08:05 PostgreSQL.1073826586
> -rw------- 1 www-data www-data 73733672 Apr 26 22:10 zm.mmap.2
>
> I am a member of groups www-data and video. I start the front-end as myself.
>
> This is what's in /etc/group for the relevant groups:
>
> www-data:x:33:afc
> video:x:44:afc,mythtv,motion,www-data
>
> Evan after chmod g+rw /etc/shm/zm.mmap.2
>
> $ ls -l /dev/shm
> total 72024
> -rw------- 1 postgres postgres 14992 Apr 21 08:05 PostgreSQL.1073826586
> -rw-rw---- 1 www-data www-data 73733672 Apr 26 22:10 zm.mmap.2
>
> The ZM_PATH_MAP is blank:


So just to be clear do you have a line in either of these conf files
/etc/zm/zm.conf or /etc/zm/conf.d/01-system-paths.conf like this :-

ZM_PATH_MAP=/dev/shm


Does the user running mythzmserver have read permission on those files?


Paul H.

_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Mythzmserver DB problems. Was: doesn't start:... [ In reply to ]
On Tue, Apr 27, 2021 at 02:39:42PM +0100, Paul Harrison wrote:
> On 27/04/2021 04:12, A. F. Cano wrote:
>
> > On Tue, Apr 27, 2021 at 01:43:27AM +0100, Paul Harrison wrote:
> > > So basically you need to make sure one of the two *.conf files contains a
> > > setting for ZM_PATH_MAP (the Ubuntu packages I use do this automatically,
> > > I'm guessing the deb_multimedia packages use a different name/location for
> > > the user config file at /etc/zm/conf.d/01-system-paths.conf?)
> > >
> > > My ZM_PATH_MAP setting is in /etc/zm/conf.d/01-system-paths.conf and looks
> > > like this :-
> > >
> > > # Full Path to ZoneMinder's mapped memory files
> > > # The web account user must have full read/write permission to this
> > > folder.
> > > ZM_PATH_MAP=/dev/shm
> > Same here.
> >
> > $ ls -la /dev/shm
> > total 72024
> > drwxrwxrwt 2 root root 80 Apr 26 22:55 ./
> > drwxr-xr-x 20 root root 3780 Apr 23 19:17 ../
> > -rw------- 1 postgres postgres 14992 Apr 21 08:05 PostgreSQL.1073826586
> > -rw------- 1 www-data www-data 73733672 Apr 26 22:10 zm.mmap.2
> >
> > I am a member of groups www-data and video. I start the front-end as myself.
> >
> > This is what's in /etc/group for the relevant groups:
> >
> > www-data:x:33:afc
> > video:x:44:afc,mythtv,motion,www-data
> >
> > Evan after chmod g+rw /etc/shm/zm.mmap.2
> >
> > $ ls -l /dev/shm
> > total 72024
> > -rw------- 1 postgres postgres 14992 Apr 21 08:05 PostgreSQL.1073826586
> > -rw-rw---- 1 www-data www-data 73733672 Apr 26 22:10 zm.mmap.2
> >
> > The ZM_PATH_MAP is blank:
>
>
> So just to be clear do you have a line in either of these conf files
> /etc/zm/zm.conf or /etc/zm/conf.d/01-system-paths.conf like this :-
>
> ZM_PATH_MAP=/dev/shm

Yes. In /etc/zm/conf.d/01-system-paths.conf there is:

# Full Path to ZoneMinder's mapped memory files
# The web account user must have full read/write permission to this folder.
ZM_PATH_MAP=/dev/shm

> Does the user running mythzmserver have read permission on those files?

I run mythzmserver as root (su):

# mythzmserver -c /etc/zm/zm.conf

As can be seen above, the folder (/dev/shm) has rw permissions for
everyone.

drwxrwxrwt 2 root root 80 Apr 26 22:55 ./

I just found something interesting. I had added the ZM_VERSION=1.32.3
to /etc/zm/zm.conf even though at the beginning of that file it says to
add local configuration to a file in /etc/zm/conf.d. Then mythzmserver
knew about the version. I just removed that line and instead put in in
/etc/zm/conf.d/03-local.conf. Upon restarting mythzmserver as root like
this:

# mythzmserver -c /etc/zm/zm.conf

I get the old message back:

This version of ZM is to old you need 1.14.0 or later ''

So it looks like mythzmserver doesn't see the config files in
/etc/zm/conf.d even though zm apparently goes there somehow. There is
no include or source statement in /etc/zm/zm.conf for the conf.d
directory. The only reference to conf.d in /etc/zm/zm.conf is at the
very beginning:

# ==========================================================================
#
# ZoneMinder Base Configuration
#
# ==========================================================================
#
# *** DO NOT EDIT THIS FILE ***
#
# To make custom changes to the variables below, create a new configuration
# file, with an extention of .conf, under the /etc/zm/conf.d
# folder, containing your desired modifications.
#

As it appears that mythzmserver is not looking at conf.d, maybe that is
the problem.

Furthermore, if I start mythzmserver like this:

# mythzmserver -c /etc/zm/zm.conf -c /etc/zm/conf.d/03-local.conf
loading zm config from /etc/zm/conf.d/03-local.conf
ZM is version '1.32.3'
Error: Can't select database: No database selected

It now knows about the version, but since it apparently only reads one
config file parameter, other errors show up.

Just as a reminder, without the -c parameter, mythzmserver attempts to
look at /etc/zm.conf which doesn't exist in debian:

# mythzmserver
loading zm config from /etc/zm.conf
Can't open /etc/zm.conf

Maybe the problem is in reading all the necessary configuration files.
It looks like mythzmserver is expecting everything to be in zm.conf.

If there's anything else I can test, please let me know.

Augustine
_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Mythzmserver DB problems. Was: doesn't start:... [ In reply to ]
On 27/04/2021 17:06, A. F. Cano wrote:

> On Tue, Apr 27, 2021 at 02:39:42PM +0100, Paul Harrison wrote:
>> On 27/04/2021 04:12, A. F. Cano wrote:
>>
>>> On Tue, Apr 27, 2021 at 01:43:27AM +0100, Paul Harrison wrote:
>>>> So basically you need to make sure one of the two *.conf files contains a
>>>> setting for ZM_PATH_MAP (the Ubuntu packages I use do this automatically,
>>>> I'm guessing the deb_multimedia packages use a different name/location for
>>>> the user config file at /etc/zm/conf.d/01-system-paths.conf?)
>>>>
>>>> My ZM_PATH_MAP setting is in /etc/zm/conf.d/01-system-paths.conf and looks
>>>> like this :-
>>>>
>>>> # Full Path to ZoneMinder's mapped memory files
>>>> # The web account user must have full read/write permission to this
>>>> folder.
>>>> ZM_PATH_MAP=/dev/shm
>>> Same here.
>>>
>>> $ ls -la /dev/shm
>>> total 72024
>>> drwxrwxrwt 2 root root 80 Apr 26 22:55 ./
>>> drwxr-xr-x 20 root root 3780 Apr 23 19:17 ../
>>> -rw------- 1 postgres postgres 14992 Apr 21 08:05 PostgreSQL.1073826586
>>> -rw------- 1 www-data www-data 73733672 Apr 26 22:10 zm.mmap.2
>>>
>>> I am a member of groups www-data and video. I start the front-end as myself.
>>>
>>> This is what's in /etc/group for the relevant groups:
>>>
>>> www-data:x:33:afc
>>> video:x:44:afc,mythtv,motion,www-data
>>>
>>> Evan after chmod g+rw /etc/shm/zm.mmap.2
>>>
>>> $ ls -l /dev/shm
>>> total 72024
>>> -rw------- 1 postgres postgres 14992 Apr 21 08:05 PostgreSQL.1073826586
>>> -rw-rw---- 1 www-data www-data 73733672 Apr 26 22:10 zm.mmap.2
>>>
>>> The ZM_PATH_MAP is blank:
>>
>> So just to be clear do you have a line in either of these conf files
>> /etc/zm/zm.conf or /etc/zm/conf.d/01-system-paths.conf like this :-
>>
>> ZM_PATH_MAP=/dev/shm
> Yes. In /etc/zm/conf.d/01-system-paths.conf there is:
>
> # Full Path to ZoneMinder's mapped memory files
> # The web account user must have full read/write permission to this folder.
> ZM_PATH_MAP=/dev/shm
>
>

Ah! I forgot you are running MythTV 30.0 which is missing some fixes.
It's difficult to keep track of all the changes in MythTV and Zoneminder
and what is compatible with what at least that's my excuse :)

Only current master looks in /etc/zm/conf.d/01-system-paths.conf for the
ZM_PATH_MAP setting. Older versions only look in /etc/zm.conf or the
location you tell it to load the config from when you pass a -c command
line parameter to mythzmserver.


You will have to either copy the ZM_PATH_MAP setting to /etc/zm/zm.conf
or you could create a custom copy of /etc/zm/zm.conf specifically for
mythzmserver to use and add the ZM_PATH_MAP setting then tell
mythzmserver to use your custom zm.conf file using the -c parameter.


Paul H.


_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Mythzmserver DB problems. Was: doesn't start:... [ In reply to ]
On Wed, Apr 28, 2021 at 12:00:38AM +0100, Paul Harrison wrote:
> ...
>
> Ah! I forgot you are running MythTV 30.0 which is missing some fixes. It's
> difficult to keep track of all the changes in MythTV and Zoneminder and what
> is compatible with what at least that's my excuse :)
>
> Only current master looks in /etc/zm/conf.d/01-system-paths.conf for the
> ZM_PATH_MAP setting. Older versions only look in /etc/zm.conf or the
> location you tell it to load the config from when you pass a -c command line
> parameter to mythzmserver.
>
>
> You will have to either copy the ZM_PATH_MAP setting to /etc/zm/zm.conf or
> you could create a custom copy of /etc/zm/zm.conf specifically for
> mythzmserver to use and add the ZM_PATH_MAP setting then tell mythzmserver
> to use your custom zm.conf file using the -c parameter.

Ok, added:

ZM_PATH_MAP=/dev/shm
ZM_VERSION=1.32.3

to the end of /etc/zm/zm.conf but I still get this non-stop when in
"Show Live View":

2021-04-27 21:58:43.779205 E The server failed to process the command. The error was:-
ERROR - Cannot get shared memory pointers

and I get the test pattern on the frontend.

Of interest regarding shared memory, mythzmserver gives this:

getZMSetting: ZM_SHM_KEY Result: 0x7a6d0000
Shared memory key is: 0x7a6d0000
Failed to get mysql row
getZMSetting: ZM_PATH_MAP Result:
Memory path directory is:

It is strange that it finds a ZM_SHM_KEY but then the "ZM_PATH_MAP
Result:" is empty, and the "Memory path directory is:" is also empty.

And then:

Failed to open mmap file [/zm.mmap.2] for monitor: 2 : No such file or directory
Falling back to the legacy shared memory method
Failed to shmget for monitor: 2
ENOENT - no segment exists for the given key

So it looks like even though it has a shared memory key and the
ZM_PATH_MAP=/dev/shm parameter is in /etc/zm/zm.conf it is still not
finding the file and reverting to "the legacy shared memory method".
It certainly looks like mythzmserver is ignoring the ZM_PATH_MAP
variable. Is it using the "legacy ahared memory method" and that is
what is causing the memory pointer errors?

The complete log is below:

# mythzmserver -v -c /etc/zm/zm.conf
loading zm config from /etc/zm/zm.conf
ZM is version '1.32.3'
Listening on port: 6548
Using server protocol version '11'
getZMSetting: ZM_SHM_KEY Result: 0x7a6d0000
Shared memory key is: 0x7a6d0000
Failed to get mysql row
getZMSetting: ZM_PATH_MAP Result:
Memory path directory is:
getZMSetting: ZM_EVENT_IMAGE_DIGITS Result: 5
Event file format is: %05d-capture.jpg
Analysis file format is: %05d-analyse.jpg
getZMSetting: ZM_USE_DEEP_STORAGE Result: 1
using deep storage directory structure
getZMSetting: ZM_CREATE_ANALYSIS_IMAGES Result: 1
using analysis images
Got 1 monitors
Failed to open mmap file [/zm.mmap.2] for monitor: 2 : No such file or directory
Falling back to the legacy shared memory method
Failed to shmget for monitor: 2
ENOENT - no segment exists for the given key
new connection from 127.0.0.1 on socket 5
Processing: 'HELLO'
Processing: 'GET_MONITOR_LIST'
We have 1 monitors
id: 2
name: Desk-C600
width: 1280
height: 720
palette: 0
byte per pixel: 4
sub pixel order:2
-------------------
Processing: 'GET_ALARM_STATES'
Processing: 'GET_ALARM_STATES'
Processing: 'GET_ALARM_STATES'
Processing: 'GET_ALARM_STATES'
Processing: 'GET_ALARM_STATES'
Processing: 'GET_ALARM_STATES'
Processing: 'GET_ALARM_STATES'
Processing: 'GET_ALARM_STATES'
Processing: 'GET_ALARM_STATES'
Processing: 'GET_SERVER_STATUS'
Processing: 'GET_MONITOR_STATUS'
Got 1 monitors
Processing: 'GET_ALARM_STATES'
Processing: 'GET_ALARM_STATES'
Processing: 'GET_ALARM_STATES'
Processing: 'GET_LIVE_FRAME'
Kicking database connection
Getting live frame from monitor: 2 # this is where I get into Live View
Processing: 'GET_LIVE_FRAME'
Getting live frame from monitor: 2
Processing: 'GET_LIVE_FRAME'
Getting live frame from monitor: 2
Processing: 'GET_LIVE_FRAME'
Getting live frame from monitor: 2
Processing: 'GET_LIVE_FRAME'
Getting live frame from monitor: 2
Processing: 'GET_LIVE_FRAME'
Getting live frame from monitor: 2
Processing: 'GET_LIVE_FRAME'
Getting live frame from monitor: 2
Processing: 'GET_LIVE_FRAME'
Getting live frame from monitor: 2
Processing: 'GET_LIVE_FRAME'
Getting live frame from monitor: 2
Processing: 'GET_LIVE_FRAME'
Getting live frame from monitor: 2
Processing: 'GET_ALARM_STATES'
Processing: 'GET_LIVE_FRAME'
Getting live frame from monitor: 2
Processing: 'GET_LIVE_FRAME'
Getting live frame from monitor: 2
Processing: 'GET_LIVE_FRAME'
Getting live frame from monitor: 2
Processing: 'GET_LIVE_FRAME'
Getting live frame from monitor: 2
Processing: 'GET_LIVE_FRAME'
Getting live frame from monitor: 2
Processing: 'GET_LIVE_FRAME'
Getting live frame from monitor: 2
Processing: 'GET_LIVE_FRAME'
Getting live frame from monitor: 2
Processing: 'GET_LIVE_FRAME'
Getting live frame from monitor: 2
Processing: 'GET_LIVE_FRAME'
Getting live frame from monitor: 2
Processing: 'GET_LIVE_FRAME'
Getting live frame from monitor: 2
Processing: 'GET_ALARM_STATES'
Processing: 'GET_LIVE_FRAME'
Getting live frame from monitor: 2
Processing: 'GET_LIVE_FRAME'
...
_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Mythzmserver DB problems. Was: doesn't start:... [ In reply to ]
On 28/04/2021 03:58, A. F. Cano wrote:
> On Wed, Apr 28, 2021 at 12:00:38AM +0100, Paul Harrison wrote:
>> ...
>>
>> Ah! I forgot you are running MythTV 30.0 which is missing some fixes. It's
>> difficult to keep track of all the changes in MythTV and Zoneminder and what
>> is compatible with what at least that's my excuse :)
>>
>> Only current master looks in /etc/zm/conf.d/01-system-paths.conf for the
>> ZM_PATH_MAP setting. Older versions only look in /etc/zm.conf or the
>> location you tell it to load the config from when you pass a -c command line
>> parameter to mythzmserver.
>>
>>
>> You will have to either copy the ZM_PATH_MAP setting to /etc/zm/zm.conf or
>> you could create a custom copy of /etc/zm/zm.conf specifically for
>> mythzmserver to use and add the ZM_PATH_MAP setting then tell mythzmserver
>> to use your custom zm.conf file using the -c parameter.
> Ok, added:
>
> ZM_PATH_MAP=/dev/shm
> ZM_VERSION=1.32.3
>
> to the end of /etc/zm/zm.conf but I still get this non-stop when in
> "Show Live View":
>
> 2021-04-27 21:58:43.779205 E The server failed to process the command. The error was:-
> ERROR - Cannot get shared memory pointers
>
> and I get the test pattern on the frontend.
>
> Of interest regarding shared memory, mythzmserver gives this:
>
> getZMSetting: ZM_SHM_KEY Result: 0x7a6d0000
> Shared memory key is: 0x7a6d0000
> Failed to get mysql row
> getZMSetting: ZM_PATH_MAP Result:
> Memory path directory is:
>
> It is strange that it finds a ZM_SHM_KEY but then the "ZM_PATH_MAP
> Result:" is empty, and the "Memory path directory is:" is also empty.
>
> And then:
>
> Failed to open mmap file [/zm.mmap.2] for monitor: 2 : No such file or directory
> Falling back to the legacy shared memory method
> Failed to shmget for monitor: 2
> ENOENT - no segment exists for the given key
>
> So it looks like even though it has a shared memory key and the
> ZM_PATH_MAP=/dev/shm parameter is in /etc/zm/zm.conf it is still not
> finding the file and reverting to "the legacy shared memory method".
> It certainly looks like mythzmserver is ignoring the ZM_PATH_MAP
> variable. Is it using the "legacy ahared memory method" and that is
> what is causing the memory pointer errors?
>

Yes for some reason it's not finding the ZM_PATH_MAP setting in the
config file and falling back to reading the setting from the DB which
also fails because that setting is no longer in the database.

I'd rather not mess with the ZM database but Plan B might be to
temporarily add the setting to the Config table I think it is so at
least when it fails to find it in the config file it can fall back to
the setting from the DB. Plan C would be to just default to using
'/dev/shm' if all else fails which is a good default for Ubuntu and
debian at least.

Let me do some more digging and I will get back to you when I'm less tired.



Paul H.

_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Mythzmserver DB problems. Was: doesn't start:... [ In reply to ]
On 29/04/2021 00:15, Paul Harrison wrote:

>
> On 28/04/2021 03:58, A. F. Cano wrote:
>> On Wed, Apr 28, 2021 at 12:00:38AM +0100, Paul Harrison wrote:
>>> ...
>>>
>>> Ah! I forgot you are running MythTV 30.0 which is missing some
>>> fixes. It's
>>> difficult to keep track of all the changes in MythTV and Zoneminder
>>> and what
>>> is compatible with what at least that's my excuse :)
>>>
>>> Only current master looks in /etc/zm/conf.d/01-system-paths.conf for
>>> the
>>> ZM_PATH_MAP setting. Older versions only look in /etc/zm.conf or the
>>> location you tell it to load the config from when you pass a -c
>>> command line
>>> parameter to mythzmserver.
>>>
>>>
>>> You will have to either copy the ZM_PATH_MAP setting to
>>> /etc/zm/zm.conf or
>>> you could create a custom copy of /etc/zm/zm.conf specifically for
>>> mythzmserver to use and add the ZM_PATH_MAP setting then tell
>>> mythzmserver
>>> to use your custom zm.conf file using the -c parameter.
>> Ok, added:
>>
>> ZM_PATH_MAP=/dev/shm
>> ZM_VERSION=1.32.3
>>
>> to the end of /etc/zm/zm.conf but I still get this non-stop when in
>> "Show Live View":
>>
>> 2021-04-27 21:58:43.779205 E  The server failed to process the
>> command. The error was:-
>>                          ERROR - Cannot get shared memory pointers
>>
>> and I get the test pattern on the frontend.
>>
>> Of interest regarding shared memory, mythzmserver gives this:
>>
>> getZMSetting: ZM_SHM_KEY Result: 0x7a6d0000
>> Shared memory key is: 0x7a6d0000
>> Failed to get mysql row
>> getZMSetting: ZM_PATH_MAP Result:
>> Memory path directory is:
>>
>> It is strange that it finds a ZM_SHM_KEY but then the "ZM_PATH_MAP
>> Result:" is empty, and the "Memory path directory is:" is also empty.
>>
>> And then:
>>
>> Failed to open mmap file [/zm.mmap.2] for monitor: 2 : No such file
>> or directory
>> Falling back to the legacy shared memory method
>> Failed to shmget for monitor: 2
>> ENOENT - no segment exists for the given key
>>
>> So it looks like even though it has a shared memory key and the
>> ZM_PATH_MAP=/dev/shm parameter is in /etc/zm/zm.conf it is still not
>> finding the file and reverting to "the legacy shared memory method".
>> It certainly looks like mythzmserver is ignoring the ZM_PATH_MAP
>> variable.  Is it using the "legacy ahared memory method" and that is
>> what is causing the memory pointer errors?
>>
>
> Yes for some reason it's not finding the ZM_PATH_MAP setting in the
> config file and falling back to reading the setting from the DB which
> also fails because that setting is no longer in the database.
>
> I'd rather not mess with the ZM database but Plan B might be to
> temporarily add the setting to the Config table I think it is so at
> least when it fails to find it in the config file it can fall back to
> the setting from the DB. Plan C would be to just default to using
> '/dev/shm' if all else fails which is a good default for Ubuntu and
> debian at least.
>
> Let me do some more digging and I will get back to you when I'm less
> tired.
>
>
>
> Paul H.
>
>

OK unfortunately MythTV 30.0 is just too old to support ZoneMinder
1.32.3 because it's missing some crucial commits that added support for
that version of ZM which is why you are having so many problems.

One crucial commit is this one that added support for ZoneMinder 1.32.x
https://github.com/MythTV/mythtv/commit/d8eb7f78283d .

So if you want to use ZM 1.32.3 you need MythTV 31.0 or later. Sorry I
should have picked that up earlier. Like I said keeping up with what
version of ZM is compatible with what version of MythTV is a bit of a
nightmare.


Paul H.


_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Mythzmserver DB problems. Was: doesn't start:... [ In reply to ]
On Thu, Apr 29, 2021 at 10:43:41PM +0100, Paul Harrison wrote:
> On 29/04/2021 00:15, Paul Harrison wrote:
>...
> OK unfortunately MythTV 30.0 is just too old to support ZoneMinder 1.32.3
> because it's missing some crucial commits that added support for that
> version of ZM which is why you are having so many problems.
>
> One crucial commit is this one that added support for ZoneMinder 1.32.x
> https://github.com/MythTV/mythtv/commit/d8eb7f78283d .

Lots of changes...

> So if you want to use ZM 1.32.3 you need MythTV 31.0 or later. Sorry I
> should have picked that up earlier. Like I said keeping up with what version
> of ZM is compatible with what version of MythTV is a bit of a nightmare.

Not a problem. Thanks for looking into it and clarifying. Looks like
the easiest path is to upgrade to bullseye when it becomes stable, which
hopefully will be relatively soon.

Augustine
_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Mythzmserver DB problems. Was: doesn't start:... [ In reply to ]
On 30/04/2021 03:06, A. F. Cano wrote:

> On Thu, Apr 29, 2021 at 10:43:41PM +0100, Paul Harrison wrote:
>> On 29/04/2021 00:15, Paul Harrison wrote:
>> ...
>> OK unfortunately MythTV 30.0 is just too old to support ZoneMinder 1.32.3
>> because it's missing some crucial commits that added support for that
>> version of ZM which is why you are having so many problems.
>>
>> One crucial commit is this one that added support for ZoneMinder 1.32.x
>> https://github.com/MythTV/mythtv/commit/d8eb7f78283d .
> Lots of changes...
>
>> So if you want to use ZM 1.32.3 you need MythTV 31.0 or later. Sorry I
>> should have picked that up earlier. Like I said keeping up with what version
>> of ZM is compatible with what version of MythTV is a bit of a nightmare.
> Not a problem. Thanks for looking into it and clarifying. Looks like
> the easiest path is to upgrade to bullseye when it becomes stable, which
> hopefully will be relatively soon.
>
> Augustine


Don't know how comfortable you are with compiling your own source but
because mythzmserver can be complied standalone without needing MythTV
or QT to be installed you could easily  compile a newer version that has
support for ZM 1.32.3 and just replace your existing mythzmserver with
the newly complied one.


You would  grab one of the releases from
https://github.com/MythTV/mythtv/releases and unzip the source.


You would then change into the mythzmserver directory and do the 'make
-f Makefile.standalone' and then copy the mythzmserver executable over
your existing one. No need to compile the rest of MythTV it's not needed.


Paul H.



_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Mythzmserver DB problems. Was: doesn't start:... [ In reply to ]
On Wed, May 05, 2021 at 05:05:13PM +0100, Paul Harrison wrote:
> ...
> Don't know how comfortable you are with compiling your own source but
> because mythzmserver can be complied standalone without needing MythTV or QT
> to be installed you could easily? compile a newer version that has support
> for ZM 1.32.3 and just replace your existing mythzmserver with the newly
> complied one.
>
>
> You would? grab one of the releases from
> https://github.com/MythTV/mythtv/releases and unzip the source.
>
>
> You would then change into the mythzmserver directory and do the 'make -f
> Makefile.standalone' and then copy the mythzmserver executable over your
> existing one. No need to compile the rest of MythTV it's not needed.

That was easy! Got it compiled and running in minutes. I now get the
live view, but the image is stretched vertically. The one camera is
running in Monitor mode and the ZoneMinder Console shows it with
Function "Monitor [R]" and Source "/dev/video0(0) [S]" is it normal
for the source being "[S] Stopped"? It seems that the console is just to
see the status and nothing can be controlled from it, right?

What configuration do I need to do to get the live view with the proper
aspect ratio?

Thanks!

Augustine
_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Mythzmserver DB problems. Was: doesn't start:... [ In reply to ]
On 06/05/2021 03:00, A. F. Cano wrote:
> On Wed, May 05, 2021 at 05:05:13PM +0100, Paul Harrison wrote:
>> ...
>> Don't know how comfortable you are with compiling your own source but
>> because mythzmserver can be complied standalone without needing MythTV or QT
>> to be installed you could easily? compile a newer version that has support
>> for ZM 1.32.3 and just replace your existing mythzmserver with the newly
>> complied one.
>>
>>
>> You would? grab one of the releases from
>> https://github.com/MythTV/mythtv/releases and unzip the source.
>>
>>
>> You would then change into the mythzmserver directory and do the 'make -f
>> Makefile.standalone' and then copy the mythzmserver executable over your
>> existing one. No need to compile the rest of MythTV it's not needed.
>
> That was easy! Got it compiled and running in minutes. I now get the
> live view, but the image is stretched vertically. The one camera is
> running in Monitor mode and the ZoneMinder Console shows it with
> Function "Monitor [R]" and Source "/dev/video0(0) [S]" is it normal
> for the source being "[S] Stopped"? It seems that the console is just to
> see the status and nothing can be controlled from it, right?
>
> What configuration do I need to do to get the live view with the proper
> aspect ratio?
>
Everything can be done from the console! Hint: much of that line is highlighted against each camera
and is a link to a function.

Click the camera name to get a live view. Click the Source item to see the configuration for that
source. Click any non-zero number to the right to see selections of the recorded events.

--

Mike Perkins

_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Mythzmserver DB problems. Was: doesn't start:... [ In reply to ]
On 06/05/2021 03:00, A. F. Cano wrote:

> On Wed, May 05, 2021 at 05:05:13PM +0100, Paul Harrison wrote:
>> ...
>> Don't know how comfortable you are with compiling your own source but
>> because mythzmserver can be complied standalone without needing MythTV or QT
>> to be installed you could easily  compile a newer version that has support
>> for ZM 1.32.3 and just replace your existing mythzmserver with the newly
>> complied one.
>>
>>
>> You would  grab one of the releases from
>> https://github.com/MythTV/mythtv/releases and unzip the source.
>>
>>
>> You would then change into the mythzmserver directory and do the 'make -f
>> Makefile.standalone' and then copy the mythzmserver executable over your
>> existing one. No need to compile the rest of MythTV it's not needed.
> That was easy! Got it compiled and running in minutes. I now get the
> live view, but the image is stretched vertically. The one camera is
> running in Monitor mode and the ZoneMinder Console shows it with
> Function "Monitor [R]" and Source "/dev/video0(0) [S]" is it normal
> for the source being "[S] Stopped"? It seems that the console is just to
> see the status and nothing can be controlled from it, right?
>
> What configuration do I need to do to get the live view with the proper
> aspect ratio?
>
> Thanks!
>
> Augustine


With a camera highlighted you can press MENU (M) to show a dialog where
you can enable/disable a camera or change it's function Modect, Monitor,
Record etc just like you can do in the ZM web interface. You can also
toggle on/off the notification function. If your camera is using one of
the functions like Modect that detect motion then when ZM changes it's
status to Alert or Alarm MythTV with show a popup showing the camera.
Can be useful to see when there is activity on a camera but can get
annoying if you get a lot of false alarms caused by wind/rain etc. Also
unfortunately the current architecture of the MythTV video player means
the popup wont work when playing something :(


The aspect ratio thing is a known problem. Back when the plugin was
created most if not all camera's captured in 4:3 aspect ratio. I think
it was only when ZM added support for IP cameras some of which can
capture at 16:9 did it become a problem. Since it's not something that
really bothers me I've not really looked in detail at what needs to be
done to fix it properly. If you only have one camera and it always
capture in 16:9 you could probably just make the size of the image in
the theme you use have an aspect of 16:9 for now.


Paul H.

_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Mythzmserver DB problems. Was: doesn't start:... [ In reply to ]
On Thu, May 06, 2021 at 09:50:04AM +0100, Mike Perkins wrote:
> On 06/05/2021 03:00, A. F. Cano wrote:
> >...
> > That was easy! Got it compiled and running in minutes. I now get the
> > live view, but the image is stretched vertically. The one camera is
> > running in Monitor mode and the ZoneMinder Console shows it with
> > Function "Monitor [R]" and Source "/dev/video0(0) [S]" is it normal
> > for the source being "[S] Stopped"? It seems that the console is just to
> > see the status and nothing can be controlled from it, right?
> >
> > What configuration do I need to do to get the live view with the proper
> > aspect ratio?
> >
> Everything can be done from the console! Hint: much of that line is
> highlighted against each camera and is a link to a function.

Mmm... I must have something not quite right. To be sure it wasn't an
issue of versions (mythzmserver from v31 and the rest v30) I installed
mythtv v31 from deb-multimedia.org on a machine that was running
bullseye. Very minimal myth config, just the paths to let the server run
since there's no tuner connected to that machine. I see the same
behavior. The live view is stretched horizontally on this new machine.
The camera is only 640x480.

> Click the camera name to get a live view. Click the Source item to see the

This doesn't work on either machine.

> configuration for that source. Click any non-zero number to the right to see

Neither does this (in monitor mode), the source says [S} (stopped).

> selections of the recorded events.

I have no events at this time, the only thing that works on either
machine is the menu command, that brings the "Edit Monitor Function"
pop-up (in the Show Console window). In "Show Live view", the menu
command brings up the pop-up with "Change View" and "Change Camera 1"
"Chenge View" cycles through 1, 2, 4, 6, 8 views of the same camera 1
input, suitably stretched. "Change Camera 1" does nothing.

Thanks for the input, at least I have enough functionality to have
aatisfied my curiosity. I'll keep trying things as time permits.

Augustine
_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org

1 2  View All