# Unable to push basicstation

**URL:** <https://forums.balena.io/t/unable-to-push-basicstation/344262>\
**Category:** Product support\
**Created:** [August 16, 2021, 8:29am UTC](https://forums.balena.io/t/unable-to-push-basicstation/344262 "2021-08-16T08:29:27Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![eversteeg](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/eversteeg/32/6534_2.png) [@eversteeg](https://forums.balena.io/u/eversteeg)\
**Post date:** [August 16, 2021, 8:29am UTC](https://forums.balena.io/t/unable-to-push-basicstation/344262/1 "2021-08-16T08:29:27Z")

</div>

When pushing basisstation (with balena-CLI) to a RAK7248 (RAK2287) i get the following error:  
Error: The command '/bin/sh -c make platform=rpi variant=std arch=aarch64’returned a non-zero code 2  
Pushing the-things-stack works fine, using a link where a fleet is generated and also the release: The Things Stack Gateway it works fine.  
I would like to push the stack and basicstation.  
When i follow the tutorial for this i get the same error when i uncomment basicstation.  
So when building basicstation (CLI) the error occurs.  
OS version: balenaOS2.82.10+rev1, cloned the latest submodels.  
What is going wrong?

---

<div class="post-metadata">

**Author:** ![iamsolankiamit](https://avatars.discourse-cdn.com/v4/letter/i/a88e4f/32.png) [@iamsolankiamit](https://forums.balena.io/u/iamsolankiamit)\
**Post date:** [August 16, 2021, 8:52am UTC](https://forums.balena.io/t/unable-to-push-basicstation/344262/3 "2021-08-16T08:52:41Z")

</div>

Hi Evert,

did you try this tutorial [Deploy a LoRa Basics™ Station gateway with TTN and balena](https://www.balena.io/blog/deploy-a-basics-station-lora-gateway-with-ttn-and-balena/) ? I am trying to understand at what point are you getting stuck. Can you try pushing this code [GitHub - mpous/basicstation: LoRa Basics™ Station - The LoRaWAN Gateway Software](https://github.com/mpous/basicstation)

---

<div class="post-metadata">

**Author:** ![eversteeg](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/eversteeg/32/6534_2.png) [@eversteeg](https://forums.balena.io/u/eversteeg)\
**Post date:** [August 16, 2021, 9:29am UTC](https://forums.balena.io/t/unable-to-push-basicstation/344262/4 "2021-08-16T09:29:52Z")

</div>

Hi,  
I followed the tutorial ([Run your private The Things Stack network server on a Raspberry Pi with balena](https://www.balena.io/blog/run-your-private-the-things-stack-network-server-on-a-raspberry-pi-with-balena//)) and this works fine.  
I followed the tutorial ([Deploy a LoRa Basics™ Station gateway with TTN and balena](https://www.balena.io/blog/deploy-a-basics-station-lora-gateway-with-ttn-and-balena/)) this also works fine, but when i use the (optional) CLI method with the latest basicstation code from github. i get an error.  
I get stuck when pushing the basicstation code to balena using the CLI (on windows 10) in the build process for the basicstation service (container).

When i follow the tutorial for basicstation + stack i get the same error when i uncomment the basicstation submodule in the docker-ompose.yml.

 ![error](https://global.discourse-cdn.com/balena/original/2X/1/1c3bd521a6c872f40be46088444d58ee0ee6010a.png)

---

<div class="post-metadata">

**Author:** ![nitish](https://avatars.discourse-cdn.com/v4/letter/n/34f0e0/32.png) [@nitish](https://forums.balena.io/u/nitish)\
**Post date:** [August 16, 2021, 1:26pm UTC](https://forums.balena.io/t/unable-to-push-basicstation/344262/6 "2021-08-16T13:26:37Z")

</div>

Thanks @eversteeg for getting back. As I understand you are not able to get the container built for `basicstation` with the multiapp setup here: [the-things-stack-balena/docker-compose.yml at master · xoseperez/the-things-stack-balena · GitHub](https://github.com/xoseperez/the-things-stack-balena/blob/master/docker-compose.yml).

Can you try just pushing the basicstation service ([GitHub - mpous/basicstation: LoRa Basics™ Station - The LoRaWAN Gateway Software](https://github.com/mpous/basicstation)) as my colleague @iamsolankiamit has suggested above, and let us know if you are facing any errors?

Regards,  
N

---

<div class="post-metadata">

**Author:** ![mpous](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/mpous/32/4742_2.png) [@mpous](https://forums.balena.io/u/mpous)\
**Post date:** [August 16, 2021, 1:44pm UTC](https://forums.balena.io/t/unable-to-push-basicstation/344262/7 "2021-08-16T13:44:45Z")

</div>

What Raspberry Pi are you using @eversteeg ?

---

<div class="post-metadata">

**Author:** ![eversteeg](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/eversteeg/32/6534_2.png) [@eversteeg](https://forums.balena.io/u/eversteeg)\
**Post date:** [August 16, 2021, 2:03pm UTC](https://forums.balena.io/t/unable-to-push-basicstation/344262/8 "2021-08-16T14:03:52Z")

</div>

A Pi 4, 4GB, RAK7248, ordered for the the things academy summer school, just watched your video / Q&A

 ![error 3](https://global.discourse-cdn.com/balena/original/2X/9/95804d7722df41cb3f6b1df28c08ed7e6c8c5e7c.png)

---

<div class="post-metadata">

**Author:** ![mpous](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/mpous/32/4742_2.png) [@mpous](https://forums.balena.io/u/mpous)\
**Post date:** [August 16, 2021, 2:40pm UTC](https://forums.balena.io/t/unable-to-push-basicstation/344262/9 "2021-08-16T14:40:15Z")

</div>

That’s odd @eversteeg could you please give it another try?

---

<div class="post-metadata">

**Author:** ![eversteeg](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/eversteeg/32/6534_2.png) [@eversteeg](https://forums.balena.io/u/eversteeg)\
**Post date:** [August 16, 2021, 2:54pm UTC](https://forums.balena.io/t/unable-to-push-basicstation/344262/10 "2021-08-16T14:54:32Z")

</div>

@mpous Started all over with a new account, different computer, installed the CLI etc.  
No change.

I tried to start a fleet from the HUB (basicstation + LNS), i get the folllowing error with the release that comes with the project:

[Info] Starting build for the-things-stack-basicstation-balena, user e\_versteeg  
[Info] Dashboard link: [balena dashboard](https://dashboard.balena-cloud.com/apps/1855397/devices)  
[Error] Could not detect project type: Service basicstation: Could not find a Dockerfile for this service  
[Error] Not deploying release.

---

<div class="post-metadata">

**Author:** ![chrisys](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/chrisys/32/1731_2.png) [@chrisys](https://forums.balena.io/u/chrisys)\
**Post date:** [August 17, 2021, 10:34am UTC](https://forums.balena.io/t/unable-to-push-basicstation/344262/17 "2021-08-17T10:34:16Z")

</div>

@mpous @eversteeg the issue seems to be that the repository in question uses git submodules. When you use the deploy with balena process, the balena side is requesting the source from GitHub using their tarball feature. The balena backend takes the repo URL and uses to request a tarball of the repository from GitHub, which it then extracts and tries to build. The issue is that GitHub do not include submodules within their tarballs ([see here](https://github.com/dear-github/dear-github/issues/214)) - this appears to be a longstanding feature request which isn’t going to change soon. This is what causes the ‘Could not find a Dockerfile for this service’ error - because there simply is no Dockerfile for this service, as the submodule (in this case `basicstation`) has not been downloaded. The same issue would occur for the other two submodules (`wifi-connect` and `balena-legacy-packet-forwader`) if they were enabled.

This problem will also occur if you download the tarball or zip and extract it locally in order to use `balena push`, submodules are not included.

The only way to address this that I’m aware of is to clone the repository locally using `git` and then update the submodules using something like `git submodule update --recursive`, but this then requires that you have a local installation of git.

If GitHub does start building tarballs with the submodules included this will just start working, but until then I’d recommend avoiding their use - perhaps open an issue on the repo in question to highlight this. We do have this limitation highlighted in the [DWB docs](https://www.balena.io/docs/learn/deploy/deploy-with-balena-button/) also.

---

<div class="post-metadata">

**Author:** ![eversteeg](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/eversteeg/32/6534_2.png) [@eversteeg](https://forums.balena.io/u/eversteeg)\
**Post date:** [August 17, 2021, 2:18pm UTC](https://forums.balena.io/t/unable-to-push-basicstation/344262/19 "2021-08-17T14:18:22Z")

</div>

@chrisys @mpous I have git (for windows installed) and followed this readme: [GitHub - mpous/the-things-stack-basicstation-influxdb-grafana-balena](https://github.com/mpous/the-things-stack-basicstation-influxdb-grafana-balena)

Used this commands:  
git clone [GitHub - xoseperez/the-things-stack-balena: Deploys the The Things Stack LoRaWAN Network Server Open Sourc](https://github.com/xoseperez/balena-tts-lns.git)  
cd balena-tts-lns  
git submodule update --init =\> mudules are checked out (legacy-forwarder, basicstation and wifi)

Then did this: Edit the `docker-compose.yml` file and uncommented the BasicStation service.

Then: balena push fleet-name

I get the following error (it happens when buiding basicstation):

[basicstation] /bin/sh: 1: ./prep.sh: Permission denied  
[basicstation]  
[basicstation] make[1]: Leaving directory ‘/usr/src/app/deps/mbedtls’  
[basicstation] make[1]: \*\*\* [makefile:55: platform-rpi] Error 126  
[basicstation]  
[basicstation] make: \*\*\* [makefile:67: deps/mbedtls] Error 2  
[basicstation]  
[basicstation] Removing intermediate container c9fed18c782d  
[basicstation] The command ‘/bin/sh -c make platform=rpi variant=std arch=aarch64’ returned a non-zero code: 2

And a at the end:

[stack] Successfully built 83520653cee4  
[postgres] [=========================================================] 100%  
[Info] Uploading images  
[Success] Successfully uploaded images  
[Error] Some services failed to build:  
[Error] Service: basicstation  
[Error] Error: The command ‘/bin/sh -c make platform=rpi variant=std arch=aarch64’ returned a non-zero code: 2  
[Info] Built on arm02  
[Error] Not deploying release.  
Remote build failed

In the dashboard i see a release is statring to build.  
But it stops when the access is denied (some file in the cloud?)

The same happens when i push the basicstation container without stack, redis and postgress.

---

<div class="post-metadata">

**Author:** ![eversteeg](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/eversteeg/32/6534_2.png) [@eversteeg](https://forums.balena.io/u/eversteeg)\
**Post date:** [August 19, 2021, 5:41pm UTC](https://forums.balena.io/t/unable-to-push-basicstation/344262/20 "2021-08-19T17:41:10Z")

</div>

@mpous Up and running now, weird windows permission thing…  
Started again on macOS, now it works!  
Thanks for the help!

---

<div class="post-metadata">

**Author:** ![vipulgupta2048](https://avatars.discourse-cdn.com/v4/letter/v/a183cd/32.png) [@vipulgupta2048](https://forums.balena.io/u/vipulgupta2048)\
**Post date:** [August 20, 2021, 6:02am UTC](https://forums.balena.io/t/unable-to-push-basicstation/344262/21 "2021-08-20T06:02:03Z")

</div>

Glad to hear that it worked out for you, let us know if you need any more help!

---

<div class="post-metadata">

**Author:** ![tagar](https://avatars.discourse-cdn.com/v4/letter/t/ee59a6/32.png) [@tagar](https://forums.balena.io/u/tagar)\
**Post date:** [September 18, 2021, 11:37am UTC](https://forums.balena.io/t/unable-to-push-basicstation/344262/27 "2021-09-18T11:37:57Z")

</div>

Solved using this as Dockerfile.template  
FROM balenalib/%%BALENA\_MACHINE\_NAME%%-debian:buster-build as builder

WORKDIR /usr/src/app

COPY . .

RUN sudo chmod +x deps/mbedtls/prep.sh

RUN sudo chmod +x deps/lgw/prep.sh

RUN sudo chmod +x deps/lgw1302/prep.sh

RUN sudo chmod +x deps/smtcpico/prep.sh

RUN make platform=rpi variant=std arch=%%BALENA\_ARCH%%

RUN make platform=corecell variant=std arch=%%BALENA\_ARCH%%

FROM balenalib/%%BALENA\_MACHINE\_NAME%%-debian:buster

RUN install\_packages jq

WORKDIR /usr/src/app

COPY --from=builder /usr/src/app/ ./

COPY start\* ./

CMD [“bash”, “start.sh”]

---

<div class="post-metadata">

**Author:** ![mpous](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/mpous/32/4742_2.png) [@mpous](https://forums.balena.io/u/mpous)\
**Post date:** [September 20, 2021, 12:39pm UTC](https://forums.balena.io/t/unable-to-push-basicstation/344262/28 "2021-09-20T12:39:51Z")

</div>

Hello @tagar welcome to the balena forums. Are you running the basicstation on a Pi Zero?

---

<div class="post-metadata">

**Author:** ![mpous](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/mpous/32/4742_2.png) [@mpous](https://forums.balena.io/u/mpous)\
**Post date:** [October 21, 2021, 9:08am UTC](https://forums.balena.io/t/unable-to-push-basicstation/344262/31 "2021-10-21T09:08:45Z")

</div>

Hello @tagar I know this is an old issue and there is a pending PR to be accepted. I have tried myself and my pi zero is not working with this solution! Does it work on your side? Thanks!
