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

Problem with Docker build badge: repo not found #1400

Closed
sinedied opened this issue Dec 27, 2017 · 28 comments
Closed

Problem with Docker build badge: repo not found #1400

sinedied opened this issue Dec 27, 2017 · 28 comments
Labels
bug Bugs in badges and the frontend service-badge Accepted and actionable changes, features, and bugs

Comments

@sinedied
Copy link

=> works fine
=> not found

Same repo. Am I missing something?

@RedSparr0w
Copy link
Member

RedSparr0w commented Dec 28, 2017

Looks like something wrong in the build history API for the project,

sinedied/nano-gateway pulls response:

{
	"user": "sinedied",
	"name": "nano-gateway",
	"namespace": "sinedied",
	"repository_type": "image",
	"status": 1,
	"description": " Lightweight API gateway for home-scale projects",
	"is_private": false,
	"is_automated": false,
	"can_edit": false,
	"star_count": 1,
	"pull_count": 15,
	"last_updated": "2017-12-27T21:46:54.850913Z",
	"has_starred": false,
	"full_description": "# nano-gateway\n\n[![NPM version](https://img.shields.io/npm/v/nano-gateway.svg)](https://www.npmjs.com/package/nano-gateway) [![Build status](https://img.shields.io/travis/sinedied/nano-gateway/master.svg)](https://travis-ci.org/sinedied/nano-gateway) ![Node version](https://img.shields.io/badge/node-%3E%3D6.0.0-brightgreen.svg) [![Docker layers](https://images.microbadger.com/badges/image/sinedied/nano-gateway.svg)](https://microbadger.com/images/sinedied/nano-gateway) [![XO code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/sindresorhus/xo) [![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)\n\n![](https://user-images.githubusercontent.com/593151/34394053-379cfa3c-eb57-11e7-855d-ef15cc5d3bcb.png)\n\n> Lightweight API gateway for home-scale projects.\n\n**Features:**\n- Single-file YAML configuration\n- HTTPS support\n- Secure endpoints with API key\n- URL rewriting\n- Less than [50 LOC](index.js) :smile:\n\n## Installation\n\n```bash\nnpm install -g nano-gateway\n```\n\n## Usage\n```sh\nnanog --help\nUsage: nanog [--config file.yml] [--keygen]\n```\n\nUse the `nanog` command to start the gateway.\n\nBy default, it will use the `config.yml` configuration in the current working directory, but any file can be specified\nusing either the `NANO_GATEWAY_CONFIG` environment variable or the `--config` option.\n\nThe `--keygen` will generate a suitable API key to use in your configuration.\n\n## Configuration\n\nHere is an [example config.yml](config.yml) configuration:\n\n```yaml\nhttp:                 # optional, enable HTTP gateway\n  port: 8080          # optional, specify port for HTTP (default is 8080)\nhttps:                # optional, enable HTTPS gateway\n  cert: 'cert.pem'    # required, certificate path\n  key: 'privkey.pem'  # required, private key path\n  ca: 'chain.pem'     # optional, override trusted CA certificates\n  port: 8443          # optional, specify port for HTTPS (default is 8443)\nauth: true            # optional, enable API key authorization by default for all services\napiKey: '123456'      # required if auth is enabled, use nanog --keygen to generate a new key\nservices:             # required, define here the services to proxify\n  ip:                           # required, service name\n    path: '/ip'                 # required, endpoint(s) (use Express route syntax, see npmjs.com/path-to-regexp)\n    url: 'https://httpbin.org'  # required, target url for\n    auth: false                 # optional, authorization can be set or overriden by service\n  quote:                        # another service, add as many as you need\n    path: '/jokes/*'            # matches any routes under /jokes/\n    rewrite: '/jokes/random'    # optional, rewrite URL (for syntax, see npmjs.com/express-urlrewrite)\n    url: 'https://api.chucknorris.io'\n```\n\n### API key\n\nEndpoints secured by API key can be consumed either by using an `apiKey` query parameter:\n```sh\ncurl https://gateway.com/endpoint?apiKey=<your_api_key>\n```\nor by using an `Authorization` header:\n```sh\ncurl -H \"Authorization: <your_api_key>\" https://gateway.com/endpoint\n```\n\n> Note: It is **strongly** recommended to use only HTTPS with API keys, otherwise your credentials will circulate in\n> clear over the network and may be intercepted.\n\n### HTTPS\n\nTo enable HTTPS you need a valid SSL certificate.\n\nFree [LetsEncrypt](https://letsencrypt.org) certificates can be obtained using [certbot](https://certbot.eff.org).\n\nFor testing purposes, you can also generate a self-signed certificate using this command:\n```sh\nopenssl req -nodes -new -x509 -keyout privkey.pem -out cert.pem\n```\n\nAfter you have your certificate, use it in your configuration like this:\n```yaml\nhttps:\n  cert: 'cert.pem'\n  key: 'privkey.pem'\n  ca: 'chain.pem' # optional, override trusted CA certificates\n```\n\n## Running on Docker\n\nA minimal [Docker image](https://hub.docker.com/r/sinedied/nano-gateway/) based on `node:alpine` is also available\nfor deployment.\n\nYou just need to map a folder with a `config.yml` file in it to the `/config` volume:\n```\ndocker pull sinedied/nano-gateway\ndocker run --d -v <your_config_dir>:/config -p 8443:8443 --name nano-gateway sinedied/nano-gateway\n```\n",
	"affiliation": null,
	"permissions": {
		"read": true,
		"write": false,
		"admin": false
	}
}

