# Error doing git push

**URL:** <https://forums.balena.io/t/error-doing-git-push/1767>\
**Category:** Product support\
**Created:** [August 27, 2017, 4:31pm UTC](https://forums.balena.io/t/error-doing-git-push/1767 "2017-08-27T16:31:14Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![awolverton](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/awolverton/32/561_2.png) [@awolverton](https://forums.balena.io/u/awolverton)\
**Post date:** [August 27, 2017, 4:31pm UTC](https://forums.balena.io/t/error-doing-git-push/1767/1 "2017-08-27T16:31:14Z")

</div>

Follows is the error I’m observing

```
git push resin master
Counting objects: 98, done. 
Delta compression using up to 4 threads.
Compressing objects: 100% (95/95), done.
Writing objects: 100% (98/98), 60.30 KiB | 0 bytes/s, done.
Total 98 (delta 43), reused 0 (delta 0)

[Info] Starting build for[MYGITHUBPROJECT], user [ME]
[Info] Dashboard link: {MYDASHBOARD]
[Info] Building on ARM01
[Error] Project type resolution could not be performed, please add one of the following:
[Error] Dockerfile
[Error] Dockerfile.template
[Error] package.json
[Error] Could not determine the project type

remote: error: hook declined to update refs/heads/master
To [MYGITLOCATION]
 ! [remote rejected] master -> master (hook declined)
error: failed to push some refs to 
'[MYGITLOCATION]'

```

This is the dir structure of my project:

```
ls
Dockerfile client-certs logs node_modules package.json
app.js config.js mqtt-log-pub-js.initd	package-lock.json	service

```

This is the contents of the Dockerfile:

```
more Dockerfile 
FROM resin/%%RESIN_MACHINE_NAME%%-node:6-slim

RUN mkdir -p /usr/src/mqtt-log-pub-js
WORKDIR /usr/src/mqtt-log-pub-js

COPY . /usr/src/mqtt-log-pub-js
RUN JOBS=MAX npm install --production --unsafe-perm && npm cache clean && rm -rf /tmp/*

ENV INITSYSTEM on

CMD ["node", "app.js"]

```

This is the contents of the package.json file:

```
more package.json 
{
  "name": "mqtt-node",
  "version": "0.0.1",
  "description": "",
  "main": "app.js",
  "scripts": {
    "start": "node app.js",
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "MIT",
  "dependencies": {
    "dotenv": "^4.0.0",
    "mqtt": "^2.12.0",
    "object-sizeof": "^1.2.0",
    "request": "^2.81.0",
    "traverse": "^0.6.6",
    "url": "^0.11.0"
  }
}

```

To my knowledge, I have both the Dockerfile and package.json file required to build and package up this project. I can deploy this to a standard alpine linux docker container as-is. What am i doing wrong here?

---

<div class="post-metadata">

**Author:** ![awolverton](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/awolverton/32/561_2.png) [@awolverton](https://forums.balena.io/u/awolverton)\
**Post date:** [August 27, 2017, 5:11pm UTC](https://forums.balena.io/t/error-doing-git-push/1767/3 "2017-08-27T17:11:34Z")

</div>

BTW, I just found this issue:

> [@Error: Project type resolution could not be performed](https://forums.balena.io/t/error-project-type-resolution-could-not-be-performed/1443):
>
> I’m getting this error when pushing to my Resin application: ... [Info] Building on 'local' [Info] Pulling old image for caching purposes [Error] Project type resolution could not be performed, please add one of the following: [Error] Dockerfile [Error] Dockerfile.template [Error] package.json [Error] Could not determine the project type ... I’m pushing with git push -f resin HEAD:master. The project clearly has a Dockerfile which have been tested working several tim…

None of these represents the problem I’m facing.

---

<div class="post-metadata">

**Author:** ![imrehg](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/imrehg/32/36_2.png) [@imrehg](https://forums.balena.io/u/imrehg)\
**Post date:** [August 27, 2017, 5:36pm UTC](https://forums.balena.io/t/error-doing-git-push/1767/4 "2017-08-27T17:36:13Z")

</div>

Hi @awolverton since you are using template variables, the `%%RESIN_MACHINE_NAME%%`, you should use `Dockerfile.template`, instead of `Dockerfile`. You can just rename it in git (`git mv Dockerfile Dockerfile.template` and then a `git commit`).

See more in the docs at [https://docs.resin.io/deployment/docker-templates/](https://docs.resin.io/deployment/docker-templates/)

---

<div class="post-metadata">

**Author:** ![awolverton](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/awolverton/32/561_2.png) [@awolverton](https://forums.balena.io/u/awolverton)\
**Post date:** [August 27, 2017, 5:40pm UTC](https://forums.balena.io/t/error-doing-git-push/1767/5 "2017-08-27T17:40:49Z")

</div>

@imrehg I just tried that, and still no love. I get the same error.

---

<div class="post-metadata">

**Author:** ![imrehg](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/imrehg/32/36_2.png) [@imrehg](https://forums.balena.io/u/imrehg)\
**Post date:** [August 27, 2017, 5:53pm UTC](https://forums.balena.io/t/error-doing-git-push/1767/6 "2017-08-27T17:53:37Z")

</div>

It might be a silly question, but the `more Dockerfile` line is actually inside your Dockerfile?  
Would it be possible to share your project with us, so we can look at it in its entirety? (e.g. if it’s on Github, or such). What device type are you using?

---

<div class="post-metadata">

**Author:** ![awolverton](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/awolverton/32/561_2.png) [@awolverton](https://forums.balena.io/u/awolverton)\
**Post date:** [August 27, 2017, 5:57pm UTC](https://forums.balena.io/t/error-doing-git-push/1767/7 "2017-08-27T17:57:26Z")

</div>

To simplify the Dockerfile.template, I copied the one from the simple server example app you have an am using that one.

```
FROM resin/%%RESIN_MACHINE_NAME%%-node:6-slim

WORKDIR /usr/src/app

COPY package.json package.json

RUN JOBS=MAX npm install --production --unsafe-perm && npm cache clean && rm -rf /tmp/*

COPY . ./

ENV INITSYSTEM on

CMD ["npm", "start"]

```

Isn’t it pushing to YOUR github repo? Can’t the contents be checked there?

---

<div class="post-metadata">

**Author:** ![imrehg](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/imrehg/32/36_2.png) [@imrehg](https://forums.balena.io/u/imrehg)\
**Post date:** [August 27, 2017, 6:18pm UTC](https://forums.balena.io/t/error-doing-git-push/1767/8 "2017-08-27T18:18:18Z")

</div>

Hey @awolverton, I’ve tried that `Dockerfile.temple` content, and it processes it perfectly fine (using an application set up for the `raspberrypi3` device type).

You are pushing to the resin servers, but since they were rejected, they are never stored by us, so we won’t see anything (also, we are not looking at our users’ code through there, but ask for explicit consent and external access).

What device type are you using?  
Are you sure that your `Dockerfile.template` is checked in and committed in git? (sorry for the simple questions, just trying to cover all the bases).

As an alternate test, could you clone and push this `simple-server-node` to your application? (later you can overwrite that with your own project doing a `git push --force resin master` with your own code to reset the repo to yours)

> **[balena-io-examples/balena-node-hello-world](https://github.com/balena-io-examples/balena-node-hello-world)**
>
> Run a simple express server with balena. Contribute to balena-io-examples/balena-node-hello-world development by creating an account on GitHub.

---

<div class="post-metadata">

**Author:** ![awolverton](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/awolverton/32/561_2.png) [@awolverton](https://forums.balena.io/u/awolverton)\
**Post date:** [August 27, 2017, 6:25pm UTC](https://forums.balena.io/t/error-doing-git-push/1767/9 "2017-08-27T18:25:30Z")

</div>

This is an RPI 1

Yes, all of the code including the template file is def checked in.

---

<div class="post-metadata">

**Author:** ![awolverton](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/awolverton/32/561_2.png) [@awolverton](https://forums.balena.io/u/awolverton)\
**Post date:** [August 27, 2017, 6:29pm UTC](https://forums.balena.io/t/error-doing-git-push/1767/10 "2017-08-27T18:29:06Z")

</div>

BTW… the simple server checks in and deploys just fine.

---

<div class="post-metadata">

**Author:** ![imrehg](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/imrehg/32/36_2.png) [@imrehg](https://forums.balena.io/u/imrehg)\
**Post date:** [August 27, 2017, 6:42pm UTC](https://forums.balena.io/t/error-doing-git-push/1767/11 "2017-08-27T18:42:11Z")

</div>

That points towards something unfortunately not-quite-right with the code you are trying to deploy. Hence our questions regarding the complete setup (since simple-server-node and your dockerfile example both works when we try it without seeing the complete repo).

Would it be possible to share your code with us, as mentioned before, to try to replicate what you experience?

Or instead of that, you could take the `simple-server-node` code and adjust it to your project by adding your files and updating the `Dockerfile.template`. That would let you start from a known working stage, which might make things more simple and quicker.

---

<div class="post-metadata">

**Author:** ![awolverton](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/awolverton/32/561_2.png) [@awolverton](https://forums.balena.io/u/awolverton)\
**Post date:** [August 27, 2017, 6:42pm UTC](https://forums.balena.io/t/error-doing-git-push/1767/12 "2017-08-27T18:42:25Z")

</div>

I think I figured it out.

i was doing a push like:

git push resin resin-master:master

your checking process barfs on this. It will only accept the local master branch for check in.

How do you deal with projects that MUST have different deploy targets? For example, this app is being containerized in a different base image for other uses, but in the resinOS image here? How can i use multiple Docker files for your check in procedure and explicitly define which one to use for resin?

---

<div class="post-metadata">

**Author:** ![awolverton](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/awolverton/32/561_2.png) [@awolverton](https://forums.balena.io/u/awolverton)\
**Post date:** [August 27, 2017, 6:47pm UTC](https://forums.balena.io/t/error-doing-git-push/1767/13 "2017-08-27T18:47:17Z")

</div>

Now that the app is actually downloading, I see this error in the device logs. I have no clue how to diagnose this:

`27.08.17 13:40:18 (-0500) Failed to start application 'registry2.resin.io/qiotmqttagentrpi1/0a40648adc7806d049bf6172e44e98aa5f53bedb' due to '[object Object]'`

---

<div class="post-metadata">

**Author:** ![imrehg](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/imrehg/32/36_2.png) [@imrehg](https://forums.balena.io/u/imrehg)\
**Post date:** [August 27, 2017, 6:59pm UTC](https://forums.balena.io/t/error-doing-git-push/1767/14 "2017-08-27T18:59:09Z")

</div>

> [@awolverton](#):
>
> i was doing a push like:
> 
> ```auto
> git push resin resin-master:master
> 
> ```
> 
> your checking process barfs on this.

It is highly unlikely that this was the real reason, because the remote git endpoint does not ever know your local git branch name. As long as you are pushing _to_ `master`, you can push from any branch, let it be `master`, `resin-master`, or anything… (and just tried it out to sanity check too).

Not 100% sure about the `Failed to start application` issue. For this we need some more info (since don’t know what code are you pusing exactly). Can you send us the device’s dashboard link in private? (just click on my profile picture and send message).

---

<div class="post-metadata">

**Author:** ![awolverton](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/awolverton/32/561_2.png) [@awolverton](https://forums.balena.io/u/awolverton)\
**Post date:** [August 27, 2017, 7:02pm UTC](https://forums.balena.io/t/error-doing-git-push/1767/15 "2017-08-27T19:02:07Z")

</div>

You should give it a test. It fails consistently for me in that manner. The only difference in which branch I check in from.

How do I find this dashboard link you’re refering to? And how do I privately send it to you?

---

<div class="post-metadata">

**Author:** ![awolverton](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/awolverton/32/561_2.png) [@awolverton](https://forums.balena.io/u/awolverton)\
**Post date:** [August 27, 2017, 7:05pm UTC](https://forums.balena.io/t/error-doing-git-push/1767/16 "2017-08-27T19:05:09Z")

</div>

![34 PM](https://global.discourse-cdn.com/balena/original/1X/595478b8b3ff9ed08399f32528051167ccc4efcc.jpg)

No links in this to send you a message.

---

<div class="post-metadata">

**Author:** ![imrehg](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/imrehg/32/36_2.png) [@imrehg](https://forums.balena.io/u/imrehg)\
**Post date:** [August 28, 2017, 11:24am UTC](https://forums.balena.io/t/error-doing-git-push/1767/17 "2017-08-28T11:24:20Z")

</div>

Hi, as mentioned above, I gave it a test, and no matter what the local branch name is, the push succeeds. Send you a private message from our side then.

---

<div class="post-metadata">

**Author:** ![awolverton](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/awolverton/32/561_2.png) [@awolverton](https://forums.balena.io/u/awolverton)\
**Post date:** [August 28, 2017, 12:49pm UTC](https://forums.balena.io/t/error-doing-git-push/1767/18 "2017-08-28T12:49:14Z")

</div>

That’s quite odd. I can reproduce it with a brand new repository as well.

---

<div class="post-metadata">

**Author:** ![sqweelygig](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/sqweelygig/32/150_2.png) [@sqweelygig](https://forums.balena.io/u/sqweelygig)\
**Post date:** [August 28, 2017, 1:23pm UTC](https://forums.balena.io/t/error-doing-git-push/1767/19 "2017-08-28T13:23:15Z")

</div>

Would you mind providing a link to the brand new repository, and the version of git that you are running? Now that it can be replicated using a demonstration repository this hopefully shouldn’t require any publication of secrets. There is something weird happening here because, as @imrehg states, when aliasing branches using the `:` your local execution of git should not be letting the remote know your local branch name.

---

<div class="post-metadata">

**Author:** ![awolverton](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/awolverton/32/561_2.png) [@awolverton](https://forums.balena.io/u/awolverton)\
**Post date:** [August 29, 2017, 2:15pm UTC](https://forums.balena.io/t/error-doing-git-push/1767/20 "2017-08-29T14:15:00Z")

</div>

I tried to respond to your DM and got this error.

 ![43 AM](https://global.discourse-cdn.com/balena/original/1X/ecb14befee4ece15adb594b268e188d04d9e8632.png)

---

<div class="post-metadata">

**Author:** ![awolverton](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/awolverton/32/561_2.png) [@awolverton](https://forums.balena.io/u/awolverton)\
**Post date:** [August 29, 2017, 2:17pm UTC](https://forums.balena.io/t/error-doing-git-push/1767/21 "2017-08-29T14:17:41Z")

</div>

Pi 1’s. I have 2 of these behaving the same way.

[https://dashboard.resin.io/apps/520452/devices/678163/summary](https://dashboard.resin.io/apps/520452/devices/678163/summary)  
[https://dashboard.resin.io/apps/520452/devices/679090/summary](https://dashboard.resin.io/apps/520452/devices/679090/summary)

Rebooting them doesn’t help. Restarting the app doesn’t help. Hard power cycling doesn’t help. Sometimes after a day or so, it resolves itself… until I deploy another app version.

This is a Pi3 running the same project. It works 100% of the time:

[https://dashboard.resin.io/apps/520648/devices/678780/summary](https://dashboard.resin.io/apps/520648/devices/678780/summary)

[Next page](https://forums.balena.io/t/error-doing-git-push/1767.md?page=2)
