Bug 290395 - 15.0-BETA5: nuageinit crashes when no userdata is provided
Summary: 15.0-BETA5: nuageinit crashes when no userdata is provided
Status: In Progress
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 15.0-CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: Baptiste Daroussin
URL: https://reviews.freebsd.org/D53239
Keywords:
Depends on:
Blocks: 15.0-metabug
  Show dependency treegraph
 
Reported: 2025-10-20 22:55 UTC by Jimmy Olgeni
Modified: 2025-11-25 00:45 UTC (History)
3 users (show)

See Also:
jlduran: mfc-stable15+
jlduran: mfc-stable14+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jimmy Olgeni freebsd_committer freebsd_triage 2025-10-20 22:55:45 UTC
During the boot process, after network configuration and before starting
syslogd, nuageinit crashes with a Lua runtime error.

The error only occurs when no userdata is provided during VM deployment using the 15.0-BETA2 image.

When userdata is provided (such as a shell script), nuageinit processes it
successfully without errors.

Nothing bad happens in case of error apparently, just the odd message on the console.

Console log:

Starting dhclient.
DHCPDISCOVER on vtnet1 to 255.255.255.255 port 67 interval 8
DHCPOFFER from 169.254.169.253
DHCPREQUEST on vtnet1 to 255.255.255.255 port 67
DHCPACK from 169.254.169.253
bound to 10.114.0.7 -- renewal in 43200 seconds.
route: message indicates error: File exists
add host 127.0.0.1: gateway lo0 fib 0: route already in table
route: message indicates error: File exists
add host ::1: gateway lo0 fib 0: route already in table
add net fe80::: gateway ::1
add net ff02::: gateway ::1
add net ::ffff:0.0.0.0: gateway ::1
add net ::0.0.0.0: gateway ::1
Creating and/or trimming log files.
Clearing /tmp (X related).
Updating /var/run/os-release done.
Updating motd:.
/usr/libexec/flua: /usr/libexec/nuageinit:716: attempt to index a nil value (loc
al 'line')
stack traceback:
        /usr/libexec/nuageinit:716: in main chunk
        [C]: in ?
Starting syslogd.
Comment 1 Jose Luis Duran freebsd_committer freebsd_triage 2025-10-21 13:42:15 UTC
Add a basic guard against an empty file:
https://reviews.freebsd.org/D53239

Thank you for the report!
Can you please verify if the patch fixes the issue?
Comment 2 Jimmy Olgeni freebsd_committer freebsd_triage 2025-10-26 10:53:48 UTC
All good, thanks!
Comment 3 Jimmy Olgeni freebsd_committer freebsd_triage 2025-11-02 11:44:29 UTC
15.0-BETA4 still affected :)
Comment 4 Jimmy Olgeni freebsd_committer freebsd_triage 2025-11-13 15:53:12 UTC
15.0-BETA5 still crashing with no user-data
Comment 5 Colin Percival freebsd_committer freebsd_triage 2025-11-15 17:21:02 UTC
Baptiste, can you take a look at this and see if there's a (very simple and obviously correct) fix which we can get into 15.0?
Comment 6 Jose Luis Duran freebsd_committer freebsd_triage 2025-11-15 18:00:50 UTC
(In reply to Colin Percival from comment #5)
Note that there is a proposed fix in:

https://reviews.freebsd.org/D53239
Comment 7 Jimmy Olgeni freebsd_committer freebsd_triage 2025-11-18 07:50:36 UTC
nuageinit not crashing anymore in RC1 images (both ufs and zfs), checked with/without #!/bin/sh script.
Comment 8 Jimmy Olgeni freebsd_committer freebsd_triage 2025-11-21 15:24:13 UTC
-RC2 good too.
Comment 9 commit-hook freebsd_committer freebsd_triage 2025-11-22 17:32:39 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=57d25b6333523491ac7a3e869bd5d16127203eed

commit 57d25b6333523491ac7a3e869bd5d16127203eed
Author:     Jose Luis Duran <jlduran@FreeBSD.org>
AuthorDate: 2025-10-21 13:11:50 +0000
Commit:     Jose Luis Duran <jlduran@FreeBSD.org>
CommitDate: 2025-11-22 17:23:20 +0000

    nuageinit: Add guards against empty user data

    Add guards against attempting to process a user data file with an empty
    first line or contents.

    PR:             290395
    Reviewed by:    bapt (earlier), dtxdf, markj
    MFC after:      3 days
    Differential Revision:  https://reviews.freebsd.org/D53239

 libexec/nuageinit/nuageinit | 8 ++++++++
 1 file changed, 8 insertions(+)
Comment 10 commit-hook freebsd_committer freebsd_triage 2025-11-25 00:43:06 UTC
A commit in branch stable/15 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=a7cadff8ccccfa3f3cde9a501a0fe9a78299d41a

commit a7cadff8ccccfa3f3cde9a501a0fe9a78299d41a
Author:     Jose Luis Duran <jlduran@FreeBSD.org>
AuthorDate: 2025-10-21 13:11:50 +0000
Commit:     Jose Luis Duran <jlduran@FreeBSD.org>
CommitDate: 2025-11-25 00:39:37 +0000

    nuageinit: Add guards against empty user data

    Add guards against attempting to process a user data file with an empty
    first line or contents.

    PR:             290395
    Reviewed by:    bapt (earlier), dtxdf, markj
    MFC after:      3 days
    Differential Revision:  https://reviews.freebsd.org/D53239

    (cherry picked from commit 57d25b6333523491ac7a3e869bd5d16127203eed)

 libexec/nuageinit/nuageinit | 8 ++++++++
 1 file changed, 8 insertions(+)
Comment 11 commit-hook freebsd_committer freebsd_triage 2025-11-25 00:44:08 UTC
A commit in branch stable/14 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=646c0a2fe64651dc6315ff4b0ed6ba00924ca080

commit 646c0a2fe64651dc6315ff4b0ed6ba00924ca080
Author:     Jose Luis Duran <jlduran@FreeBSD.org>
AuthorDate: 2025-10-21 13:11:50 +0000
Commit:     Jose Luis Duran <jlduran@FreeBSD.org>
CommitDate: 2025-11-25 00:42:36 +0000

    nuageinit: Add guards against empty user data

    Add guards against attempting to process a user data file with an empty
    first line or contents.

    PR:             290395
    Reviewed by:    bapt (earlier), dtxdf, markj
    MFC after:      3 days
    Differential Revision:  https://reviews.freebsd.org/D53239

    (cherry picked from commit 57d25b6333523491ac7a3e869bd5d16127203eed)

 libexec/nuageinit/nuageinit | 8 ++++++++
 1 file changed, 8 insertions(+)