# Authentication required errors

**URL:** <https://forums.balena.io/t/authentication-required-errors/992>\
**Category:** Product support\
**Created:** [May 22, 2017, 12:24pm UTC](https://forums.balena.io/t/authentication-required-errors/992 "2017-05-22T12:24:02Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![justin8](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/justin8/32/91_2.png) [@justin8](https://forums.balena.io/u/justin8)\
**Post date:** [May 22, 2017, 12:24pm UTC](https://forums.balena.io/t/authentication-required-errors/992/1 "2017-05-22T12:24:02Z")

</div>

Starting yesterday I seem to be getting an error when building a container on resin. I had built older versions without issues, but today it seems that I can no longer push to one of my apps. I get the below when building:

```auto
[Build] Step 14 : COPY . .
[Build] ---> 19060d4bce57
[Build] Removing intermediate container 77e357d0e564
[Build] Step 15 : CMD /usr/src/app/entrypoint.sh
[Build] ---> Running in 3e0a464cb4a2
[Build] ---> df77368312b3
[Build] Removing intermediate container 3e0a464cb4a2
[Build] Successfully built df77368312b3
[Success] Image created successfully
[Info] Verifying image integrity...
[Success] Image passed integrity checks!
[Info] Uploading image to registry...
[===============>] 30%[Error] Build failed: unauthorized: authentication required

remote: error: hook declined to update refs/heads/master

```

I can’t seem to find anyone else who has had this issue with resin before

---

<div class="post-metadata">

**Author:** ![nghiant2710](https://avatars.discourse-cdn.com/v4/letter/n/90db22/32.png) [@nghiant2710](https://forums.balena.io/u/nghiant2710)\
**Post date:** [May 23, 2017, 7:36am UTC](https://forums.balena.io/t/authentication-required-errors/992/4 "2017-05-23T07:36:19Z")

</div>

hey @justin8, Have you tried restarting your build to see if the error still persists?

@cameron, @lifeeth Do you have any ideas what might cause this?

---

<div class="post-metadata">

**Author:** ![justin8](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/justin8/32/91_2.png) [@justin8](https://forums.balena.io/u/justin8)\
**Post date:** [May 23, 2017, 8:18am UTC](https://forums.balena.io/t/authentication-required-errors/992/5 "2017-05-23T08:18:52Z")

</div>

@nghiant2710 I had this error twice yesterday, and today I made a second app and pushed it to that and received the same error again.

It does take a long time to build, I’m wondering if there is some kind of timeout issue happening?

---

<div class="post-metadata">

**Author:** ![nghiant2710](https://avatars.discourse-cdn.com/v4/letter/n/90db22/32.png) [@nghiant2710](https://forums.balena.io/u/nghiant2710)\
**Post date:** [May 23, 2017, 8:28am UTC](https://forums.balena.io/t/authentication-required-errors/992/6 "2017-05-23T08:28:09Z")

</div>

@justin8 we found the reason for the issue. Since your build is quite long, takes \> 4 hours so the access token to upload the image to the registry is expired because it’s valid for just 4 hours.

The PR to fix this issue will be merged soon, we’re sorry for the inconvenience.
