Refresh process failed on new snap release

Hi, services failed on refresh process when we built a new snap release:

root@ubuntu20-snaptest:~# snap install --dangerous gluu-server_4.2.1_amd64.snap
error: cannot perform the following tasks:
- Start snap "gluu-server" (unset) services ([start snap.gluu-server.apache2.service] failed with exit status 1: Job for snap.gluu-server.apache2.service failed because the control process exited with error code.
See "systemctl status snap.gluu-server.apache2.service" and "journalctl -xe" for details.
)
root@snap-test:~# snap install --dangerous gluu-server_4.2.1_amd64.snap
error: cannot perform the following tasks:
- Start snap "gluu-server" (unset) services ([start snap.gluu-server.scim.service] failed with exit status 1: Job for snap.gluu-server.scim.service failed because the control process exited with error code.
See
root@ubuntu20-snaptest:~# snap services gluu-server
Service                  Startup   Current   Notes
gluu-server.apache       disabled  inactive  -
gluu-server.casa         disabled  inactive  -
gluu-server.gluu-radius  disabled  inactive  -
gluu-server.identity     disabled  inactive  -
gluu-server.idp          disabled  inactive  -
gluu-server.opendj       disabled  inactive  -
gluu-server.oxauth       disabled  inactive  -
gluu-server.oxauth-rp    disabled  inactive  -
gluu-server.oxd-server   disabled  inactive  -
gluu-server.passport     disabled  inactive  -
gluu-server.yacron       enabled   active    -
root@ubuntu20-snaptest:~#

Hi, is the snap services output from before or after the attempted refresh? Also, can you clarify if there are any new services in the version of gluu-server that is being refreshed to? I don’t see scim in the snap services output.

@ijohnson Hi first of all thanks for your replied, here is the complete output before and after:

root@ubuntu18-snaptest:~# snap services gluu-server
Service                  Startup   Current   Notes
gluu-server.apache       disabled  active    -
gluu-server.casa         disabled  inactive  -
gluu-server.gluu-radius  disabled  inactive  -
gluu-server.identity     disabled  active    -
gluu-server.idp          disabled  inactive  -
gluu-server.opendj       disabled  active    -
gluu-server.oxauth       disabled  active    -
gluu-server.oxauth-rp    disabled  inactive  -
gluu-server.oxd-server   disabled  inactive  -
gluu-server.passport     disabled  inactive  -
gluu-server.yacron       enabled   active    -
root@ubuntu18-snaptest:~# /var/snap/gluu-server/common/install/community_edition_setup/post-setup.py
Connecting plugs: block-devices, mount-observe, system-observe, network-observe
error: snap "gluu-server" has no plug named "block-devices"
Setting ulimits
root@ubuntu18-snaptest:~# ls
gluu-server_4.2.1_amd64.snap  snap
root@ubuntu18-snaptest:~# snap reresh gluu-server_4.2.1_amd64.snap
error: unknown command "reresh", see 'snap help'.
root@ubuntu18-snaptest:~# snap refresh gluu-server_4.2.1_amd64.snap
snap "gluu-server_4.2.1_amd64.snap" is not installed
root@ubuntu18-snaptest:~# snap install --dangerous gluu-server_4.2.1_amd64.snap
error: cannot perform the following tasks:
- Start snap "gluu-server" (unset) services ([start snap.gluu-server.scim.service] failed with exit status 1: Job for snap.gluu-server.scim.service failed because the control process exited with error code.
See "systemctl status snap.gluu-server.scim.service" and "journalctl -xe" for details.
)
root@ubuntu18-snaptest:~# snap services gluu-server
Service                  Startup   Current   Notes
gluu-server.apache       disabled  inactive  -
gluu-server.casa         disabled  inactive  -
gluu-server.gluu-radius  disabled  inactive  -
gluu-server.identity     disabled  inactive  -
gluu-server.idp          disabled  inactive  -
gluu-server.opendj       disabled  inactive  -
gluu-server.oxauth       disabled  inactive  -
gluu-server.oxauth-rp    disabled  inactive  -
gluu-server.oxd-server   disabled  inactive  -
gluu-server.passport     disabled  inactive  -
gluu-server.yacron       enabled   active    -
root@ubuntu18-snaptest:~#

and Yes we added a new services scim, I will also post the update process on Ubuntu 20.04, that one is 18.04

@ijohnson here are our snapcraft.yaml files for both versions:


So this seems to be a bug with your scim service in the new version of the snap, can you provide the logs for that service? journalctl --no-pager -u snap.gluu-server.scim

Also, AFAICT snapd is not doing anything wrong here, it is not trying to start services which are disabled, etc.

here is the output:

root@ubuntu20-snaptest:~#  journalctl --no-pager -u snap.gluu-server.scim
-- Logs begin at Thu 2020-08-20 16:07:05 UTC, end at Thu 2020-08-20 16:12:09 UTC. --
Aug 20 16:11:44 ubuntu20-snaptest systemd[1]: Starting Service for snap application gluu-server.scim...
Aug 20 16:11:45 ubuntu20-snaptest gluu-server.scim[3767]: ** ERROR: JETTY_HOME not set, you need to set it or install in a standard location
Aug 20 16:11:45 ubuntu20-snaptest systemd[1]: snap.gluu-server.scim.service: Control process exited, code=exited, status=1/FAILURE
Aug 20 16:11:45 ubuntu20-snaptest systemd[1]: snap.gluu-server.scim.service: Failed with result 'exit-code'.
Aug 20 16:11:45 ubuntu20-snaptest systemd[1]: Failed to start Service for snap application gluu-server.scim.
root@ubuntu20-snaptest:~#

this is from 18.04:

root@ubuntu18-snaptest:~# snap install --dangerous gluu-server_4.2.1_amd64.snap
error: cannot perform the following tasks:
- Start snap "gluu-server" (unset) services ([start snap.gluu-server.fido2.service] failed with exit status 1: Job for snap.gluu-server.fido2.service failed because the control process exited with error code.
See "systemctl status snap.gluu-server.fido2.service" and "journalctl -xe" for details.
)
root@ubuntu18-snaptest:~# journalctl --no-pager -u snap.gluu-server.fido2.service
-- Logs begin at Thu 2020-08-20 16:07:55 UTC, end at Thu 2020-08-20 16:17:26 UTC. --
Aug 20 16:17:14 ubuntu18-snaptest systemd[1]: Starting Service for snap application gluu-server.fido2...
Aug 20 16:17:14 ubuntu18-snaptest gluu-server.fido2[8407]: ** ERROR: JETTY_HOME not set, you need to set it or install in a standard location
Aug 20 16:17:14 ubuntu18-snaptest systemd[1]: snap.gluu-server.fido2.service: Control process exited, code=exited status=1
Aug 20 16:17:14 ubuntu18-snaptest systemd[1]: snap.gluu-server.fido2.service: Failed with result 'exit-code'.
Aug 20 16:17:14 ubuntu18-snaptest systemd[1]: Failed to start Service for snap application gluu-server.fido2.
root@ubuntu18-snaptest:~#

I don’t know what JETTY_HOME is, but that environment variable should be set somehow by your snap for this to work