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

Json-CRITICAL #308

Open
djkraven opened this issue Aug 28, 2023 · 6 comments
Open

Json-CRITICAL #308

djkraven opened this issue Aug 28, 2023 · 6 comments

Comments

@djkraven
Copy link

I am getting a Json-CRITICAL error when running from CLI. This prevents updating from the CLI but will update when using the UI.

/usr/bin/mainline install-latest

mainline 1.4.8

(process:7589): Json-CRITICAL **: 09:01:52.161: json_object_get_string_member: assertion 'node != NULL' failed
7589: /usr/bin/mainline install-latest -v 9
7589: load_app_config()
7589: fread(/root/.config/mainline/config.json)
7589: {
"ppa_uri" : "https://kernel.ubuntu.com/~kernel-ppa/mainline/",
"all_proxy" : "",
"connect_timeout_seconds" : 15,
"concurrent_downloads" : 1,
"hide_unstable" : true,
"previous_majors" : 0,
"notify_major" : false,
"notify_minor" : false,
"notify_interval_unit" : 0,
"notify_interval_value" : 4,
"verify_checksums" : false,
"window_width" : 800,
"window_height" : 600,
"window_x" : -1,
"window_y" : -1,
"term_width" : 1100,
"term_height" : 600
}
7589: Loaded config file: /root/.config/mainline/config.json

@bkw777
Copy link
Owner

bkw777 commented Aug 29, 2023

I tried to duplicate your case, run as root, with deteled .config/mainline and with a copy of your config, and in all cases it worked. And yours is dying before it gets to the part where the debug output would have printed some stuff about your system like the distribution. We're almost down to running strace!

Can you provide:
cat /etc/os-release
pkg-config json-glib-1.0

Also would you mind trying running as a regular user, and starting with no ~/.config/mainline to force it to generate a fresh one.

Also, when you say cli, is it a terminal within a desktop session, or is it an ssh login with no desktop or X, no dbus, etc?

It's strange that the gui works. That really means there is no problem reading the config file nor a problem with it's exact contents.

Does just mainline with no args (or just -v n) print the help screen?

@bkw777
Copy link
Owner

bkw777 commented Aug 29, 2023

I think I know what's going on, though not why.

It's dying on get_string_member, and indeed your config file is missing some recently added fields, including the string fields, auth_cmd and term_cmd.

The problem is, it actually should be handling missing members no problem. I actually tried with your config not just with no config, and it read the incomplete file and used the built-in default values for the missing members.

Depending on the age of vala and glib-json, there are two different versions of get_string_member that it will use, but they both handle null. Or at least they should.

@djkraven
Copy link
Author

Is there more information you need from me? I don't see my previous reply. I'll try again.

$ cat /etc/os-release
NAME="Linux Mint"
VERSION="21.2 (Victoria)"
ID=linuxmint
ID_LIKE="ubuntu debian"
PRETTY_NAME="Linux Mint 21.2"
VERSION_ID="21.2"
HOME_URL="https://www.linuxmint.com/"
SUPPORT_URL="https://forums.linuxmint.com/"
BUG_REPORT_URL="http://linuxmint-troubleshooting-guide.readthedocs.io/en/latest/"
PRIVACY_POLICY_URL="https://www.linuxmint.com/"
VERSION_CODENAME=victoria
UBUNTU_CODENAME=jammy

pkg-config json-glib-1.0
returns nothing

Here are the apt show
$ apt show json-glib-*
Package: json-glib-tools
Version: 1.6.6-1build1
Priority: optional
Section: universe/devel
Source: json-glib
Origin: Ubuntu
Maintainer: Ubuntu Developers [email protected]
Original-Maintainer: Debian GNOME Maintainers [email protected]
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 54.3 kB
Depends: libc6 (>= 2.34), libglib2.0-0 (>= 2.55.2), libjson-glib-1.0-0 (= 1.6.6-1build1)
Homepage: https://wiki.gnome.org/Projects/JsonGlib
Download-Size: 9,442 B
APT-Sources: http://mirror.math.princeton.edu/pub/ubuntu jammy/universe amd64 Packages
Description: GLib JSON manipulation library (tools)
JSON-GLib is a library for parsing, generating and manipulating JavaScript
Object Notation (JSON) data streams using the GLib type system. It allows
manipulating JSON data types with a Document Object Model API. It also
allows serializing and deserializing simple or complex GObjects to and
from JSON data types.
.
This package contains the json-glib-format and json-glib-validate
tools.