sinedied/nano-gateway buildhistory response: (also returns 404 status code)

{
	"detail": "Object not found"
}

correct buildhistory reponse:

{
	"count": 1572,
	"next": "https://registry.hub.docker.com/v2/repositories/jrottenberg/ffmpeg/buildhistory/?page=2",
	"previous": null,
	"results": [
		{
			"id": 17779528,
			"status": 10,
			"created_date": "2017-12-15T15:12:42.511729Z",
			"last_updated": "2017-12-16T13:48:55.875532Z",
			"build_code": "bdf9g5ua3cd2q8rkmud6hne",
			"dockertag_name": "3.1-centos",
			"cause": "REPOSITORY_LINK"
		},
		{
			"id": 17771912,
			"status": 10,
			"created_date": "2017-12-15T13:56:12.675237Z",
			"last_updated": "2017-12-16T12:28:34.842744Z",
			"build_code": "bmveanfungnkwxk48jcqw6m",
			"dockertag_name": "3.2",
			"cause": "REPOSITORY_LINK"
		},
		{
			"id": 17771832,
			"status": 10,
			"created_date": "2017-12-15T13:56:10.751691Z",
			"last_updated": "2017-12-16T11:28:48.707129Z",
			"build_code": "b5teh6hpgj6yk6tufrqtqdb",
			"dockertag_name": "3.4",
			"cause": "REPOSITORY_LINK"
		},
		{
			"id": 17771584,
			"status": 10,
			"created_date": "2017-12-15T13:56:05.890924Z",
			"last_updated": "2017-12-16T10:23:44.550701Z",
			"build_code": "brsaswwsow2tgsmift2gayw",
			"dockertag_name": "3.0-alpine",
			"cause": "REPOSITORY_LINK"
		},
		{
			"id": 17771443,
			"status": 10,
			"created_date": "2017-12-15T13:56:02.887293Z",
			"last_updated": "2017-12-16T09:14:47.049854Z",
			"build_code": "bzsaayibuc5ejhyingppqxb",
			"dockertag_name": "3.1-scratch",
			"cause": "REPOSITORY_LINK"
		},
		{
			"id": 17771336,
			"status": 10,
			"created_date": "2017-12-15T13:56:00.598746Z",
			"last_updated": "2017-12-16T08:04:57.543595Z",
			"build_code": "bmcop3u4uyrprwo8ztwrnfn",
			"dockertag_name": "3.4-scratch",
			"cause": "REPOSITORY_LINK"
		},
		{
			"id": 17750450,
			"status": -1,
			"created_date": "2017-12-15T05:48:00.147004Z",
			"last_updated": "2017-12-16T06:50:50.305672Z",
			"build_code": "bjexbv4n9zgwukwwpr7bszf",
			"dockertag_name": "2.8-scratch",
			"cause": "REPOSITORY_LINK"
		},
		{
			"id": 17750447,
			"status": -1,
			"created_date": "2017-12-15T05:48:00.116812Z",
			"last_updated": "2017-12-16T06:43:12.610414Z",
			"build_code": "bvllv3357xckhpolynax3nm",
			"dockertag_name": "2.8-scratch",
			"cause": "REPOSITORY_LINK"
		},
		{
			"id": 17750392,
			"status": 10,
			"created_date": "2017-12-15T05:47:59.262740Z",
			"last_updated": "2017-12-16T05:23:53.647735Z",
			"build_code": "bntg2dmyevtzni4lzm9me8e",
			"dockertag_name": "2.8-scratch",
			"cause": "REPOSITORY_LINK"
		},
		{
			"id": 17743030,
			"status": -1,
			"created_date": "2017-12-15T03:48:43.823348Z",
			"last_updated": "2017-12-16T04:14:53.741367Z",
			"build_code": "btcc6mxzkscjl3esthgdm4c",
			"dockertag_name": "3.3-scratch",
			"cause": "REPOSITORY_LINK"
		}
	]
}

@sinedied
Copy link
Author

I just created the repo on docker hub, maybe it needs some time to chew the info then?

