11
29
Fork
You've already forked ipmitool
33

Could not enable event receiver: Invalid argument on static build (for ESXi) #20

Open
opened 2024年02月02日 14:57:52 +01:00 by glorang · 2 comments

I've compiled a static version of ipmitool based on latest source tree here (codeberg.org) available. Executing this on ESXi VMware 7 with an Intel BMC yields following error:

# ./ipmitool.static-1.8.19.19.gab5ce5b lan print 3
IANA PEN registry open failed: No such file or directory
Failed to load entries from IANA PEN Registry
Could not enable event receiver: Invalid argument

With strace:

# strace -f ./ipmitool.static-1.8.19.19.gab5ce5b lan print 3
execve("./ipmitool.static-1.8.19.19.gab5ce5b", ["./ipmitool.static-1.8.19.19.gab5"..., "lan", "print", "3"], [/* 18 vars */]) = 0
arch_prctl(0x3001 /* ARCH_??? */) = -1 EINVAL (Invalid argument)
brk(0) = 0xc9c7765000
brk(0xc9c7765e00) = 0xc9c7765e00
arch_prctl(ARCH_SET_FS, 0xc9c7765400) = 0
set_tid_address(0xc9c77656d0) = 2242671
set_robust_list(0xc9c77656e0, 0x18) = 0
syscall_334(0xc9c7765da0, 0x20, 0, 0x53053053, 0, 0x800, 0x6371c0, 0x6371c0, 0x6371c0, 0x6371c0, 0x6371c0, 0x6371c0, 0x6371c0, 0x6371c0, 0x6371c0, 0x6371c0, 0x6371c0, 0x6371c0, 0x6371c0, 0x6371c0, 0x6371c0, 0x6371c0, 0x6371c0, 0x6371c0, 0x6371c0, 0x6371c0, 0x6371c0, 0x6371c0, 0x6371c0, 0x6371c0, 0x6371c0, 0x6371c0) = -1 (errno 38)
uname({sys="VMkernel", node="SERVER.DOMAIN.COM", ...}) = 0
syscall_302(0, 0x3, 0, 0x329c3db8b70, 0x3, 0x800, 0x329c3db8c50, 0x329c3db8c50, 0x329c3db8c50, 0x329c3db8c50, 0x329c3db8c50, 0x329c3db8c50, 0x329c3db8c50, 0x329c3db8c50, 0x329c3db8c50, 0x329c3db8c50, 0x329c3db8c50, 0x329c3db8c50, 0x329c3db8c50, 0x329c3db8c50, 0x329c3db8c50, 0x329c3db8c50, 0x329c3db8c50, 0x329c3db8c50, 0x329c3db8c50, 0x329c3db8c50, 0x329c3db8c50, 0x329c3db8c50, 0x329c3db8c50, 0x329c3db8c50, 0x329c3db8c50, 0x329c3db8c50) = -1 (errno 38)
readlink("/proc/self/exe", 0x329c3db7ab0, 4096) = -1 EINVAL (Invalid argument)
syscall_318(0x6e9b10, 0x8, 0x1, 0x329c3db8b70, 0, 0x800, 0x329c3db8c50, 0x329c3db8c50, 0x329c3db8c50, 0x329c3db8c50, 0x329c3db8c50, 0x329c3db8c50, 0x329c3db8c50, 0x329c3db8c50, 0x329c3db8c50, 0x329c3db8c50, 0x329c3db8c50, 0x329c3db8c50, 0x329c3db8c50, 0x329c3db8c50, 0x329c3db8c50, 0x329c3db8c50, 0x329c3db8c50, 0x329c3db8c50, 0x329c3db8c50, 0x329c3db8c50, 0x329c3db8c50, 0x329c3db8c50, 0x329c3db8c50, 0x329c3db8c50, 0x329c3db8c50, 0x329c3db8c50) = 0x8
brk(0xc9c7786e00) = 0xc9c7786e00
brk(0xc9c7787000) = 0xc9c7787000
mprotect(0x637000, 81920, PROT_READ) = 0
openat(AT_FDCWD, "/usr/lib/locale/locale-archive", O_RDONLY|O_CLOEXEC) = 3
newfstatat(3, "", 0x6e5340, 0x1000 /* AT_??? */) = -1 EBADF (Bad file descriptor)
close(3) = 0
openat(AT_FDCWD, "/usr/share/locale/locale.alias", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/locale/en_US.UTF-8/LC_IDENTIFICATION", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/locale/en_US.utf8/LC_IDENTIFICATION", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/locale/en_US/LC_IDENTIFICATION", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/locale/en.UTF-8/LC_IDENTIFICATION", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/locale/en.utf8/LC_IDENTIFICATION", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/locale/en/LC_IDENTIFICATION", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
rt_sigaction(SIGINT, {0x440de0, [INT], SA_RESTORER|SA_RESTART, 0x4b6560}, {SIG_DFL, ~[KILL STOP RTMIN RT_1], 0}, 8) = 0
openat(AT_FDCWD, "//.local/usr/share/misc/enterprise-numbers", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/local/share/misc/enterprise-numbers", O_RDONLY) = -1 ENOENT (No such file or directory)
write(2, "IANA PEN registry open failed: N"..., 57IANA PEN registry open failed: No such file or directory
) = 57
write(2, "Failed to load entries from IANA"..., 46Failed to load entries from IANA PEN Registry
) = 46
openat(AT_FDCWD, "/dev/ipmi0", O_RDWR) = 3
ioctl(3, IPMICTL_SET_GETS_EVENTS_CMD, 0x329c3db897c) = -1 EINVAL (Invalid argument)
write(2, "Could not enable event receiver:"..., 50Could not enable event receiver: Invalid argument
) = 50
exit_group(1) = ?

After some trial & error I managed to get it up & running with 1.8.18 on the same machine so guess this is a bug in more recent versions?

# ./ipmitool.static -V
ipmitool.static version 1.8.18
# ./ipmitool.static lan print 3
Set in Progress : Set Complete
Auth Type Support : MD5 PASSWORD
Auth Type Enable : Callback :
 : User :
....

I've compiled the static versions as follows:

1.8.19.19.gab5ce5b

./bootstrap
LDFLAGS=-static ./configure --disable-intf-lanplus
make
cd src
/bin/bash ../libtool --silent --tag=CC --mode=link gcc -g -O2 -Wall -Wextra -std=gnu11 -pedantic -Wformat -Wformat-nonliteral -all-static -o ipmitool.static-1.8.19.19.gab5ce5b ipmitool.o ipmishell.o ../lib/libipmitool.la plugins/libintf.la -lcrypto -lreadline -ltinfo

I had to add -ltinfo manually otherwise it would not link but not sure if that is relevant to this issue

1.8.18

Latest source from SourceForge + Gentoo Patch #706870

./bootstrap
LDFLAGS=-static ./configure --disable-intf-lanplus
make
cd src
/bin/bash ../libtool --silent --tag=CC --mode=link gcc -g -O2 -Wall -Wextra -std=gnu99 -pedantic -Wformat -Wformat-nonliteral -all-static -o ipmitool.static ipmitool.o ipmishell.o ../lib/libipmitool.la plugins/libintf.la -lreadline -lncurses -ltinfo -lreadline -lncurses -ltinfo -lcrypto
I've compiled a static version of ipmitool based on latest source tree here (codeberg.org) available. Executing this on ESXi VMware 7 with an Intel BMC yields following error: ``` # ./ipmitool.static-1.8.19.19.gab5ce5b lan print 3 IANA PEN registry open failed: No such file or directory Failed to load entries from IANA PEN Registry Could not enable event receiver: Invalid argument ``` With strace: ``` # strace -f ./ipmitool.static-1.8.19.19.gab5ce5b lan print 3 execve("./ipmitool.static-1.8.19.19.gab5ce5b", ["./ipmitool.static-1.8.19.19.gab5"..., "lan", "print", "3"], [/* 18 vars */]) = 0 arch_prctl(0x3001 /* ARCH_??? */) = -1 EINVAL (Invalid argument) brk(0) = 0xc9c7765000 brk(0xc9c7765e00) = 0xc9c7765e00 arch_prctl(ARCH_SET_FS, 0xc9c7765400) = 0 set_tid_address(0xc9c77656d0) = 2242671 set_robust_list(0xc9c77656e0, 0x18) = 0 syscall_334(0xc9c7765da0, 0x20, 0, 0x53053053, 0, 0x800, 0x6371c0, 0x6371c0, 0x6371c0, 0x6371c0, 0x6371c0, 0x6371c0, 0x6371c0, 0x6371c0, 0x6371c0, 0x6371c0, 0x6371c0, 0x6371c0, 0x6371c0, 0x6371c0, 0x6371c0, 0x6371c0, 0x6371c0, 0x6371c0, 0x6371c0, 0x6371c0, 0x6371c0, 0x6371c0, 0x6371c0, 0x6371c0, 0x6371c0, 0x6371c0) = -1 (errno 38) uname({sys="VMkernel", node="SERVER.DOMAIN.COM", ...}) = 0 syscall_302(0, 0x3, 0, 0x329c3db8b70, 0x3, 0x800, 0x329c3db8c50, 0x329c3db8c50, 0x329c3db8c50, 0x329c3db8c50, 0x329c3db8c50, 0x329c3db8c50, 0x329c3db8c50, 0x329c3db8c50, 0x329c3db8c50, 0x329c3db8c50, 0x329c3db8c50, 0x329c3db8c50, 0x329c3db8c50, 0x329c3db8c50, 0x329c3db8c50, 0x329c3db8c50, 0x329c3db8c50, 0x329c3db8c50, 0x329c3db8c50, 0x329c3db8c50, 0x329c3db8c50, 0x329c3db8c50, 0x329c3db8c50, 0x329c3db8c50, 0x329c3db8c50, 0x329c3db8c50) = -1 (errno 38) readlink("/proc/self/exe", 0x329c3db7ab0, 4096) = -1 EINVAL (Invalid argument) syscall_318(0x6e9b10, 0x8, 0x1, 0x329c3db8b70, 0, 0x800, 0x329c3db8c50, 0x329c3db8c50, 0x329c3db8c50, 0x329c3db8c50, 0x329c3db8c50, 0x329c3db8c50, 0x329c3db8c50, 0x329c3db8c50, 0x329c3db8c50, 0x329c3db8c50, 0x329c3db8c50, 0x329c3db8c50, 0x329c3db8c50, 0x329c3db8c50, 0x329c3db8c50, 0x329c3db8c50, 0x329c3db8c50, 0x329c3db8c50, 0x329c3db8c50, 0x329c3db8c50, 0x329c3db8c50, 0x329c3db8c50, 0x329c3db8c50, 0x329c3db8c50, 0x329c3db8c50, 0x329c3db8c50) = 0x8 brk(0xc9c7786e00) = 0xc9c7786e00 brk(0xc9c7787000) = 0xc9c7787000 mprotect(0x637000, 81920, PROT_READ) = 0 openat(AT_FDCWD, "/usr/lib/locale/locale-archive", O_RDONLY|O_CLOEXEC) = 3 newfstatat(3, "", 0x6e5340, 0x1000 /* AT_??? */) = -1 EBADF (Bad file descriptor) close(3) = 0 openat(AT_FDCWD, "/usr/share/locale/locale.alias", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/usr/lib/locale/en_US.UTF-8/LC_IDENTIFICATION", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/usr/lib/locale/en_US.utf8/LC_IDENTIFICATION", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/usr/lib/locale/en_US/LC_IDENTIFICATION", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/usr/lib/locale/en.UTF-8/LC_IDENTIFICATION", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/usr/lib/locale/en.utf8/LC_IDENTIFICATION", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/usr/lib/locale/en/LC_IDENTIFICATION", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) rt_sigaction(SIGINT, {0x440de0, [INT], SA_RESTORER|SA_RESTART, 0x4b6560}, {SIG_DFL, ~[KILL STOP RTMIN RT_1], 0}, 8) = 0 openat(AT_FDCWD, "//.local/usr/share/misc/enterprise-numbers", O_RDONLY) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/usr/local/share/misc/enterprise-numbers", O_RDONLY) = -1 ENOENT (No such file or directory) write(2, "IANA PEN registry open failed: N"..., 57IANA PEN registry open failed: No such file or directory ) = 57 write(2, "Failed to load entries from IANA"..., 46Failed to load entries from IANA PEN Registry ) = 46 openat(AT_FDCWD, "/dev/ipmi0", O_RDWR) = 3 ioctl(3, IPMICTL_SET_GETS_EVENTS_CMD, 0x329c3db897c) = -1 EINVAL (Invalid argument) write(2, "Could not enable event receiver:"..., 50Could not enable event receiver: Invalid argument ) = 50 exit_group(1) = ? ``` After some trial & error I managed to get it up & running with 1.8.18 on the same machine so guess this is a bug in more recent versions? ``` # ./ipmitool.static -V ipmitool.static version 1.8.18 # ./ipmitool.static lan print 3 Set in Progress : Set Complete Auth Type Support : MD5 PASSWORD Auth Type Enable : Callback : : User : .... ``` I've compiled the static versions as follows: *1.8.19.19.gab5ce5b* ``` ./bootstrap LDFLAGS=-static ./configure --disable-intf-lanplus make cd src /bin/bash ../libtool --silent --tag=CC --mode=link gcc -g -O2 -Wall -Wextra -std=gnu11 -pedantic -Wformat -Wformat-nonliteral -all-static -o ipmitool.static-1.8.19.19.gab5ce5b ipmitool.o ipmishell.o ../lib/libipmitool.la plugins/libintf.la -lcrypto -lreadline -ltinfo ``` I had to add `-ltinfo` manually otherwise it would not link but not sure if that is relevant to this issue *1.8.18* Latest source from SourceForge + [Gentoo Patch #706870](https://706870.bugs.gentoo.org/attachment.cgi?id=649446) ``` ./bootstrap LDFLAGS=-static ./configure --disable-intf-lanplus make cd src /bin/bash ../libtool --silent --tag=CC --mode=link gcc -g -O2 -Wall -Wextra -std=gnu99 -pedantic -Wformat -Wformat-nonliteral -all-static -o ipmitool.static ipmitool.o ipmishell.o ../lib/libipmitool.la plugins/libintf.la -lreadline -lncurses -ltinfo -lreadline -lncurses -ltinfo -lcrypto ```

The difference I see so far is this:

- int i = 0;
-
...
- if (ioctl(intf->fd, IPMICTL_SET_GETS_EVENTS_CMD, &i) < 0) {
+ int receive_events = TRUE;
+
+ if (ioctl(intf->fd, IPMICTL_SET_GETS_EVENTS_CMD, &receive_events) < 0) {

That is, in 1.8.18 the ioctl was called with the argument 0 and now it is called with the same argument set to TRUE (1).
Can you please check if changing TRUE to FALSE fixes it for you?

The change was intentionally introduced by commit c70665c3d1, and it looks like your ipmi driver doesn't support receiving the events which this new line attempts to enable.

It doesn't look like an ipmitool bug though. More like a problem of ESXi 7 that, in my experience, is abundant in various issues

The difference I see so far is this: ```diff - int i = 0; - ... - if (ioctl(intf->fd, IPMICTL_SET_GETS_EVENTS_CMD, &i) < 0) { + int receive_events = TRUE; + + if (ioctl(intf->fd, IPMICTL_SET_GETS_EVENTS_CMD, &receive_events) < 0) { ``` That is, in 1.8.18 the `ioctl` was called with the argument `0` and now it is called with the same argument set to `TRUE` (`1`). Can you please check if changing `TRUE` to `FALSE` fixes it for you? The change was intentionally introduced by commit c70665c3d1ae8d19634eb2ea386d1065a4cff506, and it looks like your ipmi driver doesn't support receiving the events which this new line attempts to enable. It doesn't look like an `ipmitool` bug though. More like a problem of ESXi 7 that, in my experience, is abundant in various issues

If you're willing to, I can suggest you prepare a PR with some conditional compilation directives around the new code to make it behave the old way for ESXi 7

If you're willing to, I can suggest you prepare a PR with some conditional compilation directives around the new code to make it behave the old way for ESXi 7
Sign in to join this conversation.
No Branch/Tag specified
master
bugfix/43-Fix-timezone-and-DST-in-SEL
pages
bugfix/fix-ci-builds
feature/refactor-sdr-name-handling
cleanup/nm
feature/add-support-for-boot-mailbox
codefactor
bugfix/26
IPMITOOL_1_8_19
IPMITOOL_1_8_18
IPMITOOL_1_8_17
IPMITOOL_1_8_16
IPMITOOL_1_8_15
IPMITOOL_1_8_15RC1
IPMITOOL_1_8_14
IPMITOOL_1_8_14RC2
IPMITOOL_1_8_14RC1
ipmitool
IPMITOOL_1_8_13
IPMITOOL_1_8_13RC1
IPMITOOL_1_8_12
IPMITOOL_1_8_9
IPMITOOL_1_8_8
IPMITOOL_1_8_7
IPMITOOL_1_8_6
IPMITOOL_1_8_5
IPMITOOL_1_8_0
IPMITOOL_S10_U1
IPMITOOL_1_6_1
IPMITOOL_1_6_0
IPMITOOL_1_5_9
IPMITOOL_1_5_8
IPMITOOL_1_5_7
IPMITOOL_1_5_6
IPMITOOL_1_5_4
IPMITOOL_1_4_1_1
Labels
Clear labels
No items
No labels
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
IPMITool/ipmitool#20
Reference in a new issue
IPMITool/ipmitool
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?