Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error Initializing - attempt to set a global #4

Open
averyjparker opened this issue Dec 4, 2018 · 4 comments
Open

Error Initializing - attempt to set a global #4

averyjparker opened this issue Dec 4, 2018 · 4 comments

Comments

@averyjparker
Copy link

I'm trying to load the module, have the config variables set (I think) as they should be but on the prosody restart I see the following in the logfile.

Dec 04 01:32:49 modulemanager error Error initializing module 'roster_cloud' on 'im.domain.org': /usr/share/lua/5.2/ltn12.lua:15: Attempt to set a global: ltn12 = table: 0x203fa70
...ib/prosody/modules/mod_roster_cloud/mod_roster_cloud.lua:1: in main chunk

Any ideas?

@MarcelWaldvogel
Copy link
Contributor

Could it be that you do not have lua-socket available?

@averyjparker
Copy link
Author

Hmmm.. it appears to be there.

apt install lua-socket
Reading package lists... Done
Building dependency tree
Reading state information... Done
lua-socket is already the newest version (3.0~rc1+git+321c0c9-1).

This is on an ubuntu 16.0.4.5 system btw.

@averyjparker
Copy link
Author

Here's the full output in prosody.err

Dec 15 23:21:22 modulemanager error Error initializing module 'roster_cloud' on 'im.domain.org': /usr/share/lua/5.2/ltn12.lua:15: Attempt to set a global: ltn12 = table: 0xbe7460
stack traceback:
[C]: in function 'error'
/usr/lib/prosody/util/startup.lua:336: in function '__newindex'
/usr/share/lua/5.2/ltn12.lua:15: in main chunk
[C]: in function '_real_require'
/usr/lib/prosody/util/startup.lua:141: in function 'require'
/usr/share/lua/5.2/ssl/https.lua:11: in main chunk
[C]: in function '_real_require'
/usr/lib/prosody/util/startup.lua:141: in function 'require'
...ib/prosody/modules/mod_roster_cloud/mod_roster_cloud.lua:1: in main chunk
[C]: in function 'xpcall'
/usr/lib/prosody/core/modulemanager.lua:178: in function 'do_load_module'
/usr/lib/prosody/core/modulemanager.lua:256: in function 'load'
/usr/lib/prosody/core/modulemanager.lua:78: in function '?'
/usr/lib/prosody/util/events.lua:79: in function </usr/lib/prosody/util/events.lua:75>
(...tail calls...)
/usr/lib/prosody/core/hostmanager.lua:108: in function 'activate'
/usr/lib/prosody/core/hostmanager.lua:58: in function '?'
/usr/lib/prosody/util/events.lua:79: in function </usr/lib/prosody/util/events.lua:75>
(...tail calls...)
/usr/lib/prosody/util/startup.lua:327: in function 'prepare_to_start'
/usr/lib/prosody/util/startup.lua:548: in function 'f'
/usr/lib/prosody/util/async.lua:139: in function 'func'
/usr/lib/prosody/util/async.lua:127: in function </usr/lib/prosody/util/async.lua:125>

@MarcelWaldvogel
Copy link
Contributor

Thanks for the dump, that gives an entirely new perspective:

/usr/share/lua/5.2/ltn12.lua:15: Attempt to set a global: ltn12 = table: 0xbe7460

That means that ltn12.lua is executing, but cannot assign itself to the global variable. This seems to refer to the indented line in this code (Ubuntu 18.10):

local _M = {}
if module then -- heuristic for exporting a global package table
    ltn12 = _M
end

Why this does not work exceeds my meagre Lua/Prosody know-how (and a web search for the error message didn't reveal anything helpful, either).

Can anyone with more Lua/Prosody know-how help here? E.g. @DanScharon?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants