What steps will reproduce the problem?
1. install prosody 13.0.1-1~bpo12+1 (bookworm-backports/main amd64)
2. have a some users with status connected ?
3. service prosody stop
What is the expected output?
no Traceback
What do you see instead?
...
Apr 14 12:56:03 datamanager debug Loading index for (*redacted*@mdc.intranet/archive)
Apr 14 12:56:03 runnerTzHRvUhqTRus debug changed state from ready to error (ready) [(nil) (nil)]
Apr 14 12:56:03 c2s55a2cb432780 error Traceback[c2s]: /usr/lib/prosody/modules/mod_storage_internal.lua:204: attempt to index a nil value (local 'item')
stack traceback:
/usr/lib/prosody/modules/mod_storage_internal.lua:204: in local 'test'
/usr/lib/prosody/modules/mod_storage_internal.lua:139: in upvalue 'binary_search'
/usr/lib/prosody/modules/mod_storage_internal.lua:203: in method 'find'
/usr/lib/prosody/modules/mod_mam/mod_mam.lua:163: in field '?'
/usr/lib/prosody/util/events.lua:81: in function </usr/lib/prosody/util/events.lua:77>
(...tail calls...)
/usr/lib/prosody/util/events.lua:81: in function </usr/lib/prosody/util/events.lua:77>
(...tail calls...)
/usr/lib/prosody/core/stanza_router.lua:189: in upvalue 'core_post_stanza'
/usr/lib/prosody/core/stanza_router.lua:128: in upvalue 'core_process_stanza'
/usr/lib/prosody/modules/mod_c2s.lua:366: in upvalue 'func'
/usr/lib/prosody/util/async.lua:149: in function </usr/lib/prosody/util/async.lua:147>
Apr 14 12:56:03 runnerTzHRvUhqTRus debug creating new coroutine
...
What version of the product are you using? On what operating system?
Package: prosody
Version: 13.0.1-1~bpo12+1 (bookworm-backports/main amd64)
lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 12 (bookworm)
Release: 12
Codename: bookworm
Please provide any additional information below.
Incompatible data/states from previous version (0.12.3-1) ?
But this does not prevent the full stop of the service.
Regards.
Zash
on
Thanks for the report.
From the line numbers, this seems to be in the middle of a MAM query.
There should have been a debug message describing query parameters, "Archive query by JID id=... with=...", please include this as well (without real JID is fine)
Not sure how this relates to the shutdown. Could you include some logs that show when the shutdown starts in relation to this?
Could you also download https://prosody.im/files/check-internal-archive.lua and run it like `sudo -u prosody lua check-internal-archive.lua /var/lib/prosody JID` with the same user@host as in the log above?
Changes
tags Status-NeedInfo Milestone-0.13
Zaak
on
# pwd
/var/lib/prosody/mdc%2eintranet
# grep -c ^item archive/*.list
archive/d01.list:34
archive/d02.list:267
archive/g01.list:149
archive/j01.list:55
archive/l01.list:79
archive/m01.list:68
archive/q01.list:17
archive/r01.list:102
archive/s01.list:64
archive/z01.list:270
# cat /var/log/prosody/prosody.log
...
Apr 14 12:56:03 c2s55a2cb432780 debug Received[c2s]: <iq type='set' id='B8A609FF-91D8-4888-878C-0C2ED96D64E6' xml:lang='en'>
Apr 14 12:56:03 mdc.intranet:mam debug Archive query by *redacted* id=690D500E-9DF8-4F0B-8D0D-7679A25CD11D with=* when=2025-04-10T11:45:25.059999Z... rsm={max=150}
Apr 14 12:56:03 datamanager debug Loading index for (*redacted*@mdc.intranet/archive)
Apr 14 12:56:03 runnerTzHRvUhqTRus debug changed state from ready to error (ready) [(nil) (nil)]
Apr 14 12:56:03 c2s55a2cb432780 error Traceback[c2s]: /usr/lib/prosody/modules/mod_storage_internal.lua:204: attempt to index a nil value (local 'item')
...
# lua -v
Lua 5.4.4 Copyright (C) 1994-2022 Lua.org, PUC-Rio
(on 0.12.3-1)
# su -l prosody lua check-internal-archive.lua /var/lib/prosody d02@mdc.intranet
(nothing reported)
# echo $?
1
# for u in *redacted list*; do su -l prosody lua check-internal-archive.lua /var/lib/prosody $u@mdc.intranet; done
(nothing reported)
Zaak
on
Removing user.lidx file in archive folder fixed the traceback issued on service teardown for 13.0.1-1~bpo12+1.
Thank Zash
Zash
on
Closing as the issue has been resolved and was caused by downgrading, resulting in the archive and the index file no longer being in sync.
It would be nice to increase robustness against this kind of issue.
What steps will reproduce the problem? 1. install prosody 13.0.1-1~bpo12+1 (bookworm-backports/main amd64) 2. have a some users with status connected ? 3. service prosody stop What is the expected output? no Traceback What do you see instead? ... Apr 14 12:56:03 datamanager debug Loading index for (*redacted*@mdc.intranet/archive) Apr 14 12:56:03 runnerTzHRvUhqTRus debug changed state from ready to error (ready) [(nil) (nil)] Apr 14 12:56:03 c2s55a2cb432780 error Traceback[c2s]: /usr/lib/prosody/modules/mod_storage_internal.lua:204: attempt to index a nil value (local 'item') stack traceback: /usr/lib/prosody/modules/mod_storage_internal.lua:204: in local 'test' /usr/lib/prosody/modules/mod_storage_internal.lua:139: in upvalue 'binary_search' /usr/lib/prosody/modules/mod_storage_internal.lua:203: in method 'find' /usr/lib/prosody/modules/mod_mam/mod_mam.lua:163: in field '?' /usr/lib/prosody/util/events.lua:81: in function </usr/lib/prosody/util/events.lua:77> (...tail calls...) /usr/lib/prosody/util/events.lua:81: in function </usr/lib/prosody/util/events.lua:77> (...tail calls...) /usr/lib/prosody/core/stanza_router.lua:189: in upvalue 'core_post_stanza' /usr/lib/prosody/core/stanza_router.lua:128: in upvalue 'core_process_stanza' /usr/lib/prosody/modules/mod_c2s.lua:366: in upvalue 'func' /usr/lib/prosody/util/async.lua:149: in function </usr/lib/prosody/util/async.lua:147> Apr 14 12:56:03 runnerTzHRvUhqTRus debug creating new coroutine ... What version of the product are you using? On what operating system? Package: prosody Version: 13.0.1-1~bpo12+1 (bookworm-backports/main amd64) lsb_release -a No LSB modules are available. Distributor ID: Debian Description: Debian GNU/Linux 12 (bookworm) Release: 12 Codename: bookworm Please provide any additional information below. Incompatible data/states from previous version (0.12.3-1) ? But this does not prevent the full stop of the service. Regards.
Thanks for the report. From the line numbers, this seems to be in the middle of a MAM query. There should have been a debug message describing query parameters, "Archive query by JID id=... with=...", please include this as well (without real JID is fine) Not sure how this relates to the shutdown. Could you include some logs that show when the shutdown starts in relation to this? Could you also download https://prosody.im/files/check-internal-archive.lua and run it like `sudo -u prosody lua check-internal-archive.lua /var/lib/prosody JID` with the same user@host as in the log above?
Changes# pwd /var/lib/prosody/mdc%2eintranet # grep -c ^item archive/*.list archive/d01.list:34 archive/d02.list:267 archive/g01.list:149 archive/j01.list:55 archive/l01.list:79 archive/m01.list:68 archive/q01.list:17 archive/r01.list:102 archive/s01.list:64 archive/z01.list:270 # cat /var/log/prosody/prosody.log ... Apr 14 12:56:03 c2s55a2cb432780 debug Received[c2s]: <iq type='set' id='B8A609FF-91D8-4888-878C-0C2ED96D64E6' xml:lang='en'> Apr 14 12:56:03 mdc.intranet:mam debug Archive query by *redacted* id=690D500E-9DF8-4F0B-8D0D-7679A25CD11D with=* when=2025-04-10T11:45:25.059999Z... rsm={max=150} Apr 14 12:56:03 datamanager debug Loading index for (*redacted*@mdc.intranet/archive) Apr 14 12:56:03 runnerTzHRvUhqTRus debug changed state from ready to error (ready) [(nil) (nil)] Apr 14 12:56:03 c2s55a2cb432780 error Traceback[c2s]: /usr/lib/prosody/modules/mod_storage_internal.lua:204: attempt to index a nil value (local 'item') ... # lua -v Lua 5.4.4 Copyright (C) 1994-2022 Lua.org, PUC-Rio (on 0.12.3-1) # su -l prosody lua check-internal-archive.lua /var/lib/prosody d02@mdc.intranet (nothing reported) # echo $? 1 # for u in *redacted list*; do su -l prosody lua check-internal-archive.lua /var/lib/prosody $u@mdc.intranet; done (nothing reported)
Removing user.lidx file in archive folder fixed the traceback issued on service teardown for 13.0.1-1~bpo12+1. Thank Zash
Closing as the issue has been resolved and was caused by downgrading, resulting in the archive and the index file no longer being in sync. It would be nice to increase robustness against this kind of issue.
Changes