Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 652206 - app-emulation/lxd-3.0.0: daemon crashes with LXD_OPTIONS+=" --syslog"
Summary: app-emulation/lxd-3.0.0: daemon crashes with LXD_OPTIONS+=" --syslog"
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Erik Mackdanz
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-04-02 12:46 UTC by Nils Freydank
Modified: 2018-04-08 20:06 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info lxc lxd (file_652206.txt,7.94 KB, text/plain)
2018-04-02 12:49 UTC, Nils Freydank
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nils Freydank 2018-04-02 12:46:19 UTC
Hi, when upgrading lxd to 3.0.0 the lxc client can't connect to the local instance anymore:

Error: Get http://unix.socket/1.0: dial unix /var/lib/lxd/unix.socket: connect: no such file or directory

Accessing remote image servers seems to work though, as "lxc image list images:" works correctly.

Maybe a bump of app-emulation/lxc is necessary, too?

Reproducible: Always

Steps to Reproduce:
1.sudo emerge --ask '=app-emulation/lxd-3.0.0'
2.sudo /etc/init.d/lxd start || sudo /etc/init.d/lxd restart
3.lxc ls
Comment 1 Nils Freydank 2018-04-02 12:49:21 UTC
Created attachment 526328 [details]
emerge --info lxc lxd
Comment 2 Erik Mackdanz gentoo-dev 2018-04-02 23:35:47 UTC
The missing socket means the daemon isn't running.

You can get useful output by running the daemon in the foreground.  In a root shell run:

  /usr/sbin/lxd --group lxd --verbose --debug

I expect you'll see a clear error message before it exits, which should help you get unwedged.  If not, you can post the output here and I'll try to help.

I haven't reproduced this issue.
Comment 3 Nils Freydank 2018-04-03 17:21:50 UTC
You're right, the daemon crashed. I didn't notice as OpenRC just prints the OK:
% sudo /etc/init.d/lxd start
lxd | * Starting lxd service ...   [ ok ]

% sudo /etc/init.d/lxd status
* status: crashed