When I run as a regular user it works. Before and after removing ~/.config/mainline.

This happens when running with sudo on a terminal session on the desktop or ssh.

The help screen displays without error when run as a regular user or with sudo.

I am not sure what vala you mean.

$ sudo apt show vala*
Package: valac
Version: 0.56.0-1
Priority: optional
Section: universe/devel
Source: vala
Origin: Ubuntu
Maintainer: Ubuntu Developers [email protected]
Original-Maintainer: Debian GNOME Maintainers [email protected]
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 452 kB
Depends: libc6 (>= 2.34), libglib2.0-0 (>= 2.48), libvala-0.56-0 (= 0.56.0-1), libvalacodegen-0.56-0 (= 0.56.0-1), libglib2.0-dev (>= 2.48), valac-0.56-vapi, valac-bin (= 0.56.0-1)
Recommends: gcc
Conflicts: valac-0.12, valac-0.14, valac-0.16, valac-0.18, valac-0.20, valac-0.22, valac-0.24, valac-0.26, valac-0.28, valac-0.30
Homepage: https://wiki.gnome.org/Projects/Vala/
Download-Size: 127 kB
APT-Sources: http://mirror.math.princeton.edu/pub/ubuntu jammy/universe amd64 Packages
Description: C# like language for the GObject system
Vala is a new programming language that aims to bring modern programming
language features to GNOME developers without imposing any additional
runtime requirements and without using a different ABI compared to
applications and libraries written in C.
.
valac, the Vala compiler, is a self-hosting compiler that translates
Vala source code into C source and header files. It uses the GObject
type system to create classes and interfaces declared in the Vala
source code. This package also contains the vala-gen-introspect and
vapigen binaries that will automatically generate Vala bindings.

Package: vala-panel-appmenu-common
Version: 0.7.6+dfsg1-4
Priority: optional
Section: universe/x11
Source: vala-panel-appmenu
Origin: Ubuntu
Maintainer: Ubuntu Developers [email protected]
Original-Maintainer: Ayatana Packagers [email protected]
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 645 kB
Depends: dconf-gsettings-backend | gsettings-backend
Homepage: https://gitlab.com/vala-panel-project/vala-panel-appmenu
Task: ubuntu-mate-core, ubuntu-mate-desktop, ubuntu-budgie-desktop, ubuntu-budgie-desktop-raspi
Download-Size: 15.2 kB
APT-Sources: http://mirror.math.princeton.edu/pub/ubuntu jammy/universe amd64 Packages
Description: Common files for Application Menu plugins
This is an Application Menu (Global Menu) plugin. It is built using
the Unity protocol and libraries and provides all features found in
the Unity implementation.
.
This package provides common files.

Package: vala-mode-el
Version: 0.1-8
Priority: extra
Section: universe/editors
Origin: Ubuntu
Maintainer: Ubuntu Developers [email protected]
Original-Maintainer: Debian Emacsen Team [email protected]
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 9,216 B
Depends: elpa-vala-mode
Homepage: https://wiki.gnome.org/Projects/Vala/Emacs
Download-Size: 1,696 B
APT-Sources: http://mirror.math.princeton.edu/pub/ubuntu jammy/universe amd64 Packages
Description: Transition Package, vala-mode-el to elpa-vala-mode
Vala mode has been elpafied. Ease transition from vala-mode-el to
elpa-vala-mode with this dummy package.

Package: vala-panel-appmenu
Version: 0.7.6+dfsg1-4
Priority: optional
Section: universe/x11
Origin: Ubuntu
Maintainer: Ubuntu Developers [email protected]
Original-Maintainer: Ayatana Packagers [email protected]
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 229 kB
Depends: bamfdaemon, vala-panel-appmenu-common (= 0.7.6+dfsg1-4), appmenu-registrar (>= 0.7.1), libbamf3-2 (>= 0.2.110), libc6 (>= 2.7), libglib2.0-0 (>= 2.52.0), libgtk-3-0 (>= 3.22.0), libvalapanel0 (>= 0.4.92)
Recommends: appmenu-qt5, libdbusmenu-glib4, libdbusmenu-gtk3-4, libdbusmenu-gtk4, appmenu-gtk2-module, appmenu-gtk3-module
Homepage: https://gitlab.com/vala-panel-project/vala-panel-appmenu
Download-Size: 67.3 kB
APT-Sources: http://mirror.math.princeton.edu/pub/ubuntu jammy/universe amd64 Packages
Description: Application Menu plugin for vala-panel
This is an Application Menu (Global Menu) plugin. It is built using
the Unity protocol and libraries and provides all features found in
the Unity implementation.

