Skip to content

misc fixes#976

Open
cvaroqui wants to merge 14 commits intoopensvc:mainfrom
cvaroqui:main
Open

misc fixes#976
cvaroqui wants to merge 14 commits intoopensvc:mainfrom
cvaroqui:main

Conversation

@cvaroqui
Copy link
Member

@cvaroqui cvaroqui commented Feb 5, 2026

No description provided.

Permission errors accessing node.conf during kw dereference can lead
to actor.fqdn() to return nil, and thus FQDN() to stack on
fqdn().String().

Test fqdn() result and return "" if nil.

	panic: runtime error: invalid memory address or nil pointer dereference [recovered]
		panic: runtime error: invalid memory address or nil pointer dereference
	[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x16c8f9f]

	goroutine 1 [running]:
	main.main.func1()
		/home/cvaroqui/dev/om3/cmd/om/main.go:23 +0xbf
	panic({0x20ab6e0?, 0x4477890?})
		/home/cvaroqui/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.24.0.linux-amd64/src/runtime/panic.go:787 +0x132
	github.com/opensvc/om3/v3/core/object.(*core).FQDN(0x20f1f60?)
		/home/cvaroqui/dev/om3/core/object/core_config.go:87 +0x1f
	github.com/opensvc/om3/v3/core/object.(*core).Dereference(0xc0002e86c0, {0xc00013527f, 0x4})
		/home/cvaroqui/dev/om3/core/object/core_config.go:313 +0x1e5
	github.com/opensvc/om3/v3/core/xconfig.T.dereferenceWellKnown({{0xc00027b840, 0x1e}, {{0x7ffc488c10f0, 0x8}, {0x230ebbc, 0x4}, {0x230e04b, 0x3}}, {0x37f3850, 0xc0002e86c0}, ...}, ...)
		/home/cvaroqui/dev/om3/core/xconfig/main.go:1335 +0x402
	github.com/opensvc/om3/v3/core/xconfig.T.dereference({{0xc00027b840, 0x1e}, {{0x7ffc488c10f0, 0x8}, {0x230ebbc, 0x4}, {0x230e04b, 0x3}}, {0x37f3850, 0xc0002e86c0}, ...}, ...)
		/home/cvaroqui/dev/om3/core/xconfig/main.go:1197 +0x4d4
	github.com/opensvc/om3/v3/core/xconfig.(*T).replaceReferences.func1({0xc00013527e, 0x6})
		/home/cvaroqui/dev/om3/core/xconfig/main.go:951 +0x225
	regexp.(*Regexp).ReplaceAllStringFunc.func1({0xc000487430, 0x5, 0x8}, {0xc000487420?, 0xc00066ba68?, 0x0?})
		/home/cvaroqui/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.24.0.linux-amd64/src/regexp/regexp.go:598 +0x85
	regexp.(*Regexp).replaceAll(0xc000244000, {0x0, 0x0, 0x0}, {0xc000135279, 0x10}, 0x2, 0xc00066bb30)
		/home/cvaroqui/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.24.0.linux-amd64/src/regexp/regexp.go:636 +0x3e3
	regexp.(*Regexp).ReplaceAllStringFunc(0x0?, {0xc000135279?, 0x0?}, 0x0?)
		/home/cvaroqui/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.24.0.linux-amd64/src/regexp/regexp.go:597 +0x4b
	github.com/opensvc/om3/v3/core/xconfig.(*T).replaceReferences(0x0?, {0xc000135279?, 0x231229e?}, {0xc000487be8?, 0x231ad4b?}, {0x0?, 0x1?}, 0x0?, 0x0?)
		/home/cvaroqui/dev/om3/core/xconfig/main.go:950 +0xac
	github.com/opensvc/om3/v3/core/xconfig.(*T).evalDescopeStringAs(_, {{_, _}, {_, _}}, {{0x0, 0x0}, {0x231229e, 0x6}, {0x231ad4b, ...}, ...}, ...)
		/home/cvaroqui/dev/om3/core/xconfig/main.go:912 +0xf6
	github.com/opensvc/om3/v3/core/xconfig.(*T).evalStringAs(_, {{_, _}, {_, _}}, {{0x0, 0x0}, {0x231229e, 0x6}, {0x231ad4b, ...}, ...}, ...)
		/home/cvaroqui/dev/om3/core/xconfig/main.go:866 +0x1fe
	github.com/opensvc/om3/v3/core/xconfig.(*T).EvalKeywordAs(_, {{_, _}, {_, _}}, {{0x0, 0x0}, {0x231229e, 0x6}, {0x231ad4b, ...}, ...}, ...)
		/home/cvaroqui/dev/om3/core/xconfig/main.go:840 +0x15b
	github.com/opensvc/om3/v3/core/object.(*actor).configureResource(0xc0002e86c0, {0x3811430, 0xc0002ed088}, {0xc000487be8, 0x5})
		/home/cvaroqui/dev/om3/core/object/actor.go:468 +0x42d
	github.com/opensvc/om3/v3/core/object.(*actor).ConfigureResources(0xc0002e86c0)
		/home/cvaroqui/dev/om3/core/object/actor.go:301 +0x67a
	github.com/opensvc/om3/v3/core/object.(*actor).Resources(0xc0002e86c0)
		/home/cvaroqui/dev/om3/core/object/actor.go:252 +0x3b
	github.com/opensvc/om3/v3/core/object.listResources(...)
		/home/cvaroqui/dev/om3/core/object/actor.go:218
	github.com/opensvc/om3/v3/core/object.(*actor).Schedules(0xc0002e86c0)
		/home/cvaroqui/dev/om3/core/object/actor_print_schedule.go:71 +0x3a9
	github.com/opensvc/om3/v3/core/omcmd.(*CmdObjectScheduleList).extractLocal(0xc0002d30e0?, {0x7ffc488c10f0, 0x8})
		/home/cvaroqui/dev/om3/core/omcmd/object_schedule_list.go:63 +0x1f7
	github.com/opensvc/om3/v3/core/omcmd.(*CmdObjectScheduleList).extract(0xc0002d30e0, {0x7ffc488c10f0, 0x8}, 0x8?)
		/home/cvaroqui/dev/om3/core/omcmd/object_schedule_list.go:36 +0x8e
	github.com/opensvc/om3/v3/core/omcmd.(*CmdObjectScheduleList).Run(0xc0002d30e0, {0x230e04b?, 0x0?})
		/home/cvaroqui/dev/om3/core/omcmd/object_schedule_list.go:142 +0x88
	github.com/opensvc/om3/v3/core/om.newCmdObjectScheduleList.func1(0xc000505208?, {0x230ec78?, 0x4?, 0x230eb70?})
		/home/cvaroqui/dev/om3/core/om/factory.go:2289 +0x1f
	github.com/spf13/cobra.(*Command).execute(0xc000505208, {0xc000702460, 0x2, 0x2})
		/home/cvaroqui/go/pkg/mod/github.com/spf13/cobra@v1.9.1/command.go:1015 +0xa94
	github.com/spf13/cobra.(*Command).ExecuteC(0x44ad9c0)
		/home/cvaroqui/go/pkg/mod/github.com/spf13/cobra@v1.9.1/command.go:1148 +0x40c
	github.com/spf13/cobra.(*Command).Execute(...)
		/home/cvaroqui/go/pkg/mod/github.com/spf13/cobra@v1.9.1/command.go:1071
	github.com/opensvc/om3/v3/core/om.ExecuteArgs({0xc00003e150, 0x3, 0x3})
		/home/cvaroqui/dev/om3/core/om/root.go:215 +0x52
	github.com/opensvc/om3/v3/core/om.Execute()
		/home/cvaroqui/dev/om3/core/om/root.go:155 +0x45
	main.main()
		/home/cvaroqui/dev/om3/cmd/om/main.go:29 +0x4a
