Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]Missing shebang in preinst script of the DEB package #265

Closed
pehedima opened this issue Mar 20, 2020 · 1 comment
Closed

[BUG]Missing shebang in preinst script of the DEB package #265

pehedima opened this issue Mar 20, 2020 · 1 comment

Comments

@pehedima
Copy link

Hi,

I tried to install the newest python3-thingsboard-gateway.deb using balena deploy (docker) for emulation on RasPI, architecture armv7hf instead of amd64.

During install of the python3-thingsboard-gateway.deb package itself the following "exec format error" occurs:

[Build]   main Selecting previously unselected package python3-thingsboard-gateway.
[Build]   main Preparing to unpack .../117-python3-thingsboard-gateway.deb ...
[Build]   main Error while loading /var/lib/dpkg/tmp.ci/preinst: Exec format error
[Build]   main dpkg: error processing archive /tmp/apt-dpkg-install-5fGeJY/117-python3-thingsboard-gateway.deb (--unpack):
[Build]   main  new python3-thingsboard-gateway package pre-installation script subprocess returned error exit status 1
[Build]   main Selecting previously unselected package python3-wheel.
[Build]   main Preparing to unpack .../118-python3-wheel_0.30.0-0.2_all.deb ...
[Build]   main Unpacking python3-wheel (0.30.0-0.2) ...
[Build]   main Selecting previously unselected package python3-xdg.
[Build]   main Preparing to unpack .../119-python3-xdg_0.25-4ubuntu1_all.deb ...
[Build]   main Unpacking python3-xdg (0.25-4ubuntu1) ...
[Build]   main Errors were encountered while processing:
[Build]   main  /tmp/apt-dpkg-install-5fGeJY/117-python3-thingsboard-gateway.deb
[Build]   main E: Sub-process /usr/bin/dpkg returned an error code (1)
[Build]   Built 1 service in 5:56
[Error]   Deploy failed
The command '/tmp/qemu-execve -execve /bin/sh -c sudo apt-get install -y /python3-thingsboard-gateway.deb' returned a non-zero code: 100

I found out, that the preinst script have had no shebang inside. So I added the following lines at the beginning:

#!/bin/sh
set -e
...

After generating the new DEB package the installation was successfull:

[Build]   main Selecting previously unselected package python3-thingsboard-gateway.
[Build]   main Preparing to unpack .../121-python3-thingsboard-gateway.deb ...
[Build]   main Installing directory for configs...
[Build]   main Adding system user `thingsboard_gateway' (UID 101) ...
[Build]   main Adding new group `thingsboard_gateway' (GID 102) ...
[Build]   main Adding new user `thingsboard_gateway' (UID 101) with group `thingsboard_gateway' ...

Please insert the missing lines in your next release. Thanks.

@imbeacon
Copy link
Member

Hi @pehedima,

Thanks for your investigations and solution for this issue, we will add it into the new release.

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

No branches or pull requests

2 participants