Ask Your Question

'Attempt to index global (a nil value)' when lua is in APPDATA directory

asked 2023-01-18 14:31:46 +0000

DavidA_2018 gravatar image


I am running Wireshark 4.0.2 on Windows 11.

I have 3 lua files that constitute our custom dissector. The top level lua file is general.lua which creates a protocol object:

xran_protocol = Proto("xran", "<snip>")

xran_protocol.prefs.c_plane_debug_level = Pref.enum("C-plane debug", 0, "C-plane debug printing level", debug_pref_enum, false)

A lower level lua file accesses that object:

debug_level = xran_protocol.prefs.c_plane_debug_level <--- A

If my lua files are in the global plugin folder:

"C:\Program Files\Wireshark\plugins\4.0"

it works fine. But if I move the lua files to the personal plugin folder:


line A above gives error:

Lua Error:\<name>\AppData\Roaming\Wireshark\plugins\cplane.lua:333: attempt to index global 'xran_protocol' (a nil value)

Please can you suggest why it works in the global folder but not in the personal folder?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2023-01-18 14:49:07 +0000

Chuckc gravatar image

updated 2023-01-18 14:50:21 +0000

edit flag offensive delete link more


Thank you.

DavidA_2018 gravatar imageDavidA_2018 ( 2023-01-18 14:58:20 +0000 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2023-01-18 14:31:46 +0000

Seen: 89 times

Last updated: Jan 18