With

	[volume#1]
	type=shm
	size=10m

the pool lookup would discard the shm pool with a error like:

	[shm] not persistent capable

The pool lookup is too strict and expects:

	[volume#1]
	type = shm
	size = 10m
	volatile = true

This expectation breaks backward compat.
So accept that explicetly asking for the shm pool implies volatile.
The following driver were dropped as abstracting igw configuration using
opensvc keywords is no longer supported:

	GroupCertificate | GroupExpose | GroupRoute | GroupVhost

This abstraction caused lots of igw features to be masked, and forced us
to follow igw syntax changes.
* Misconfigured resources are now listed by Actor.Resources()
* The functions passed to resourceset.T.Do() now have to decide if they
  skip a misconfigured resource:
  * Actor.FreshStatus don't skip them, but format a "undef"
    resource.Status with a status log reporting the configuration error.
  * Abort() skips silently
  * Action() skips with a warn log

Example:

	$ om tstencap instance status -r
	tstencap                           up     warn
	└ instances
	  └ eggplant                       up     warn idle started
	    └ resources
	      ├ ip#4             ...../..  undef
	      │                                   error: configuration does not exist: key 'dev' not found (all scopes tried)
	      ├ fs#0             .M......  up     tmpfs none@/srv/tstencap.root.svc.homepool1/tmp
	      ├ container#1      ...../..  up     docker alpine
	      └ subset#app:g1
		└ app#2          ..D../..  n/a    forking app.forking

	$ om tstencap instance start
	go build -o bin/om ./cmd/om/
	15:22:27.138 INF tstencap: >>> do start [./bin/om tstencap instance start] (origin user, sid daea11fd-8cf4-4821-8349-fa5e1fa130d8)
	15:22:27.177 WRN tstencap: ip#4: skip resource with configuration error: configuration does not exist: key 'dev' not found (all scopes tried)
	15:22:27.189 INF tstencap: fs#0: none already mounted on /srv/tstencap.root.svc.homepool1/tmp
	15:22:27.205 INF tstencap: container#1: container start tstencap.container.1: already started
	15:22:27.378 INF tstencap: <<< done start [./bin/om tstencap instance start] in 240.156022ms, instance status is now up, with warnings
So resources that don't support restarts, like tasks, do not
clutter the memory and their json representation.
Add don't reformat the context.Context.Err() error.
Every resource type implementing the starter interface must now
embed explicitely resource.Restart.
Replace:

* IsConfigured() bool
* SetConfigured(error)
* GetConfigurationError() error

With a nicer:

* GetConfigurationError() error
* SetConfigurationError(error)
This caused "status -m" and "status -r" exit 2 errors in the
daemon logs.
Broken by the the "ResourceMonitor as a pointer" patch.
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

Successfully merging this pull request may close these issues.

1 participant