[SOLVED] Deep storage scheme support not working?

Forum for questions and support relating to the 1.34.x releases only.
Post Reply
discostew
Posts: 4
Joined: Fri Apr 16, 2021 4:55 pm

[SOLVED] Deep storage scheme support not working?

Post by discostew »

Hi ZoneMinder forums - new registered user / first post.

I've been using the Deep Storage scheme for events since the early releases of v1.30.x (and even before this - v1.28 even?). A few months ago I upgraded one of my v1.30 installs to v1.34.x while retaining the Deep Storage directory structure of my historical event image data. The upgrade went well and all historical event data was retained and has been working well.

I'm currently subscribed to the 1.34 Focal PPA, and at some time in the past few weeks I was upgraded to a new minor release of 1.34. It now appears that Deep Storage might be having some issues? The Storage Scheme on my Default storage was set to 'Medium' at some point - I have since switched it to 'Deep', however it appears to still be recording using the 'Medium' file structure. I am currently running v1.34.25 on this machine.

There may also be a new issue with zmaudit and Deep Storage (e.g. not being able to find event data when comparing against database event records, deleting events stored in Deep Storage structure), however I cannot confirm / repeat this at the time. I am seeing many log entries regarding StorageId, and that the StorageId on events is being 'corrected' from '0' to '0':
Use of uninitialized value in concatenation (.) or string at /usr/bin/zmaudit.pl line 312.
zmaudit[111751].INF [main:312] [Correcting StorageId for event 43448 from 0 /var/cache/zoneminder/events/1/20/12/26/07/28/04 to 0 /var/cache/zoneminder/events/1/20/12/26/07/28/04]
These log entries from zmaudit are being produced for events every run of zmaudit - even after the correction to StorageId has been made by zmaudit.

I would like to keep using Deep Storage - I was wondering if anyone is still using Deep and if it is working well for them? Does anyone know why my new events are being stored using the Medium scheme even tho I have storage set to Deep?

Thanks in advance for your help!
Last edited by discostew on Mon Apr 26, 2021 3:58 pm, edited 1 time in total.
User avatar
iconnor
Posts: 2880
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: Deep storage scheme support not working?

Post by iconnor »

You can keep using Deep Storage.

What you should do is turn off zmaudit.
discostew
Posts: 4
Joined: Fri Apr 16, 2021 4:55 pm

Re: Deep storage scheme support not working?

Post by discostew »

Thank you for the quick response.

I did turn off zmaudit, however the real question of my post is why is ZM storing events in what appears to be the 'Medium' scheme, when I have the 'Deep' scheme enabled (Default storage entry)?

It appears that ZM might be ignoring the storage scheme selected and just using Medium instead?
User avatar
iconnor
Posts: 2880
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: Deep storage scheme support not working?

Post by iconnor »

Your monitors aren't assigned to a storage area, hence they have a storage value of 0. The entry in the storage table likely has a value of 1.

THe issue is compounded on some browsers by having the dropdown show like Default is selected when in fact nothing is selected.
discostew
Posts: 4
Joined: Fri Apr 16, 2021 4:55 pm

Re: Deep storage scheme support not working?

Post by discostew »

Thank you again for the quick reply!

In the storage table my monitors have a storage value of '0'

Code: Select all

select Id, ServerId, StorageId from Monitors;
+----+----------+-----------+
| Id | ServerId | StorageId |
+----+----------+-----------+
|  1 |        0 |         0 |
|  2 |        0 |         0 |
+----+----------+-----------+

And the Id for Default storage with the Deep storage scheme is '0':

Code: Select all

select Id, Path, Name, Type, Url, Scheme, ServerId from Storage;
+----+------------------------------+---------+-------+------+--------+----------+
| Id | Path                         | Name    | Type  | Url  | Scheme | ServerId |
+----+------------------------------+---------+-------+------+--------+----------+
|  0 | /var/cache/zoneminder/events | Default | local | NULL | Deep   |     NULL |
+----+------------------------------+---------+-------+------+--------+----------+
User avatar
iconnor
Posts: 2880
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: Deep storage scheme support not working?

Post by iconnor »

This is obviously a long running system.

So way back when I was last thinking about this situation, I flip flopped for a bit. I decided that empty or 0 would be a special case. Later I decided that special cases were bad. (Issues between fresh installs and updates compounded the decision make process).

So anyways there are lots of cases in the code where StorageId==0 is a special case.

So I might suggest that you manually update your db, to set them to 1.

Update Storage set Id=1 where Id=0;
Update Monitors Set StorageId=1 where StorageId=0;

restart and see what happens. Maybe make sure you have backups of the db.
discostew
Posts: 4
Joined: Fri Apr 16, 2021 4:55 pm

Re: Deep storage scheme support not working?

Post by discostew »

Thank you so much iconnor!

Switching the storage IDs from zero to one fixed it. New events are now being stored using deep storage once again, and zmaudit.pl is happy as well - no new warnings / log messages.

Thank you!
Post Reply