Hello guys,
I’m currently trying to build a snap targeting the Raspberry Pi 4 Model B running Ubuntu Core 18 arm64. I first want it to run on my local machine (Ubuntu 16.04). Basically I want to set up a nodejs server, so I am using the nodejs plugin
My first snapcraft.yaml looks like that:
name: printer-server-iot
base: core18
version: '0.1' # just for humans, typically '1.2+git' or '1.3.2'
summary: printer server with iot compabilities
description: |
local printer server used for controlling thermal printers
grade: devel
confinement: devmode
parts:
printer-server-iot:
plugin: nodejs
nodejs-version: 12.16.2
nodejs-package-manager: npm
source: .
# check server status by: systemctl status snap.printer-server-iot.printer-server-iot.service
apps:
printer-server-iot:
command: printer-server-iot
daemon: simple
I’m building the image by “snapcraft --debug” which works fine. Afterwards I install the snap by “snap install printer-server-iot_0.1_amd64.snap --devmode”. Now when I check the service status of the server by “systemctl status snap.[…]”, I can see that the server has failed to start and is not running.
I checked the logs of the snap by “snap logs printer-server-iot”. And I get the following logs:
2020-11-30T13:59:28Z printer-server-iot.printer-server-iot[16150]: /snap/printer-server-iot/x1/bin/printer-server-iot: 1: /snap/printer-server-iot/x1/bin/printer-server-iot: Syntax error: word unexpected (expecting “)”) 2020-11-30T13:59:28Z systemd[1]: snap.printer-server-iot.printer-server-iot.service: Main process exited, code=exited, status=2/INVALIDARGUMENT 2020-11-30T13:59:28Z systemd[1]: snap.printer-server-iot.printer-server-iot.service: Unit entered failed state. 2020-11-30T13:59:28Z systemd[1]: snap.printer-server-iot.printer-server-iot.service: Failed with result ‘exit-code’. 2020-11-30T13:59:29Z systemd[1]: snap.printer-server-iot.printer-server-iot.service: Service hold-off time over, scheduling restart. 2020-11-30T13:59:29Z systemd[1]: Stopped Service for snap application printer-server-iot.printer-server-iot. 2020-11-30T13:59:29Z systemd[1]: snap.printer-server-iot.printer-server-iot.service: Start request repeated too quickly. 2020-11-30T13:59:29Z systemd[1]: Failed to start Service for snap application printer-server-iot.printer-server-iot. 2020-11-30T13:59:29Z systemd[1]: snap.printer-server-iot.printer-server-iot.service: Unit entered failed state. 2020-11-30T13:59:29Z systemd[1]: snap.printer-server-iot.printer-server-iot.service: Failed with result ‘start-limit-hit’.
Which points me to the error - Syntax error: word unexpected (expecting “)”)
I investigated some time to find out about the root of this error and the resources often pointing me to some cross-compilation issues and hardware architecture mix ups.
Previously I have built some other example snaps based on the go plugin instead of nodejs. The examples before worked fine on my machine. But this time It doesn’t.
I’m pretty new to snapcraft and building images I hope you can help me.
Thank you guys.
UPDATE:
I have also tried to run it on Ubuntu 18.04 and I get the same Error.