Package: vala-0.56-doc
Version: 0.56.0-1
Priority: optional
Section: universe/doc
Source: vala
Origin: Ubuntu
Maintainer: Ubuntu Developers [email protected]
Original-Maintainer: Debian GNOME Maintainers [email protected]
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 434 kB
Provides: vala-doc
Suggests: valac, devhelp
Homepage: https://wiki.gnome.org/Projects/Vala/
Download-Size: 109 kB
APT-Sources: http://mirror.math.princeton.edu/pub/ubuntu jammy/universe amd64 Packages
Description: C# like language for the GObject system - documentation
Vala is a new programming language that aims to bring modern programming
language features to GNOME developers without imposing any additional
runtime requirements and without using a different ABI compared to
applications and libraries written in C.
.
This package contains the Vala Reference Manual.

Package: vala-panel
Version: 0.5.0-2
Priority: optional
Section: universe/x11
Origin: Ubuntu
Maintainer: Ubuntu Developers [email protected]
Original-Maintainer: Ayatana Packagers [email protected]
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 206 kB
Depends: libvalapanel0 (= 0.5.0-2), vala-panel-common (= 0.5.0-2), dconf-gsettings-backend | gsettings-backend, libc6 (>= 2.34), libgdk-pixbuf-2.0-0 (>= 2.25.2), libglib2.0-0 (>= 2.52), libgtk-3-0 (>= 3.22.0), libgtk-layer-shell0 (>= 0.1.0)
Recommends: vala-panel-plugins-base
Suggests: vala-panel-plugins-wnck
Homepage: https://github.com/rilian-la-te/vala-panel
Download-Size: 54.0 kB
APT-Sources: http://mirror.math.princeton.edu/pub/ubuntu jammy/universe amd64 Packages
Description: Desktop panel written in Vala and GTK+ 3
Vala Panel is a rewrite of SimplePanel. It is a GTK+ 3 desktop panel
written in Vala and based on ideas from LXPanel.
.
Vala Panel can be extended with plugins that provide application menus,
clock, tasklist, system tray, etc.

Package: vala-panel-common
Version: 0.5.0-2
Priority: optional
Section: universe/x11
Source: vala-panel
Origin: Ubuntu
Maintainer: Ubuntu Developers [email protected]
Original-Maintainer: Ayatana Packagers [email protected]
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 1,878 kB
Homepage: https://github.com/rilian-la-te/vala-panel
Download-Size: 285 kB
APT-Sources: http://mirror.math.princeton.edu/pub/ubuntu jammy/universe amd64 Packages
Description: Vala Panel - common files
Vala Panel is a rewrite of SimplePanel. It is a GTK+ 3 desktop panel
written in Vala and based on ideas from LXPanel.
.
This package provides common files.

Package: vala-panel-plugins-base
Version: 0.5.0-2
Priority: optional
Section: universe/x11
Source: vala-panel
Origin: Ubuntu
Maintainer: Ubuntu Developers [email protected]
Original-Maintainer: Ayatana Packagers [email protected]
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 766 kB
Depends: vala-panel (= 0.5.0-2), dconf-gsettings-backend | gsettings-backend, libc6 (>= 2.14), libcairo2 (>= 1.2.4), libgdk-pixbuf-2.0-0 (>= 2.25.2), libglib2.0-0 (>= 2.52), libgtk-3-0 (>= 3.22.0), libvalapanel0 (>= 0.5.0)
Homepage: https://github.com/rilian-la-te/vala-panel
Download-Size: 129 kB
APT-Sources: http://mirror.math.princeton.edu/pub/ubuntu jammy/universe amd64 Packages
Description: Plugins for vala-panel - non-X11 plugins
Vala Panel is a rewrite of SimplePanel. It is a GTK+ 3 desktop panel
written in Vala and based on ideas from LXPanel.
.
This package contains main plugins for vala-panel: clock, launchbar,
applications menu and so on.

