Got ValueError access error: RELOGIN

Discussion topics related to mobile applications and ZoneMinder Event Server (including machine learning)
Post Reply
sitruc
Posts: 4
Joined: Sun Jun 05, 2022 1:29 am

Got ValueError access error: RELOGIN

Post by sitruc »

ZM: 1.36.33
Running mlapi in a VM with the time_sequence commented out in mlapiconf.ini

works fine when in objectconfig.ini :

Code: Select all

stream_sequence = {
                'delay':5,
                'frame_strategy': 'most_models',
                'frame_set': 'snapshot,alarm',
                'contig_frames_before_error': 5,
                'max_attempts': 3,
                'sleep_between_attempts': 4,
                'resize':800

        }
However, if I add a specific frame id like so:

Code: Select all

stream_sequence = {
                'delay':5,
                'frame_strategy': 'most_models',
                'frame_set': 'snapshot,alarm,41',
                'contig_frames_before_error': 5,
                'max_attempts': 3,
                'sleep_between_attempts': 4,
                'resize':800

        }
        
I get the following errors in mlapi.log after the alarm frame detetion has completed:

Code: Select all

Mar 07 2024 08:56:10.795172 [DBG 3] Reading https://zoneminder.home.arpa/zm/index.php?view=image&eid=375031&fid=41
Mar 07 2024 08:56:10.795209 [DBG 3] No need to relogin as access token still has 119.2435996 minutes remaining
Mar 07 2024 08:56:10.795227 [DBG 3] make_request called with url=https://zoneminder.home.arpa/zm/index.php?view=image&eid=375031&fid=41 payload={} type=get query={'token': 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJab25lTWluZGVyIiwiaWF0IjoxNzA5ODMwNTI1LCJleHAiOjE3MDk4Mzc3MjUsInVzZXIiOiJtbGFwaSIsInR5cGUiOiJhY2Nlc3MifQ.yj4CeKlc_hUpoLm06GQFMb7nlmdHm6Y7O2oNUYOIIwM'}
Mar 07 2024 08:56:10.817070 [DBG 2] Raising RELOGIN ValueError
Mar 07 2024 08:56:10.817119 [DBG 1] Got ValueError access error: RELOGIN
Mar 07 2024 08:56:10.817148 [DBG 1] Retrying login once
Mar 07 2024 08:56:10.817172 [DBG 2] Going to use refresh token as it still has 1439.2432338666665 minutes remaining
Mar 07 2024 08:56:10.817198 [DBG 1] Using token for login [eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJab25lTWluZGVyIiwiaWF0IjoxNzA5ODMwNTI1LCJleHAiOjE3MDk5MTY5MjUsInVzZXIiOiJtbGFwaSIsInR5cGUiOiJyZWZyZXNoIn0._9mtB7naBPnQ1O3hcryXMlpbJKLiJsWk9tfGIYzCeqg]
Mar 07 2024 08:56:10.837761 [DBG 1] {"access_token":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJab25lTWluZGVyIiwiaWF0IjoxNzA5ODMwNTcwLCJleHAiOjE3MDk4Mzc3NzAsInVzZXIiOiJtbGFwaSIsInR5cGUiOiJhY2Nlc3MifQ.LoIYnVkbPkp_TbVecJ8-4XAmkDyDR0zY3e6RvLHiN4I","access_token_expires":7200,"credentials":"auth=","append_password":0,"version":"1.36.33","apiversion":"2.0"}
Mar 07 2024 08:56:10.837823 [DBG 2] Using new token API
Mar 07 2024 08:56:10.837843 [DBG 1] Access token expires on:2024-03-07 10:56:10.837834 [7200s]
Mar 07 2024 08:56:10.837859 [DBG 1] Retrying failed request again...
Mar 07 2024 08:56:10.837885 [DBG 3] No need to relogin as access token still has 119.99999943333334 minutes remaining
Mar 07 2024 08:56:10.837948 [DBG 3] make_request called with url=https://zoneminder.home.arpa/zm/index.php?view=image&eid=375031&fid=41 payload={} type=get query={'token': 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJab25lTWluZGVyIiwiaWF0IjoxNzA5ODMwNTcwLCJleHAiOjE3MDk4Mzc3NzAsInVzZXIiOiJtbGFwaSIsInR5cGUiOiJhY2Nlc3MifQ.LoIYnVkbPkp_TbVecJ8-4XAmkDyDR0zY3e6RvLHiN4I'}
Mar 07 2024 08:56:10.852460 [DBG 2] Raising RELOGIN ValueError
Mar 07 2024 08:56:10.852524 [DBG 1] Error reading frame: 1 of max 5 contiguous errors
Mar 07 2024 08:56:10.852538 [DBG 1] Reached end of frame_set
Mar 07 2024 08:56:10.852551 [DBG 1] Ran out of frames to read
Mar 07 2024 08:56:10.852563 [DBG 2] pyzm_uid0_tpu_lock portalock already released
Mar 07 2024 08:56:10.852594 [DBG 1] perf: TOTAL detection sequence (with image loads) took: 5200.09 ms  to process 375031
Mar 07 2024 08:56:10.852638 [DBG 1] Returning {'matched_data': {'boxes': [], 'error_boxes': [], 'labels': [], 'confidences': [], 'frame_id': None, 'model_names': [], 'image_dimensions': {'original': (480, 640), 'resized': (600, 800)}, 'image': None, 'polygons': [{'name': 'full_image', 'value': [(0, 0), (800, 0), (800, 600), (0, 600)], 'pattern': None}]}, 'all_matches': []}
My image has 2784 frames and no luck so far figuring out what's wrong????
dougmccrary
Posts: 1327
Joined: Sat Aug 31, 2019 7:35 am
Location: San Diego

Re: Got ValueError access error: RELOGIN

Post by dougmccrary »

Looks like the extra param (41) is not expected.
(spitballing here) Maybe frame41 or alarmframe41, if it's possible.
sitruc
Posts: 4
Joined: Sun Jun 05, 2022 1:29 am

Re: Got ValueError access error: RELOGIN

Post by sitruc »

UPDATE.

The only change I made was to add

Code: Select all

 'convert_snapshot_to_fid': 'yes'
to stream_sequence in ZMES objectconfig.ini and now its working this morning?!?

I wish there was clear documentation on how to properly use objectconfig.ini on my zm sever and mlapiconfig.ini on my mlapi server. They have duplicate settings. I'd like to clean them up and eliminate those settings which are handled by the other side.
Post Reply