# I cant push my project to the Balena repository

**URL:** <https://forums.balena.io/t/i-cant-push-my-project-to-the-balena-repository/44248>\
**Category:** Project help\
**Created:** [November 14, 2019, 10:17am UTC](https://forums.balena.io/t/i-cant-push-my-project-to-the-balena-repository/44248 "2019-11-14T10:17:34Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![aburbano](https://avatars.discourse-cdn.com/v4/letter/a/3bc359/32.png) [@aburbano](https://forums.balena.io/u/aburbano)\
**Post date:** [November 14, 2019, 10:17am UTC](https://forums.balena.io/t/i-cant-push-my-project-to-the-balena-repository/44248/1 "2019-11-14T10:17:34Z")

</div>

After testing and tuning my project into balena I organized a repository in bitbucket where I plan to keep and maintain the sources for the final version of my Balena based device. Now I’m trying to pull this repository to a new balena application in BalenaCloud.

I added the balena endpoint to my git repository via “git remote add balena [myuser@git.balena-cloud.com](mailto:myuser@git.balena-cloud.com):myuser/balenaApp.git” then I push code with “git push balena master”. However I still getting the following error:

> [Info] Starting build for 3dcamintegration, user andres  
> [Info] Dashboard link: [balena dashboard](https://dashboard.balena-cloud.com/apps/1542517/devices)  
> [Error] Could not detect project type: Service main: Could not find a Dockerfile for this service  
> [Error] Not deploying release.
> 
> remote: error: hook declined to update refs/heads/master  
> To [andres@git.balena-cloud.com](mailto:andres@git.balena-cloud.com):andres/3dcamintegration.git  
> ! [remote rejected] master → master (hook declined)  
> error: failed to push some refs to

I have the same code working in another balena app and there is the docker-compose.yml, so I dont know why it is falling, have you experience this before?

---

<div class="post-metadata">

**Author:** ![sradevski](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/sradevski/32/1609_2.png) [@sradevski](https://forums.balena.io/u/sradevski)\
**Post date:** [November 14, 2019, 10:43am UTC](https://forums.balena.io/t/i-cant-push-my-project-to-the-balena-repository/44248/2 "2019-11-14T10:43:22Z")

</div>

Hi there, as the error says, it seems a Dockerfile is missing for the `main` service. Can you post your docker-compose here? I suspect you might have a `build` field for the `main` service, but the `main` service doesn’t have a Dockerfile.

---

<div class="post-metadata">

**Author:** ![aburbano](https://avatars.discourse-cdn.com/v4/letter/a/3bc359/32.png) [@aburbano](https://forums.balena.io/u/aburbano)\
**Post date:** [November 14, 2019, 10:44am UTC](https://forums.balena.io/t/i-cant-push-my-project-to-the-balena-repository/44248/3 "2019-11-14T10:44:18Z")

</div>

version: ‘2’  
volumes:  
cam-config-data: {}  
services:  
vpa:  
restart: always  
build: ./vpa  
privileged: true  
web:  
restart: always  
build: ./webservice  
network\_mode: host  
ports:  
- “80:80”  
- “443:443”  
services:  
restart: always  
build : ./services  
network\_mode: host  
volumes:  
- ‘cam-config-data:/data’  
depends\_on:  
- web  
labels:  
io.balena.features.balena-api: ‘1’  
io.balena.features.dbus: ‘1’  
finder:  
restart: always  
build : ./finder  
network\_mode: host

---

<div class="post-metadata">

**Author:** ![aburbano](https://avatars.discourse-cdn.com/v4/letter/a/3bc359/32.png) [@aburbano](https://forums.balena.io/u/aburbano)\
**Post date:** [November 14, 2019, 10:46am UTC](https://forums.balena.io/t/i-cant-push-my-project-to-the-balena-repository/44248/4 "2019-11-14T10:46:43Z")

</div>

Dear @sradevski, I already check that ever container has the Dockerfile.templete, I also leave the application with only 1 container, but still the same error while pushing.

---

<div class="post-metadata">

**Author:** ![sradevski](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/sradevski/32/1609_2.png) [@sradevski](https://forums.balena.io/u/sradevski)\
**Post date:** [November 14, 2019, 10:47am UTC](https://forums.balena.io/t/i-cant-push-my-project-to-the-balena-repository/44248/5 "2019-11-14T10:47:48Z")

</div>

I don’t see anything wrong with the docker-compose, so that one should work. Can you try pushing the project to your app using the balena CLI? Also, was there anything else pushed to that app before that differs from what you are pushing now? If that’s the case, you will need to force push with git to overwrite the previous content. Try both of those first, and we can take it from there.

---

<div class="post-metadata">

**Author:** ![aburbano](https://avatars.discourse-cdn.com/v4/letter/a/3bc359/32.png) [@aburbano](https://forums.balena.io/u/aburbano)\
**Post date:** [November 14, 2019, 10:49am UTC](https://forums.balena.io/t/i-cant-push-my-project-to-the-balena-repository/44248/6 "2019-11-14T10:49:24Z")

</div>

I didnt push anything before, and I’m trying balena push , let you know about the results.

---

<div class="post-metadata">

**Author:** ![aburbano](https://avatars.discourse-cdn.com/v4/letter/a/3bc359/32.png) [@aburbano](https://forums.balena.io/u/aburbano)\
**Post date:** [November 15, 2019, 9:44am UTC](https://forums.balena.io/t/i-cant-push-my-project-to-the-balena-repository/44248/8 "2019-11-15T09:44:23Z")

</div>

It worked using “balena push app”, but I dont know why it takes several minutes, like 30 mins before it start really uploading the source files.  
Also after doing the first push with Balena, I tried with git, but still having the same problem. So why exactly is not the same using balena or git push? There is a way to solve it? I prefer to use git push because is way faster.

As it was very slow, I tried using Cli to push directly to the device in order to avoid to pass through BalenaCloud, but every time I tried the connection was broken. Any clues to improve my workflow?

---

<div class="post-metadata">

**Author:** ![karaxuna](https://avatars.discourse-cdn.com/v4/letter/k/e480ec/32.png) [@karaxuna](https://forums.balena.io/u/karaxuna)\
**Post date:** [November 15, 2019, 11:45am UTC](https://forums.balena.io/t/i-cant-push-my-project-to-the-balena-repository/44248/11 "2019-11-15T11:45:43Z")

</div>

Reasons why `git push` may not work when `balena push` does work:

- You may not have not committed some files, like `docker-compose.yml` or `Dockerfile` or a subfolder for a service. Running `git status` might show something “untracked”.
- Your `.gitignore` file (in the root folder or in subfolders) may be ignoring some files – which then would not show as “untracked”, but would not be committed.

---

<div class="post-metadata">

**Author:** ![karaxuna](https://avatars.discourse-cdn.com/v4/letter/k/e480ec/32.png) [@karaxuna](https://forums.balena.io/u/karaxuna)\
**Post date:** [November 15, 2019, 11:50am UTC](https://forums.balena.io/t/i-cant-push-my-project-to-the-balena-repository/44248/13 "2019-11-15T11:50:16Z")

</div>

Reason why “balena push” may be much slower than “git push”, it may be because it is uploading a lot of files. “git push” only transfers a git diff of the contents, whereas “balena push” transfers everything every time. If there are files that are not strictly needed in the build and final image, you could perhaps list those files in a .dockerignore file.

---

<div class="post-metadata">

**Author:** ![aburbano](https://avatars.discourse-cdn.com/v4/letter/a/3bc359/32.png) [@aburbano](https://forums.balena.io/u/aburbano)\
**Post date:** [November 15, 2019, 12:51pm UTC](https://forums.balena.io/t/i-cant-push-my-project-to-the-balena-repository/44248/16 "2019-11-15T12:51:08Z")

</div>

I don’t think is neither of these 2 reasons.

> $ git status  
> On branch balenaintegration  
> Your branch is up-to-date with ‘origin/balenaintegration’.  
> nothing to commit, working directory clean  
> and :  
> $ cat .gitignore  
> \*.pyc

The whole folder, including .git files and all in all, is only 6.2M  
Maybe the problem is at the security level?  
As I mentioned before, this is an original repository in bitbucket where several people are working in and are the sum of several testing other apps in Balena that are working, I’m just uploading this to my new app.

---

<div class="post-metadata">

**Author:** ![hedss](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/hedss/32/210_2.png) [@hedss](https://forums.balena.io/u/hedss)\
**Post date:** [November 15, 2019, 1:00pm UTC](https://forums.balena.io/t/i-cant-push-my-project-to-the-balena-repository/44248/17 "2019-11-15T13:00:57Z")

</div>

Hi there,

It does not sound like a security issue, as if your key was not valid it would not have sent anything to the builder, but as mentioned earlier missing files that aren’t being pushed. By the sounds of a 30 minute `balena push` that implies there is a lot of data being packaged up and sent to the builders. In the root of your project, where you’re either `git push`ing or `balena push`ing, could you please run `du -hc` and give us the results?

Can you just clarify that the contents of `.gitignore` is _just_ `*.pyc` please, as this looks like the response you sent us is slightly garbled?

Thanks and best regards,

Heds

---

<div class="post-metadata">

**Author:** ![hedss](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/hedss/32/210_2.png) [@hedss](https://forums.balena.io/u/hedss)\
**Post date:** [November 15, 2019, 1:05pm UTC](https://forums.balena.io/t/i-cant-push-my-project-to-the-balena-repository/44248/19 "2019-11-15T13:05:02Z")

</div>

Hi,

Just one more thought, the original `git push` issue looks like it isn’t picking the fact up that the `docker-compose.yml` file exists. Can you ensure that it is actually called that, and is in the root of the repository?

Thanks and best regards,

Heds

---

<div class="post-metadata">

**Author:** ![hedss](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/hedss/32/210_2.png) [@hedss](https://forums.balena.io/u/hedss)\
**Post date:** [November 15, 2019, 1:14pm UTC](https://forums.balena.io/t/i-cant-push-my-project-to-the-balena-repository/44248/22 "2019-11-15T13:14:07Z")

</div>

Hi again,

Thanks, so there’s a couple of things to note here. The first is that there’s no `docker-compose.yml` in the root of your repository, so when you run `git push`, the builder can’t find it and it assumes it’s looking for a `Dockerfile[.template]` instead, which of course also doesn’t exist. You pasted the contents of a `docker-compose.yml` file earlier, where does this actually reside?

I’m also unsure how `balena push` is working if `git push` is not, given there’s no `docker-compose.yml` file. Were you `balena push`ing from the same directory?

Best regards,

Heds

---

<div class="post-metadata">

**Author:** ![aburbano](https://avatars.discourse-cdn.com/v4/letter/a/3bc359/32.png) [@aburbano](https://forums.balena.io/u/aburbano)\
**Post date:** [November 15, 2019, 1:14pm UTC](https://forums.balena.io/t/i-cant-push-my-project-to-the-balena-repository/44248/23 "2019-11-15T13:14:12Z")

</div>

The content of the file .gitignore is only \*.pyc. Is just to show that im not ignoring the balena files.

The `docker-compose.yml` exist, I think you can access to Applications\>appexample.  
I dont thins is about structure of the project and Docker files, because it is working with balena push.

Other thing, is very fast at the moment it starts the uploand but while is showing `" Uploading source package to balena cloud"` this is what takes time.

---

<div class="post-metadata">

**Author:** ![hedss](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/hedss/32/210_2.png) [@hedss](https://forums.balena.io/u/hedss)\
**Post date:** [November 15, 2019, 1:16pm UTC](https://forums.balena.io/t/i-cant-push-my-project-to-the-balena-repository/44248/24 "2019-11-15T13:16:41Z")

</div>

Hi,

Yes, so it sounds like `balena push` is trying to package up everything possibly including the `.git` directory, perhaps, but this should be ignored by default. Is the repository you’re trying to push public or private? If public, I could try and replicate this here if you give me a link to the project.

Whilst you say the `docker-compose.yml` exists, it does not appear to be in the output you pasted in the response above, which was the whole of the project to push?

Best regards,

Heds

---

<div class="post-metadata">

**Author:** ![aburbano](https://avatars.discourse-cdn.com/v4/letter/a/3bc359/32.png) [@aburbano](https://forums.balena.io/u/aburbano)\
**Post date:** [November 15, 2019, 1:17pm UTC](https://forums.balena.io/t/i-cant-push-my-project-to-the-balena-repository/44248/25 "2019-11-15T13:17:54Z")

</div>

It exists, I run `ls` in the same directory where I run `du -hc`

> $ ls  
> docker-compose.yml finder services vpa webservice

---

<div class="post-metadata">

**Author:** ![hedss](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/hedss/32/210_2.png) [@hedss](https://forums.balena.io/u/hedss)\
**Post date:** [November 15, 2019, 1:24pm UTC](https://forums.balena.io/t/i-cant-push-my-project-to-the-balena-repository/44248/28 "2019-11-15T13:24:07Z")

</div>

Apologies, yes, I’d forgotten it won’t have listed the actual files.

I think I’ve just noticed something else, however, which is that when pushing you’re using a branch, not the master. Try this instead:

```auto
git push balena balenaintegration:master

```

As mentioned [here](https://www.balena.io/docs/learn/deploy/deployment/#overview-2) if you’re not working from the master branch, you need to tell git which branch to push to the balena remote.

Please let me know if that works.

Best regards,

Heds

---

<div class="post-metadata">

**Author:** ![aburbano](https://avatars.discourse-cdn.com/v4/letter/a/3bc359/32.png) [@aburbano](https://forums.balena.io/u/aburbano)\
**Post date:** [November 15, 2019, 1:30pm UTC](https://forums.balena.io/t/i-cant-push-my-project-to-the-balena-repository/44248/29 "2019-11-15T13:30:14Z")

</div>

Ok I’m testing, I hope the balena app repository is not going to get damage or something like that, Ill tell you as soon as the upload is finished.

---

<div class="post-metadata">

**Author:** ![hedss](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/hedss/32/210_2.png) [@hedss](https://forums.balena.io/u/hedss)\
**Post date:** [November 15, 2019, 1:31pm UTC](https://forums.balena.io/t/i-cant-push-my-project-to-the-balena-repository/44248/30 "2019-11-15T13:31:30Z")

</div>

What you’re doing here is explicitly telling `git` to use the `balenaintegration` branch as master for the `balena` remote. If you don’t do this, it will use the `master` branch of your repository, which I suspect does not contain the `docker-compose.yml` file. Is this a correct assumption?

Best regards,

Heds

---

<div class="post-metadata">

**Author:** ![aburbano](https://avatars.discourse-cdn.com/v4/letter/a/3bc359/32.png) [@aburbano](https://forums.balena.io/u/aburbano)\
**Post date:** [November 15, 2019, 3:09pm UTC](https://forums.balena.io/t/i-cant-push-my-project-to-the-balena-repository/44248/32 "2019-11-15T15:09:13Z")

</div>

yep, that’s it! I took a long time the first, but then just uploading the changes is way faster! Thanks a lot!

I have another different question that is about containers’ communication, but as you are a little bit familiar with my project, maybe you know the answer. If it is better to open another Issue, let me know:

so I have 3 container web, services, VPA and Finder, I provide images from VPA, but I didn’t add the `network_mode: host` because in my understanding it was only when you need to communicate from the exterior to your container. However, web and services had the network\_mode: host attribute, but they were no able to communicate with VPA. I added and now they are communicating fine, I just want to understand what I got wrong, or maybe it is a different attribute that I have to add. I don’t need VPA exposing their ports.

[Next page](https://forums.balena.io/t/i-cant-push-my-project-to-the-balena-repository/44248.md?page=2)