Package: vala-panel-plugins-wnck
Version: 0.5.0-2
Priority: optional
Section: universe/x11
Source: vala-panel
Origin: Ubuntu
Maintainer: Ubuntu Developers [email protected]
Original-Maintainer: Ayatana Packagers [email protected]
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 433 kB
Depends: vala-panel (= 0.5.0-2), libx11-6, dconf-gsettings-backend | gsettings-backend, libatk1.0-0 (>= 1.12.4), libc6 (>= 2.4), libcairo2 (>= 1.2.4), libgdk-pixbuf-2.0-0 (>= 2.25.2), libglib2.0-0 (>= 2.52), libgtk-3-0 (>= 3.22.0), libpango-1.0-0 (>= 1.14.0), libpangocairo-1.0-0 (>= 1.14.0), libvalapanel0 (>= 0.3.71), libwnck-3-0 (>= 3.4.0)
Homepage: https://github.com/rilian-la-te/vala-panel
Download-Size: 84.1 kB
APT-Sources: http://mirror.math.princeton.edu/pub/ubuntu jammy/universe amd64 Packages
Description: Plugins for vala-panel - X11 plugins
Vala Panel is a rewrite of SimplePanel. It is a GTK+ 3 desktop panel
written in Vala and based on ideas from LXPanel.
.
This package contains X11 plugins for vala-panel: tasklist,
system tray, and others.