@RedSparr0w
Copy link
Member

RedSparr0w commented Dec 28, 2017

🤞
Hopefully that is the problem,
Also likes like you have build mode set to manual. (not sure if that makes a difference)

	"is_automated": false,

Edit: looks like the docker API may have crashed recently:
image

@paulmelnikow paulmelnikow added the question Support questions, usage questions, unconfirmed bugs, discussions, ideas label Dec 28, 2017
@sinedied
Copy link
Author

Also likes like you have build mode set to manual. (not sure if that makes a difference)

That's another error, I have setup automated builds 😄

@iamstarkov
Copy link
Contributor

@RedSparr0w
Copy link
Member

@iamstarkov it seems to be the build history endpoint that is missing info.
https://registry.hub.docker.com/v2/repositories/sinedied/nano-gateway/buildhistory/

@sinedied
Copy link
Author

Yes, it's still not fixed, but it seems the issue is with the docker APIs.
Unless I am missing something on the docker cloud configuration, automated builds + builds history are not recognized through their APIs although it's there:
image

@gaieges
Copy link

gaieges commented May 10, 2018

I'm seeing the same thing. Out of curiosity - is this resolved on dockers side or do we think this is going to be broken permanently?

@RedSparr0w
Copy link
Member

Not really sure how to go about solving this, i think someone will have to contact docker about it as the API just returns a 404 response with {"detail": "Object not found"} as the body.
Also can't see anything in the docs (not even sure if i found the correct docs tbh)

@paulmelnikow paulmelnikow added bug Bugs in badges and the frontend and removed question Support questions, usage questions, unconfirmed bugs, discussions, ideas labels Jun 16, 2018
@nirizr
Copy link

nirizr commented Jul 31, 2018

I'm having the same issue, would love to hear from anyone who managed to resolve this.

@fedjabosnic
Copy link

Just ran into the same thing with one of my projects.