It doesn't crash with the manual startup through your debug command:
(I know of the cgroups errors, but they shouldn't be critical here as lxd2 has no problem with them. IMHO the sqlite errors sound weirder.)

% sudo /usr/sbin/lxd --group lxd --verbose --debug 
INFO[04-03|19:12:36] LXD 3.0.0 is starting in normal mode     path=/var/lib/lxd
INFO[04-03|19:12:36] Kernel uid/gid map: 
INFO[04-03|19:12:36]  - u 0 0 4294967295 
INFO[04-03|19:12:36]  - g 0 0 4294967295 
INFO[04-03|19:12:36] Configured LXD uid/gid map: 
INFO[04-03|19:12:36]  - u 0 1000000 65537 
INFO[04-03|19:12:36]  - g 0 1000000 65537 
WARN[04-03|19:12:36] AppArmor support has been disabled because of lack of kernel support 
WARN[04-03|19:12:36] Couldn't find the CGroup blkio, I/O limits will be ignored. 
WARN[04-03|19:12:36] Couldn't find the CGroup CPU controller, CPU time limits will be ignored. 
WARN[04-03|19:12:36] Couldn't find the CGroup CPUacct controller, CPU accounting will not be available. 
WARN[04-03|19:12:36] Couldn't find the CGroup CPUset controller, CPU pinning will be ignored. 
WARN[04-03|19:12:36] Couldn't find the CGroup devices controller, device access control won't work. 
WARN[04-03|19:12:36] Couldn't find the CGroup memory controller, memory limits will be ignored. 
WARN[04-03|19:12:36] Couldn't find the CGroup network class controller, network limits will be ignored. 
WARN[04-03|19:12:36] Couldn't find the CGroup pids controller, process limits will be ignored. 
WARN[04-03|19:12:36] CGroup memory swap accounting is disabled, swap limits will be ignored. 
INFO[04-03|19:12:36] Initializing database gateway 
INFO[04-03|19:12:36] Start database node                      address= id=1
INFO[04-03|19:12:37] Raft: Initial configuration (index=1): [{Suffrage:Voter ID:1 Address:0}] 
INFO[04-03|19:12:37] Raft: Node at 0 [Leader] entering Leader state 
INFO[04-03|19:12:37] LXD isn't socket activated 
INFO[04-03|19:12:37] Starting /dev/lxd handler: 
INFO[04-03|19:12:37]  - binding devlxd socket                 socket=/var/lib/lxd/devlxd/sock
INFO[04-03|19:12:37] REST API daemon: 
INFO[04-03|19:12:37]  - binding Unix socket                   socket=/var/lib/lxd/unix.socket
INFO[04-03|19:12:37]  - binding TCP socket                    socket=1.2.3.4:8443
DBUG[04-03|19:12:37] Initializing and checking storage pool "default".
DBUG[04-03|19:12:37] Initializing a DIR driver.
DBUG[04-03|19:12:37] Checking DIR storage pool "default".
DBUG[04-03|19:12:37] Initializing a DIR driver.
DBUG[04-03|19:12:37] Connecting to a remote simplestreams server
DBUG[04-03|19:12:37] Connecting to a remote simplestreams server
DBUG[04-03|19:12:37] Initialized inotify with file descriptor 14
INFO[04-03|19:12:37] Pruning expired images
INFO[04-03|19:12:37] Done pruning expired images
INFO[04-03|19:12:37] Updating instance types
INFO[04-03|19:12:37] Expiring log files
INFO[04-03|19:12:37] Updating images
INFO[04-03|19:12:37] Done expiring log files
DBUG[04-03|19:12:37] Database error: &errors.errorString{s:"sql: no rows in result set"}
DBUG[04-03|19:12:37] Database error: &errors.errorString{s:"sql: no rows in result set"}
DBUG[04-03|19:12:37] Database error: &errors.errorString{s:"sql: no rows in result set"}
INFO[04-03|19:12:37] Done updating images
INFO[04-03|19:12:39] Done updating instance types
^C
INFO[04-03|19:13:23] Received 'interrupt signal', exiting.
INFO[04-03|19:13:23] Stopping REST API handler:
INFO[04-03|19:13:23]  - closing socket                        socket=1.2.3.4:8443
INFO[04-03|19:13:23]  - closing socket                        socket=/var/lib/lxd/unix.socket
INFO[04-03|19:13:23] Stopping /dev/lxd handler
INFO[04-03|19:13:23]  - closing socket                        socket=/var/lib/lxd/devlxd/sock
INFO[04-03|19:13:23] Closing the database
INFO[04-03|19:13:23] Stop database gateway
INFO[04-03|19:13:23] Stop raft instance
INFO[04-03|19:13:23] Stopping REST API handler:
INFO[04-03|19:13:23] Stopping /dev/lxd handler
INFO[04-03|19:13:23] Stopping REST API handler:
INFO[04-03|19:13:23] Stopping /dev/lxd handler
INFO[04-03|19:13:23] Unmounting temporary filesystems
INFO[04-03|19:13:23] Done unmounting temporary filesystems
INFO[04-03|19:13:23] Saving simplestreams cache
INFO[04-03|19:13:23] Saved simplestreams cache
Comment 4 Erik Mackdanz gentoo-dev 2018-04-04 01:51:49 UTC
Comparing your output to mine, I don't see any real errors there.  I'm sure the sql "no rows in result set" messages can be ignored.  

My daemon, like yours, starts serving requests immediately after "Done updating instance types":

...
INFO[04-03|18:33:16] Done updating instance types
^CINFO[04-03|20:20:52] Received 'interrupt signal', exiting.
...

When running the daemon in the foreground, are you able to interact normally in another (non-root) terminal?  e.g. 'lxc ls' etc.

If so, then your issue is specific to the init script.  Do you have anything non-standard in /etc/conf.d/lxd?

Or, do you maybe have an old pidfile that needs to be deleted?  /run/lxd.pid

Finally, if you have lxcfs check if it the lxcfs daemon starts successfully.  I just noticed that mine does not until I 'mkdir /var/lib/lxcfs'.  I'll upgrade lxcfs this week and fix that issue at the same time.
Comment 5 Nils Freydank 2018-04-06 21:20:31 UTC
It crashes with syslog logging enabled!

"user % /usr/sbin/lxd --help" doesn't show --syslog in lxd-3.0.0. Did upstream maybe drop the support for it?

Iā€™m running app-admin/syslog-ng-3.14.1 with USE="caps", and AFAICS every local user is able to send messages through "logger 'lxd related logging test.'".


(FTR: While trying to find the issue I bumped lxc and lxcfs each to 3.0.0 locally and both seem to run fine on my machine so far.)
Comment 6 Larry the Git Cow gentoo-dev 2018-04-08 20:05:15 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=aef61f3e7622e190f8833f0738661647c279a4f9

commit aef61f3e7622e190f8833f0738661647c279a4f9
Author:     Erik Mackdanz <stasibear@gentoo.org>
AuthorDate: 2018-04-08 20:04:56 +0000
Commit:     Erik Mackdanz <stasibear@gentoo.org>
CommitDate: 2018-04-08 20:04:56 +0000

    app-emulation/lxd: Support latest confd options
    
    Closes: https://bugs.gentoo.org/652206
    Package-Manager: Portage-2.3.26, Repoman-2.3.7

 app-emulation/lxd/files/lxd.confd.1   |  24 ++++
 app-emulation/lxd/lxd-3.0.0-r1.ebuild | 251 ++++++++++++++++++++++++++++++++++
 app-emulation/lxd/metadata.xml        |   4 +-
 3 files changed, 277 insertions(+), 2 deletions(-)
Comment 7 Erik Mackdanz gentoo-dev 2018-04-08 20:06:34 UTC
Good catch.  --syslog is no longer supported (and --print-goroutines-every was renamed).  I've pushed -r1 with this fix.