Package: vala-sntray-plugin
Version: 0.4.13.1-2
Priority: optional
Section: universe/xfce
Source: xfce4-sntray-plugin
Origin: Ubuntu
Maintainer: Ubuntu Developers [email protected]
Original-Maintainer: Ayatana Packagers [email protected]
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 272 kB
Depends: xfce4-sntray-plugin-common, libc6 (>= 2.4), libcairo2 (>= 1.6.0), libgdk-pixbuf-2.0-0 (>= 2.22.0), libglib2.0-0 (>= 2.50), libgtk-3-0 (>= 3.22), libpango-1.0-0 (>= 1.14.0), libvalapanel0 (>= 0.4.92)
Homepage: https://gitlab.com/vala-panel-project/xfce4-sntray-plugin
Download-Size: 82.7 kB
APT-Sources: http://mirror.math.princeton.edu/pub/ubuntu jammy/universe amd64 Packages
Description: plugin for xfce4-panel to show StatusNotifierItems - Vala
Plugin for xfce4-panel to show StatusNotifierItems
(also known as AppIndicators). Based on ValaPanel`s
StatusNotifier and xfce4-snw-plugin by equiem.
.
Vala Panel Applet version of the plugin.

Package: valabind
Version: 1.8.0-1build3
Priority: optional
Section: universe/devel
Origin: Ubuntu
Maintainer: Ubuntu Developers [email protected]
Original-Maintainer: Sebastian Reichel [email protected]
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 271 kB
Depends: libc6 (>= 2.34), libglib2.0-0 (>= 2.37.3), libvala-0.56-0 (>= 0.47.3), libvalacodegen-0.56-0
Suggests: gobject-introspection, swig
Homepage: https://github.com/radare/valabind
Download-Size: 87.0 kB
APT-Sources: http://mirror.math.princeton.edu/pub/ubuntu jammy/universe amd64 Packages
Description: converts vapi files to SWIG, C++, GIR or GEAR files
Valabind is a tool to parse vala or vapi files and transform them into SWIG
interface files, C++ source files, GIR or GEAR.
.
It allows easy, fully automatic generation of language bindings for vala code.

Package: valac-0.56-vapi
Version: 0.56.0-1
Priority: optional
Section: universe/devel
Source: vala
Origin: Ubuntu
Maintainer: Ubuntu Developers [email protected]
Original-Maintainer: Debian GNOME Maintainers [email protected]
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 8,672 kB
Provides: valac-vapi
Homepage: https://wiki.gnome.org/Projects/Vala/
Download-Size: 800 kB
APT-Sources: http://mirror.math.princeton.edu/pub/ubuntu jammy/universe amd64 Packages
Description: C# like language for the GObject system - vapi files
Vala is a new programming language that aims to bring modern programming
language features to GNOME developers without imposing any additional
runtime requirements and without using a different ABI compared to
applications and libraries written in C.
.
valac, the Vala compiler, is a self-hosting compiler that translates
Vala source code into C source and header files. It uses the GObject
type system to create classes and interfaces declared in the Vala
source code. This package also contains the vala-gen-introspect and
vapigen binaries that will automatically generate Vala bindings.
.
This package contains the bundled vapi files, which make some
common libraries available for vala development.

Package: valac-bin
Version: 0.56.0-1
Priority: optional
Section: universe/devel
Source: vala
Origin: Ubuntu
Maintainer: Ubuntu Developers [email protected]
Original-Maintainer: Debian GNOME Maintainers [email protected]
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 158 kB
Depends: libc6 (>= 2.34), libglib2.0-0 (>= 2.48), libvala-0.56-0 (= 0.56.0-1), libvalacodegen-0.56-0 (= 0.56.0-1)
Conflicts: valac-0.12, valac-0.14, valac-0.16, valac-0.18, valac-0.20, valac-0.22, valac-0.24, valac-0.26, valac-0.28, valac-0.30
Breaks: valac (<< 0.46.5-1.1~)
Replaces: valac (<< 0.46.5-1.1~)
Homepage: https://wiki.gnome.org/Projects/Vala/
Download-Size: 26.9 kB
APT-Sources: http://mirror.math.princeton.edu/pub/ubuntu jammy/universe amd64 Packages
Description: internal package for C# like language for the GObject system
Vala is a new programming language that aims to bring modern programming
language features to GNOME developers without imposing any additional
runtime requirements and without using a different ABI compared to
applications and libraries written in C.
.
This particular package is an implementation detail of the vala packaging.
It should not be installed directly and there should be no dependencies
on it. Refer to the valac package instead.

Package: valadoc
Version: 0.56.0-1
Priority: extra
Section: universe/devel
Source: vala
Origin: Ubuntu
Maintainer: Ubuntu Developers [email protected]
Original-Maintainer: Debian GNOME Maintainers [email protected]
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 481 kB
Depends: libc6 (>= 2.34), libglib2.0-0 (>= 2.48), libvala-0.56-0 (>= 0.55.90), libvaladoc-0.56-0 (= 0.56.0-1), libvalacodegen-0.56-0 (= 0.56.0-1), valac (= 0.56.0-1)
Recommends: gtk-doc-tools
Homepage: https://wiki.gnome.org/Projects/Vala/
Download-Size: 109 kB
APT-Sources: http://mirror.math.princeton.edu/pub/ubuntu jammy/universe amd64 Packages
Description: API documentation generator for vala
Valadoc is a documentation generator for generating API documentation
in HTML format from Vala source code. It can be used for *.vala and
*.vapi files.

Package: vala-panel-appmenu-registrar
State: not a real package (virtual)
Package: valac-0.12
State: not a real package (virtual)
Package: valac-0.14
State: not a real package (virtual)
Package: valac-0.16
State: not a real package (virtual)
Package: valac-0.18
State: not a real package (virtual)
Package: valac-0.20
State: not a real package (virtual)
Package: valac-0.22
State: not a real package (virtual)
Package: valac-0.24
State: not a real package (virtual)
Package: valac-0.26
State: not a real package (virtual)
Package: valac-0.28
State: not a real package (virtual)
Package: valac-0.30
State: not a real package (virtual)
Package: vala-doc
State: not a real package (virtual)
Package: valac-vapi
State: not a real package (virtual)

@bkw777
Copy link
Owner

bkw777 commented Aug 30, 2023

Since it works without sudo, and even in sudo it's clearly able to read the file since it can print it back out. And since it works without sudo, it means all necessary packages and libraries are installed and working.

I don't know what could be happening in the sudo environment that allows it to read the file with one library function, but apparently not with another library function.

The debug output and load_app_config() are using two different functions to read the file.
The debug output is a plain file read using using FileUtils.get_contents(),
while load_app_config() is using Json.Parser() load_from_file()
Both are using the same variable APP_CONFIG_FILE, so it's not a problem with get_env() or init2() producing different data from the different environment. If FileUtils got the right path, then so did Json.Parser.

So it's like somehow FileUtils has permission to read the file and Json.Parser does not???? At the same time in the same instance of the same executable??? But those two functions do come from different libraries. Could there be some form of new security thing I never heard of yet that says only libjson-glib-1.0.so.0 doesn't have permission to read the file???

@bkw777
Copy link
Owner

bkw777 commented Aug 30, 2023

does sudo mainline args behave differently than sudo -i followed by mainline args ?

@djkraven
Copy link
Author

There is no difference

$ sudo mainline install-latest
mainline 1.4.8

(process:2821): Json-CRITICAL **: 13:16:30.692: json_object_get_string_member: assertion 'node != NULL' failed

(process:2821): Json-CRITICAL **: 13:16:30.692: json_object_get_string_member: assertion 'node != NULL' failed
Updating Kernels...
No updates
mainline: done

$ sudo -i mainline install-latest
mainline 1.4.8

(process:2840): Json-CRITICAL **: 13:17:36.844: json_object_get_string_member: assertion 'node != NULL' failed

(process:2840): Json-CRITICAL **: 13:17:36.844: json_object_get_string_member: assertion 'node != NULL' failed
Updating Kernels...
No updates
mainline: done

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