cells-sync icon indicating copy to clipboard operation
cells-sync copied to clipboard

on Linux, cells-sync can't be started using an absolute or $PATH command-line

Open jqueuniet opened this issue 3 years ago • 3 comments

Apparently, cells-sync tries to guess its own absolute path to execute a second process and fails to do it properly in some cases. Only a relative path command seems to work as expected for me.

using $PATH:

❯ cells-sync start
2022-10-20T08:22:44.307+0200	INFO	profiler	Exposing debug profiles for process 15545 on port 6060

2022-10-20T08:22:44.307+0200	INFO	update.service	Starting Updater Service
2022-10-20T08:22:44.307+0200	INFO	sync-task	Starting Sync Service
2022-10-20T08:22:44.307+0200	INFO	scanner	Use 'quit' or Ctrl+C to exit, type 'resync', 'dry', 'loop' to control syncs, 'pause' or 'resume'
2022-10-20T08:22:44.307+0200	INFO	systray	Starting sub-process with args systray --url http://localhost:3636
2022-10-20T08:22:44.307+0200	INFO	http-server	Starting HttpServer on localhost:3636
2022-10-20T08:22:44.308+0200	ERROR	systray	Error on sub process : fork/exec /home/johann/cells-sync: no such file or directory
2022-10-20T08:22:44.309+0200	INFO	systray	Starting sub-process with args systray --url http://localhost:3636
2022-10-20T08:22:44.309+0200	INFO	supervisor	cells-sync: Failed service '&control.SpawnedService{name:"systray", args:[]string{"systray", "--url", "http://localhost:3636"}, cancel:(context.CancelFunc)(nil), logCtx:(*context.valueCtx)(0xc0000d12f0)}' (1.000000 failures of 5.000000), restarting: true, error: fork/exec /home/johann/cells-sync: no such file or directory, stacktrace: goroutine 69 [running]:
github.com/thejerf/suture.(*Supervisor).runService.func1.1()
	/home/teamcity/go/pkg/mod/github.com/thejerf/[email protected]+incompatible/supervisor.go:636 +0x85
panic({0x1184040, 0xc0000d15c0})
	/usr/local/go/src/runtime/panic.go:884 +0x212
github.com/pydio/cells-sync/control.(*SpawnedService).Serve(0xc0001eb940)
	/opt/teamcity/agent/work/8ededc074aff6ace/src/cells-sync/control/spawned-service.go:65 +0x3f6
github.com/thejerf/suture.(*Supervisor).runService.func1()
	/home/teamcity/go/pkg/mod/github.com/thejerf/[email protected]+incompatible/supervisor.go:643 +0xaf
created by github.com/thejerf/suture.(*Supervisor).runService
	/home/teamcity/go/pkg/mod/github.com/thejerf/[email protected]+incompatible/supervisor.go:631 +0xa5

using an absolute path:

❯ /usr/local/bin/cells-sync start
2022-10-20T08:27:48.700+0200	INFO	update.service	Starting Updater Service
2022-10-20T08:27:48.700+0200	INFO	sync-task	Starting Sync Service
2022-10-20T08:27:48.700+0200	INFO	scanner	Use 'quit' or Ctrl+C to exit, type 'resync', 'dry', 'loop' to control syncs, 'pause' or 'resume'
2022-10-20T08:27:48.700+0200	INFO	systray	Starting sub-process with args systray --url http://localhost:3636
2022-10-20T08:27:48.700+0200	INFO	profiler	Exposing debug profiles for process 15752 on port 6060

2022-10-20T08:27:48.700+0200	INFO	http-server	Starting HttpServer on localhost:3636
2022-10-20T08:27:48.700+0200	ERROR	systray	Error on sub process : fork/exec /home/johann/usr/local/bin/cells-sync: no such file or directory
2022-10-20T08:27:48.700+0200	INFO	sync-task	fs:///home/johann/Cells is now connected
2022-10-20T08:27:48.700+0200	INFO	supervisor	cells-sync: Failed service '&control.SpawnedService{name:"systray", args:[]string{"systray", "--url", "http://localhost:3636"}, cancel:(context.CancelFunc)(nil), logCtx:(*context.valueCtx)(0xc00074f1d0)}' (1.000000 failures of 5.000000), restarting: true, error: fork/exec /home/johann/usr/local/bin/cells-sync: no such file or directory, stacktrace: goroutine 94 [running]:
github.com/thejerf/suture.(*Supervisor).runService.func1.1()
	/home/teamcity/go/pkg/mod/github.com/thejerf/[email protected]+incompatible/supervisor.go:636 +0x85
panic({0x1184040, 0xc000670810})
	/usr/local/go/src/runtime/panic.go:884 +0x212
github.com/pydio/cells-sync/control.(*SpawnedService).Serve(0xc0007581c0)
	/opt/teamcity/agent/work/8ededc074aff6ace/src/cells-sync/control/spawned-service.go:65 +0x3f6
github.com/thejerf/suture.(*Supervisor).runService.func1()
	/home/teamcity/go/pkg/mod/github.com/thejerf/[email protected]+incompatible/supervisor.go:643 +0xaf
created by github.com/thejerf/suture.(*Supervisor).runService
	/home/teamcity/go/pkg/mod/github.com/thejerf/[email protected]+incompatible/supervisor.go:631 +0xa5

using a relative command

❯ ../../../usr/local/bin/cells-sync start
2022-10-20T08:30:45.309+0200	INFO	scanner	Use 'quit' or Ctrl+C to exit, type 'resync', 'dry', 'loop' to control syncs, 'pause' or 'resume'
2022-10-20T08:30:45.309+0200	INFO	update.service	Starting Updater Service
2022-10-20T08:30:45.309+0200	INFO	sync-task	Starting Sync Service
2022-10-20T08:30:45.310+0200	INFO	systray	Starting sub-process with args systray --url http://localhost:3636
2022-10-20T08:30:45.309+0200	INFO	http-server	Starting HttpServer on localhost:3636
2022-10-20T08:30:45.309+0200	INFO	profiler	Exposing debug profiles for process 16037 on port 6060

2022-10-20T08:30:45.310+0200	INFO	sync-task	fs:///home/johann/Cells is now connected
2022-10-20T08:30:45.383+0200	INFO	systray	2022-10-20T08:30:45.383+0200	INFO	systray	Opened WS Connection

Observed using both bash and fish.

jqueuniet avatar Oct 20 '22 06:10 jqueuniet

Forgot to mention, this behavior happens using both cells-sync 0.9.2 and 0.9.3-dev.202210191531

jqueuniet avatar Oct 20 '22 06:10 jqueuniet

Similar issue when starting the GUI from the systray, but even the earlier relative command does not work there.

❯ ../../../usr/local/bin/cells-sync start
[...]
2022-10-20T23:27:40.887+0200	INFO	systray	2022-10-20T23:27:40.887+0200	ERROR	systray	Error while starting WebView - Opening in browser instead: fork/exec /home/johann/usr/local/bin/cells-sync: no such file or directory

Only thing that works at this point is to cwd to the cells-sync directory and execute it using a local relative command.

❯ cd /usr/local/bin/

/usr/local/bin🔒
❯ ./cells-sync start
[...]

jqueuniet avatar Oct 20 '22 21:10 jqueuniet

I have the same problem.

MnlPhlp avatar Oct 21 '22 10:10 MnlPhlp