I think this is probably because Docker Hub != Docker Cloud, i.e. builds on Docker Cloud do not show up under the build history in Docker Hub - seems they are treated as two separate build services (see https://stackoverflow.com/a/42736552). From some quick tests, builds generated from Docker Hub show as expected whereas builds from Docker Cloud don't.

I guess a fix would be to also point to the api specific for Docker Cloud builds...

@paulmelnikow paulmelnikow added the service-badge Accepted and actionable changes, features, and bugs label Nov 1, 2018
@holmrenser
Copy link

holmrenser commented Nov 30, 2018

I am having similar issues with my repository: https://cloud.docker.com/u/genenotebook/repository/docker/genenotebook/genenotebook

Docker pulls are being displayed correctly:
Docker pulls

However, automated build is listed incorrectly as manual:
Automated

Build status says the repository is not found:
Build status

This is incorrect, as I have enabled automated builds and they have completed building.

@paulmelnikow
Copy link
Member

@holmrenser
Copy link

holmrenser commented Nov 30, 2018

Interesting, apparently Docker Cloud does not allow browsing.
The repo is also visible through Docker Hub (https://hub.docker.com/r/genenotebook/genenotebook/), but I am using Docker Cloud to build.

@syedhassaanahmed
Copy link

Ran into the same issue. Noticed that it started happening roughly around the same time as DockerHub UX was revamped. Could it be that DockerHub made some breaking changes to their API?

@toitzi
Copy link

toitzi commented Jan 2, 2019

Yes also got this issue

civitaspo added a commit to civitaspo/ecs-stale-ec2-rescaler that referenced this issue Jan 5, 2019
civitaspo added a commit to civitaspo/ecs-stale-ec2-rescaler that referenced this issue Jan 5, 2019
@texano00
Copy link

texano00 commented Jan 9, 2019

@fatindeed
Copy link

need to support docker cloud, docker hub may not be used in the future?

@paulmelnikow
Copy link
Member

Just wanted to put out there that Shields is a community project, and that means you can help make this happen! We have a great tutorial and welcome anyone who would like to dig into this! Our maintainer team is happy to provide guidance on the API design and provide assistance with the implementation. We've had many first-time contributors who don't use JavaScript and have tried to make the first-time contributing experience as straightforward as possible.

crayzeewulf added a commit to crayzeewulf/libserial that referenced this issue Feb 24, 2019
Added badges showing status of docker builds. 

Due to a possible bug in the shields, the docker hub repository is not found. See badges/shields#1400
@ldez
Copy link
Contributor

ldez commented Feb 24, 2019

An "old" automated build:

$ curl -s 'https://hub.docker.com/api/build/v1/source/?image=xenolf%2Flego' -H 'Accept: application/json' | jq
{
  "meta": {
    "limit": 25,
    "next": null,
    "offset": 0,
    "previous": null,
    "total_count": 0
  },
  "objects": []
}

A "new" automated build:

$ curl -s 'https://hub.docker.com/api/build/v1/source/?image=ldez%2Fgha-mjolnir'  -H 'Accept: application/json' --compressed | jq
{
  "meta": {
    "limit": 25,
    "next": null,
    "offset": 0,
    "previous": null,
    "total_count": 1
  },
  "objects": [
    {
      "autotests": "OFF",
      "build_in_farm": true,
      "build_settings": [
        "/api/build/v1/setting/e3db21aa-8847-4789-9f2e-dc136ea432ae/",
        "/api/build/v1/setting/6fe17d9d-a946-47f0-a7ae-b20dba0bfb72/"
      ],
      "channel": "Stable",
      "image": "ldez/gha-mjolnir",
      "owner": "ldez",
      "provider": "Github",
      "repo_links": false,
      "repository": "gha-mjolnir",
      "resource_uri": "/api/build/v1/source/9a37d4ca-aad6-4820-932c-5d8bd94fc8d7/",
      "state": "Success",
      "uuid": "9a37d4ca-aad6-4820-932c-5d8bd94fc8d7"
    }
  ]
}

build_settings: contains the build triggers (each entry is a different trigger). Can be see as the old "automated" flag.

state: for now I know that the value can be Empty, Success. I have to find the other states.

Note: It's possible to use https://cloud.docker.com instead of https://hub.docker.com for the API calls

FYI those API endpoints are called by the hub it-self.

@calebcartwright
Copy link
Member

calebcartwright commented Mar 5, 2019

Thanks again @ldez!

#3139 adds new badges (Docker Cloud Automated Build and Docker Cloud Build Status) that should provide a working badge for those experiencing issues with the current Docker Automated/Build Status badges. It should get deployed fairly soon, and anyone interested can follow the deployment status of #3139 here

Note that the Docker Cloud badges have a different path with cloud (/docker/cloud/build/:user/:repo vs /docker/build/:user/:repo)
So the path in the OP example: https://img.shields.io/docker/build/sinedied/nano-gateway.svg

Will use the Docker Cloud badge path: https://img.shields.io/docker/cloud/build/sinedied/nano-gateway.svg (this will start working once #3139 is deployed)
https://shields.io

@paulmelnikow
Copy link
Member

paulmelnikow commented Mar 11, 2019

It would be helpful to add some documentation to the Docker Build badge guiding people to the new badge for Docker Cloud. What should it say, exactly?

@calebcartwright
Copy link
Member

I was thinking the same thing.

Perhaps something along the lines of:

These badges are for Docker Hub. If you are using Docker Cloud and/or experience issues with these badges, please use the Docker Cloud badges instead (not sure how to best link to those though)

@ldez
Copy link
Contributor

ldez commented Mar 11, 2019

All images created with the new Docker Hub only works with the Docker Cloud badges.

No one really uses the term Docker Cloud: it's just the Docker hub.

https://hub.docker.com/
https://blog.docker.com/2018/12/the-new-docker-hub/

@calebcartwright
Copy link
Member

Did not realize Cloud branding had been dropped, thanks for sharing.

This now has me wondering if we really need to have both sets of our Docker badges. Will our new badges (which are currently labeled as Docker Cloud badges) work for all users/images? If so is there any value in keeping our old badges?

@ldez
Copy link
Contributor

ldez commented Mar 11, 2019

Docker badges work well with repositories created before the "new" Docker Hub.
Docker Cloud badges have a flaky behavior or don't work with repositories created with the "old" Docker Hub.

So it's difficult to remove the Docker badges due to that.

@calebcartwright
Copy link
Member

I think something along those lines might be best in the docs then, and we could do it on both the "old" Docker Hub badges and the new Docker "Cloud" badges.

I.e. Use this badge if your repository was created after xyz and vice versa

@paulmelnikow
Copy link
Member

Sounds like a good idea.

Since people don't know they are using Docker "Cloud", maybe it would be good to add /docker/legacy to the old badges and leave a redirect in their place. That might supplement the documentation in helping people choose the right one.

crayzeewulf added a commit to crayzeewulf/libserial that referenced this issue May 8, 2019
Added badges showing status of docker builds. 

Due to a possible bug in the shields, the docker hub repository is not found. See badges/shields#1400
rm3l added a commit to rm3l/dev-feed that referenced this issue May 22, 2019
New badges need to be used since some changes in Docker Hub. See See badges/shields#1400
ramnes added a commit to numberly/kubemen that referenced this issue Sep 13, 2019
oleglukasevici added a commit to oleglukasevici/flutter-based-mobile-app-dev-feed that referenced this issue Mar 11, 2022
New badges need to be used since some changes in Docker Hub. See See badges/shields#1400
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bugs in badges and the frontend service-badge Accepted and actionable changes, features, and bugs
Projects
None yet
Development

No branches or pull requests