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

Unable to access private build status on gitlab #8768

Open
Aurelienmasse opened this issue Jan 3, 2023 · 7 comments
Open

Unable to access private build status on gitlab #8768

Aurelienmasse opened this issue Jan 3, 2023 · 7 comments
Labels
self-hosting Discussion, problems, features, and documentation related to self-hosting Shields service-badge Accepted and actionable changes, features, and bugs

Comments

@Aurelienmasse
Copy link

Are you experiencing an issue with...

My own instance of shields

🐞 Description

Hi,

I'm running an instance via Docker on my server which is working perfectly.
But when I want to add a status from a private repo from gitlab I get a inaccessible badge.

Here my setup:
Docker tag: server-2022-12-01
Docker-config service:
shields: image: shieldsio/shields:server-2022-12-01 container_name: Shields environment: - PORT=80 - GITLAB_ORIGINS=https://gitlab.com - GITLAB_TOKEN=glpat-sometokenkeyhere

I checked the token is valid and grant all access (for testing purpose)

At the same time sometimes 8n the logs of Shields docker I got this error:

Shields | 0103155818 Error: Token pool is exhausted Shields | at TokenPool._nextBatch (file:///usr/src/app/core/token-pooling/token-pool.js:268:11) Shields | at TokenPool.next (file:///usr/src/app/core/token-pooling/token-pool.js:305:20) Shields | at GithubApiProvider.tokenForUrl (file:///usr/src/app/services/github/github-api-provider.js:147:33) Shields | at GithubApiProvider.fetch (file:///usr/src/app/services/github/github-api-provider.js:160:22) Shields | at GithubForks._request (file:///usr/src/app/core/base-service/base.js:234:40) Shields | at GithubForks._requestGraphql (file:///usr/src/app/core/base-service/base-graphql.js:74:35) Shields | at GithubForks._requestGraphql (file:///usr/src/app/services/github/github-auth-service.js:66:18) Shields | at GithubForks.handle (file:///usr/src/app/services/github/github-forks.service.js:57:29) Shields | at Function.invoke (file:///usr/src/app/core/base-service/base.js:407:45)

I don't know if it's related.

Thanks in advance.

🔗 Link to the badge

No response

💡 Possible Solution

No response

@Aurelienmasse Aurelienmasse added the question Support questions, usage questions, unconfirmed bugs, discussions, ideas label Jan 3, 2023
@chris48s
Copy link
Member

chris48s commented Jan 3, 2023

The GitHub token pool errors are unrelated.

I can't see anything obviously wrong with your settings from what you've posted.

I think the next thing I would try is: If you SSH into your server, you should be able to run npm run badge <url to your badge> e.g: npm run badge https://img.shields.io/npm/v/badge-maker on the console and that should spit out some information about the request sent/response received to help you debug this.

@chris48s chris48s added the self-hosting Discussion, problems, features, and documentation related to self-hosting Shields label Jan 3, 2023
@Aurelienmasse
Copy link
Author

Aurelienmasse commented Jan 3, 2023

So I tried what you said but it seems it tries to relaunch the server which is obviously already running so I get this error:

0103180655 Server is starting up: http://localhost:80/
(node:45) [DEP0111] DeprecationWarning: Access to process.binding('http_parser') is deprecated.
(Use 'node --trace-deprecation ...' to show where the warning was created)
node:events:491
      throw er; // Unhandled 'error' event
      ^

Error: listen EADDRINUSE: address already in use 127.0.0.1:80
    at Camp.setupListenHandle [as _listen2] (node:net:1463:16)
    at listenInCluster (node:net:1511:12)
    at GetAddrInfoReqWrap.doListen [as callback] (node:net:1660:7)
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:111:8)
Emitted 'error' event on Camp instance at:
    at emitErrorNT (node:net:1490:8)
    at processTicksAndRejections (node:internal/process/task_queues:83:21) {
  code: 'EADDRINUSE',
  errno: -98,
  syscall: 'listen',
  address: '127.0.0.1',
  port: 80
}

@chris48s
Copy link
Member

chris48s commented Jan 3, 2023

Ah, yes.
In that case can you try starting you container with TRACE_SERVICES=true in your env vars, and then request the badge you're having trouble with through a browser (or curl, or whatever). TRACE_SERVICES=true should make the container output debug info to stdout, or wherever you are sending your logs to 🤞

@Aurelienmasse
Copy link
Author

Ok I did it the log is really huge ca not find the problem in it:

Shields | Service class 👩‍🍳
Shields | GitlabPipelineStatus
Shields | Named params 🎫
Shields | { project: 'Tartempion34/manta-admin' }
Shields | Query params 🖍
Shields | {
Shields | branch: 'master',
Shields | color: undefined,
Shields | colorA: undefined,
Shields | colorB: undefined,
Shields | gitlab_url: undefined,
Shields | label: undefined,
Shields | labelColor: undefined,
Shields | link: undefined,
Shields | logo: undefined,
Shields | logoColor: undefined,
Shields | logoPosition: undefined,
Shields | logoWidth: undefined,
Shields | style: undefined
Shields | }
Shields | Query params after validation 🛁
Shields | { branch: 'master', gitlab_url: undefined }
Shields | Query params after validation 🖍
Shields | {
Shields | branch: 'master',
Shields | color: undefined,
Shields | colorA: undefined,
Shields | colorB: undefined,
Shields | gitlab_url: undefined,
Shields | label: undefined,
Shields | labelColor: undefined,
Shields | link: undefined,
Shields | logo: undefined,
Shields | logoColor: undefined,
Shields | logoPosition: undefined,
Shields | logoWidth: undefined,
Shields | style: undefined
Shields | }
Shields | Request 🏹
Shields | https://gitlab.com/Tartempion34/manta-admin/badges/master/pipeline.svg
Shields | {
Shields | "headers": {
Shields | "Accept": "image/svg+xml"
Shields | }
Shields | }
Shields | Response status code 🎯
Shields | 503
Shields | Handled error 🙅
Shields | Error: Got status code 503 (expected 200)
Shields | at file:///usr/src/app/core/base-service/check-error-response.js:14:26
Shields | at GitlabPipelineStatus._request (file:///usr/src/app/core/base-service/base.js:237:45)
Shields | at runMicrotasks ()
Shields | at processTicksAndRejections (node:internal/process/task_queues:96:5)
Shields | at async GitlabPipelineStatus._requestSvg (file:///usr/src/app/core/base-service/base-svg-scraping.js:75:24)
Shields | at async GitlabPipelineStatus.handle (file:///usr/src/app/services/gitlab/gitlab-pipeline-status.service.js:92:18)
Shields | at async Function.invoke (file:///usr/src/app/core/base-service/base.js:407:23)
Shields | at async Object.handler (file:///usr/src/app/core/base-service/base.js:453:31) {
Shields | prettyMessage: 'inaccessible',
Shields | response: <ref *1> IncomingMessage {
Shields | _readableState: ReadableState {
Shields | objectMode: false,
Shields | highWaterMark: 16384,
Shields | buffer: BufferList { head: null, tail: null, length: 0 },
Shields | length: 0,
Shields | pipes: [],
Shields | flowing: false,
Shields | ended: true,
Shields | endEmitted: true,
Shields | reading: false,
Shields | constructed: true,
Shields | sync: false,
Shields | needReadable: false,
Shields | emittedReadable: false,
Shields | readableListening: true,
Shields | resumeScheduled: false,
Shields | errorEmitted: false,
Shields | emitClose: true,
Shields | autoDestroy: true,
Shields | destroyed: true,
Shields | errored: null,
Shields | closed: true,
Shields | closeEmitted: true,
Shields | defaultEncoding: 'utf8',
Shields | awaitDrainWriters: null,
Shields | multiAwaitDrain: false,
Shields | readingMore: false,
Shields | dataEmitted: true,
Shields | decoder: null,
Shields | encoding: null,
Shields | [Symbol(kPaused)]: false
Shields | },
Shields | _events: [Object: null prototype] {
Shields | end: [Function: responseOnEnd],
Shields | aborted: [Function],
Shields | error: [Function],
Shields | readable: [Function (anonymous)],
Shields | [Symbol(events.errorMonitor)]: [Function]
Shields | },
Shields | _eventsCount: 5,
Shields | _maxListeners: undefined,
Shields | socket: TLSSocket {
Shields | _tlsOptions: [Object],
Shields | _secureEstablished: true,
Shields | _securePending: false,
Shields | _newSessionPending: false,
Shields | _controlReleased: true,
Shields | secureConnecting: false,
Shields | _SNICallback: null,
Shields | servername: 'gitlab.com',
Shields | alpnProtocol: false,
Shields | authorized: true,
Shields | authorizationError: null,
Shields | encrypted: true,
Shields | _events: [Object: null prototype],
Shields | _eventsCount: 10,
Shields | connecting: false,
Shields | _hadError: false,
Shields | _parent: null,
Shields | _host: 'gitlab.com',
Shields | _closeAfterHandlingError: false,
Shields | _readableState: [ReadableState],
Shields | _maxListeners: undefined,
Shields | _writableState: [WritableState],
Shields | allowHalfOpen: false,
Shields | _sockname: null,
Shields | _pendingData: null,
Shields | _pendingEncoding: '',
Shields | server: undefined,
Shields | _server: null,
Shields | ssl: null,
Shields | _requestCert: true,
Shields | _rejectUnauthorized: true,
Shields | parser: null,
Shields | _httpMessage: [ClientRequest],
Shields | _peername: [Object],
Shields | [Symbol(res)]: [TLSWrap],
Shields | [Symbol(verified)]: true,
Shields | [Symbol(pendingSession)]: null,
Shields | [Symbol(async_id_symbol)]: 10350,
Shields | [Symbol(kHandle)]: null,
Shields | [Symbol(lastWriteQueueSize)]: 0,
Shields | [Symbol(timeout)]: null,
Shields | [Symbol(kBuffer)]: null,
Shields | [Symbol(kBufferCb)]: null,
Shields | [Symbol(kBufferGen)]: null,
Shields | [Symbol(kCapture)]: false,
Shields | [Symbol(kSetNoDelay)]: false,
Shields | [Symbol(kSetKeepAlive)]: false,
Shields | [Symbol(kSetKeepAliveInitialDelay)]: 0,
Shields | [Symbol(kBytesRead)]: 10585,
Shields | [Symbol(kBytesWritten)]: 180,
Shields | [Symbol(connect-options)]: [Object],
Shields | [Symbol(RequestTimeout)]: undefined
Shields | },
Shields | httpVersionMajor: 1,
Shields | httpVersionMinor: 1,
Shields | httpVersion: '1.1',
Shields | complete: true,
Shields | rawHeaders: [
Shields | 'Date',
Shields | 'Tue, 03 Jan 2023 19:08:07 GMT',
Shields | 'Content-Type',
Shields | 'text/html; charset=UTF-8',
Shields | 'Transfer-Encoding',
Shields | 'chunked',
Shields | 'Connection',
Shields | 'close',
Shields | 'Cross-Origin-Embedder-Policy',
Shields | 'require-corp',
Shields | 'Cross-Origin-Opener-Policy',
Shields | 'same-origin',
Shields | 'Cross-Origin-Resource-Policy',
Shields | 'same-origin',
Shields | 'Permissions-Policy',
Shields | 'accelerometer=(),autoplay=(),camera=(),clipboard-read=(),clipboard-write=(),fullscreen=(),geolocation=(),gyroscope=(),hid=(),interest-cohort=(),magnetometer=(),microphone=(),payment=(),publickey-credentials-get=(),screen-wake-lock=(),serial=(),sync-xhr=(),usb=()',
Shields | 'Referrer-Policy',
Shields | 'same-origin',
Shields | 'X-Frame-Options',
Shields | 'SAMEORIGIN',
Shields | 'Cache-Control',
Shields | 'private, max-age=0, no-store, no-cache, must-revalidate, post-check=0, pre-check=0',
Shields | 'Expires',
Shields | 'Thu, 01 Jan 1970 00:00:01 GMT',
Shields | 'Report-To',
Shields | '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=Nk7Mcts%2FCnwr6k%2BSM3q5s9zgqw3plJfvngeFzWk%2FwisnQxX9JCsIqv6tGjiKayzhRtfjGoEPC1AqfFhs0TR5OToBN1oHH96POh0wNv19K92LmjyfvWNAcuFXO1E%3D"}],"group":"cf-nel","max_age":604800}',
Shields | 'NEL',
Shields | '{"success_fraction":0.01,"report_to":"cf-nel","max_age":604800}',
Shields | 'Vary',
Shields | 'Accept-Encoding',
Shields | 'Strict-Transport-Security',
Shields | 'max-age=31536000',
Shields | 'X-Content-Type-Options',
Shields | 'nosniff',
Shields | 'Server',
Shields | 'cloudflare',
Shields | 'CF-RAY',
Shields | '783e05704a34d540-CDG'
Shields | ],
Shields | rawTrailers: [],
Shields | aborted: false,
Shields | upgrade: false,
Shields | url: 'https://gitlab.com/users/sign_in',
Shields | method: null,
Shields | statusCode: 503,
Shields | statusMessage: 'Service Temporarily Unavailable',
Shields | client: TLSSocket {
Shields | _tlsOptions: [Object],
Shields | _secureEstablished: true,
Shields | _securePending: false,
Shields | _newSessionPending: false,
Shields | _controlReleased: true,
Shields | secureConnecting: false,
Shields | _SNICallback: null,
Shields | servername: 'gitlab.com',
Shields | alpnProtocol: false,
Shields | authorized: true,
Shields | authorizationError: null,
Shields | encrypted: true,
Shields | _events: [Object: null prototype],
Shields | _eventsCount: 10,
Shields | connecting: false,
Shields | _hadError: false,
Shields | _parent: null,
Shields | _host: 'gitlab.com',
Shields | _closeAfterHandlingError: false,
Shields | _readableState: [ReadableState],
Shields | _maxListeners: undefined,
Shields | _writableState: [WritableState],
Shields | allowHalfOpen: false,
Shields | _sockname: null,
Shields | _pendingData: null,
Shields | _pendingEncoding: '',
Shields | server: undefined,
Shields | _server: null,
Shields | ssl: null,
Shields | _requestCert: true,
Shields | _rejectUnauthorized: true,
Shields | parser: null,
Shields | _httpMessage: [ClientRequest],
Shields | _peername: [Object],
Shields | [Symbol(res)]: [TLSWrap],
Shields | [Symbol(verified)]: true,
Shields | [Symbol(pendingSession)]: null,
Shields | [Symbol(async_id_symbol)]: 10350,
Shields | [Symbol(kHandle)]: null,
Shields | [Symbol(lastWriteQueueSize)]: 0,
Shields | [Symbol(timeout)]: null,
Shields | [Symbol(kBuffer)]: null,
Shields | [Symbol(kBufferCb)]: null,
Shields | [Symbol(kBufferGen)]: null,
Shields | [Symbol(kCapture)]: false,
Shields | [Symbol(kSetNoDelay)]: false,
Shields | [Symbol(kSetKeepAlive)]: false,
Shields | [Symbol(kSetKeepAliveInitialDelay)]: 0,
Shields | [Symbol(kBytesRead)]: 10585,
Shields | [Symbol(kBytesWritten)]: 180,
Shields | [Symbol(connect-options)]: [Object],
Shields | [Symbol(RequestTimeout)]: undefined
Shields | },
Shields | _consuming: true,
Shields | _dumped: true,
Shields | req: ClientRequest {
Shields | _events: [Object: null prototype],
Shields | _eventsCount: 8,
Shields | _maxListeners: undefined,
Shields | outputData: [],
Shields | outputSize: 0,
Shields | writable: true,
Shields | destroyed: true,
Shields | _last: true,
Shields | chunkedEncoding: false,
Shields | shouldKeepAlive: false,
Shields | maxRequestsOnConnectionReached: false,
Shields | _defaultKeepAlive: true,
Shields | useChunkedEncodingByDefault: false,
Shields | sendDate: false,
Shields | _removedConnection: false,
Shields | _removedContLen: false,
Shields | _removedTE: false,
Shields | strictContentLength: false,
Shields | _contentLength: 0,
Shields | _hasBody: true,
Shields | _trailer: '',
Shields | finished: true,
Shields | _headerSent: true,
Shields | _closed: false,
Shields | socket: [TLSSocket],
Shields | _header: 'GET /users/sign_in HTTP/1.1\r\n' +
Shields | 'user-agent: shields (self-hosted)/server-2022-12-01\r\n' +
Shields | 'accept: image/svg+xml\r\n' +
Shields | 'accept-encoding: gzip, deflate, br\r\n' +
Shields | 'Host: gitlab.com\r\n' +
Shields | 'Connection: close\r\n' +
Shields | '\r\n',
Shields | _keepAliveTimeout: 0,
Shields | _onPendingData: [Function: nop],
Shields | agent: [Agent],
Shields | socketPath: undefined,
Shields | method: 'GET',
Shields | maxHeaderSize: undefined,
Shields | insecureHTTPParser: undefined,
Shields | path: '/users/sign_in',
Shields | _ended: true,
Shields | res: [Circular *1],
Shields | aborted: false,
Shields | timeoutCb: null,
Shields | upgradeOrConnect: false,
Shields | parser: null,
Shields | maxHeadersCount: null,
Shields | reusedSocket: false,
Shields | host: 'gitlab.com',
Shields | protocol: 'https:',
Shields | timings: [Object],
Shields | [Symbol(kCapture)]: false,
Shields | [Symbol(kBytesWritten)]: 0,
Shields | [Symbol(kEndCalled)]: true,
Shields | [Symbol(kNeedDrain)]: false,
Shields | [Symbol(corked)]: 0,
Shields | [Symbol(kOutHeaders)]: [Object: null prototype],
Shields | [Symbol(kUniqueHeaders)]: null,
Shields | [Symbol(reentry)]: true,
Shields | [Symbol(kError)]: undefined
Shields | },
Shields | timings: {
Shields | start: 1672772887069,
Shields | socket: 1672772887069,
Shields | lookup: 1672772887070,
Shields | connect: 1672772887075,
Shields | secureConnect: 1672772887081,
Shields | upload: 1672772887081,
Shields | response: 1672772887093,
Shields | end: 1672772887094,
Shields | error: undefined,
Shields | abort: undefined,
Shields | phases: [Object]
Shields | },
Shields | requestUrl: URL {
Shields | href: 'https://gitlab.com/Tartempion34/manta-admin/badges/master/pipeline.svg',
Shields | origin: 'https://gitlab.com',
Shields | protocol: 'https:',
Shields | username: '',
Shields | password: '',
Shields | host: 'gitlab.com',
Shields | hostname: 'gitlab.com',
Shields | port: '',
Shields | pathname: '/Tartempion34/manta-admin/badges/master/pipeline.svg',
Shields | search: '',
Shields | searchParams: URLSearchParams {},
Shields | hash: ''
Shields | },
Shields | redirectUrls: [ [URL] ],
Shields | request: Request {
Shields | _readableState: [ReadableState],
Shields | _events: [Object: null prototype],
Shields | _eventsCount: 14,
Shields | _maxListeners: undefined,
Shields | _writableState: [WritableState],
Shields | allowHalfOpen: true,
Shields | constructor: undefined,
Shields | _noPipe: true,
Shields | options: {
Shields | request: undefined,
Shields | agent: { http: undefined, https: undefined, http2: undefined },
Shields | h2session: undefined,
Shields | decompress: true,
Shields | timeout: {
Shields | connect: undefined,
Shields | lookup: undefined,
Shields | read: undefined,
Shields | request: undefined,
Shields | response: undefined,
Shields | secureConnect: undefined,
Shields | send: undefined,
Shields | socket: undefined
Shields | },
Shields | prefixUrl: '',
Shields | body: undefined,
Shields | form: undefined,
Shields | json: undefined,
Shields | cookieJar: undefined,
Shields | ignoreInvalidCookies: false,
Shields | searchParams: undefined,
Shields | dnsLookup: undefined,
Shields | dnsCache: undefined,
Shields | context: {},
Shields | hooks: {
Shields | init: [],
Shields | beforeRequest: [],
Shields | beforeError: [],
Shields | beforeRedirect: [],
Shields | beforeRetry: [],
Shields | afterResponse: []
Shields | },
Shields | followRedirect: true,
Shields | maxRedirects: 10,
Shields | cache: undefined,
Shields | throwHttpErrors: false,
Shields | username: '',
Shields | password: '',
Shields | http2: false,
Shields | allowGetBody: false,
Shields | headers: {
Shields | 'user-agent': 'shields (self-hosted)/server-2022-12-01',
Shields | accept: 'image/svg+xml',
Shields | 'accept-encoding': 'gzip, deflate, br'
Shields | },
Shields | methodRewriting: false,
Shields | dnsLookupIpVersion: undefined,
Shields | parseJson: [Function: parse],
Shields | stringifyJson: [Function: stringify],
Shields | retry: {
Shields | limit: 0,
Shields | methods: [ 'GET', 'PUT', 'HEAD', 'DELETE', 'OPTIONS', 'TRACE' ],
Shields | statusCodes: [
Shields | 408, 413, 429, 500,
Shields | 502, 503, 504, 521,
Shields | 522, 524
Shields | ],
Shields | errorCodes: [
Shields | 'ETIMEDOUT',
Shields | 'ECONNRESET',
Shields | 'EADDRINUSE',
Shields | 'ECONNREFUSED',
Shields | 'EPIPE',
Shields | 'ENOTFOUND',
Shields | 'ENETUNREACH',
Shields | 'EAI_AGAIN'
Shields | ],
Shields | maxRetryAfter: undefined,
Shields | calculateDelay: [Function: calculateDelay],
Shields | backoffLimit: Infinity,
Shields | noise: 100
Shields | },
Shields | localAddress: undefined,
Shields | method: 'GET',
Shields | createConnection: undefined,
Shields | cacheOptions: {
Shields | shared: undefined,
Shields | cacheHeuristic: undefined,
Shields | immutableMinTimeToLive: undefined,
Shields | ignoreCargoCult: undefined
Shields | },
Shields | https: {
Shields | alpnProtocols: undefined,
Shields | rejectUnauthorized: undefined,
Shields | checkServerIdentity: undefined,
Shields | certificateAuthority: undefined,
Shields | key: undefined,
Shields | certificate: undefined,
Shields | passphrase: undefined,
Shields | pfx: undefined,
Shields | ciphers: undefined,
Shields | honorCipherOrder: undefined,
Shields | minVersion: undefined,
Shields | maxVersion: undefined,
Shields | signatureAlgorithms: undefined,
Shields | tlsSessionLifetime: undefined,
Shields | dhparam: undefined,
Shields | ecdhCurve: undefined,
Shields | certificateRevocationLists: undefined
Shields | },
Shields | encoding: undefined,
Shields | resolveBodyOnly: false,
Shields | isStream: false,
Shields | responseType: 'text',
Shields | url: URL {
Shields | href: 'https://gitlab.com/users/sign_in',
Shields | origin: 'https://gitlab.com',
Shields | protocol: 'https:',
Shields | username: '',
Shields | password: '',
Shields | host: 'gitlab.com',
Shields | hostname: 'gitlab.com',
Shields | port: '',
Shields | pathname: '/users/sign_in',
Shields | search: '',
Shields | searchParams: URLSearchParams {},
Shields | hash: ''
Shields | },
Shields | pagination: {
Shields | transform: [Function: transform],
Shields | paginate: [Function: paginate],
Shields | filter: [Function: filter],
Shields | shouldContinue: [Function: shouldContinue],
Shields | countLimit: Infinity,
Shields | backoff: 0,
Shields | requestLimit: 10000,
Shields | stackAllItems: false
Shields | },
Shields | setHost: true,
Shields | maxHeaderSize: undefined,
Shields | signal: undefined,
Shields | enableUnixSockets: true
Shields | },
Shields | response: [Circular *1],
Shields | requestUrl: [URL],
Shields | redirectUrls: [Array],
Shields | retryCount: 0,
Shields | _stopRetry: [Function: noop],
Shields | _downloadedSize: 9319,
Shields | _uploadedSize: 0,
Shields | _stopReading: true,
Shields | _pipedServerResponses: Set(0) {},
Shields | _request: [ClientRequest],
Shields | _responseSize: 9319,
Shields | _bodySize: 0,
Shields | _unproxyEvents: [Function (anonymous)],
Shields | _isFromCache: false,
Shields | _cannotHaveBody: true,
Shields | _triggerRead: true,
Shields | _cancelTimeouts: [Function: cancelTimeouts],
Shields | _removeListeners: [Function: noop],
Shields | _nativeResponse: [Circular *1],
Shields | _flushed: true,
Shields | _aborted: false,
Shields | _requestInitialized: true,
Shields | _jobs: [],
Shields | _requestOptions: [Object],
Shields | flush: [AsyncFunction (anonymous)],
Shields | [Symbol(kCapture)]: false
Shields | },
Shields | isFromCache: false,
Shields | ip: '172.65.251.78',
Shields | retryCount: 0,
Shields | ok: false,
Shields | rawBody: <Buffer 3c 21 44 4f 43 54 59 50 45 20 68 74 6d 6c 3e 0a 3c 68 74 6d 6c 3e 0a 3c 68 65 61 64 3e 0a 20 20 3c 6d 65 74 61 20 63 6f 6e 74 65 6e 74 3d 22 77 69 64 ... 9269 more bytes>,
Shields | body: '\n' +
Shields | '\n' +
Shields | '\n' +
Shields | ' \n' +
Shields | ' <title>Checking your Browser - GitLab</title>\n' +
Shields | ' <style>body{align-items:center;color:#666;display:flex;flex-direction:column;font-family:Helvetica Neue,Helvetica,Arial,sans-serif;font-size:14px;justify-content:center;margin:auto;text-align:center}hr{border:0;border-bottom:1px solid #fff;border-top:1px solid #eee;margin:18px auto;max-width:800px}img{max-width:40vw}.container{margin:auto 20px}.cferror_details{list-style-type:none}.cf-error-details h1{color:#456;font-size:20px;font-weight:400;line-height:28px}</style>\n' +
Shields | '\n' +
Shields | '\n' +
Shields | '\n' +
Shields | '\n' +
Shields | '

\n' +
Shields | ' GitLab
\n' +Shields | '

\n' +
Shields | '
\n' +
Shields | '
\n' +
Shields | ' \n' +
Shields | '

Please turn JavaScript on and reload the page.

\n' +
Shields | ' \n' +
Shields | '
\n' +
Shields | '
\n' +
Shields | '
\n' +
Shields | '
\n' +
Shields | '
\n' +
Shields | '
\n' +
Shields | '

Checking your browser before accessing gitlab.com.

\n' +
Shields | ' \n' +
Shields | '

This process is automatic. Your browser will redirect to your requested content shortly.

\n' +
Shields | '

Please allow up to 5 seconds...

\n' +
Shields | '

Redirecting...

\n' +
Shields | '
\n' +
Shields | ' \n' +
Shields | ' \n' +
Shields | ' \n' +
Shields | ' \n' +
Shields | <div id="trk_jschal_js" style="display:none;background-image:url('/cdn-cgi/images/trace/jsch/nojs/transparent.gif?ray=783e05704a34d540')"></div>\n +
Shields | ' <script>\n' +
Shields | ' (function(){\n' +
Shields | ' window._cf_chl_opt={\n' +
Shields | " cvId: '2',\n" +
Shields | " cType: 'non-interactive',\n" +
Shields | " cNounce: '24228',\n" +
Shields | " cRay: '783e05704a34d540',\n" +
Shields | " cHash: 'd21e961b0af4e8e',\n" +
Shields | ' cUPMDTk: "\/users\/sign_in?__cf_chl_tk=z.QPvMtN2RLqx3uWVm8PMk9hlZU72KqXDUHrHs5WMH8-1672772887-0-gaNycGzNCNE",\n' +
Shields | " cFPWv: 'g',\n" +
Shields | " cTTimeMs: '1000',\n" +
Shields | ' cTplV: 1,\n' +
Shields | " cTplB: 'cf',\n" +
Shields | ' cRq: {\n' +
Shields | " ru: 'aHR0cHM6Ly9naXRsYWIuY29tL3VzZXJzL3NpZ25faW4=',\n" +
Shields | " ra: 'c2hpZWxkcyAoc2VsZi1ob3N0ZWQpL3NlcnZlci0yMDIyLTEyLTAx',\n" +
Shields | " rm: 'R0VU',\n" +
Shields | " d: 'DJ0TSjEiwzW2tThBb8Tq4cuWaJiH4tbGDfUMD485tk7hEiGo/mYqnhIuYsnlaEAifVxqkf+n3KHzOQDAj8mxnOA17deXjDtPdB8INmjN3VgBo8LhCkRmphvEP0U5YMjUZ4jE6QXeorY/OB8FmUgCfOAPNSFEDtNW8+ovGLIvMDxixpwpa1x/IlROkh2lFZ2fYoAeyd8ckgVaB+fTqpBAsgigQhur/3JSyRocUH4wzpEWd5kIg8Psp2WASEteESxUe/gblV2JBA9Evcz0JZ/z+fxrrZvJIo9qRBvjHAHHf8EqqJMW2T5OPkWcz6wqSSeAhAkIGJ9nkPAslhtamBCIMB83rVixGK3jVMigklUwJFr5KzzRdI91/28UO5avYDx7yB1hUUq37tgnVcbDh2TYvmAgY25qIN3fkyewSUo9xuUllKGqyM1DAxk6+3jLla77v+oWa0MOoPCdXb/fYUs+mMtNu4noTJmtt279yY5cpggUsY2gu6bL/XeHKZ5Kel0vBVXUyH60/pxs455s0uC8+CrLNNCXDDMzkqYgYutrkWtLDs9mwBec8G41G8ncTXPgpnC38UAMqPtQa3dOFXdu9w==',\n" +
Shields | " t: 'MTY3Mjc3Mjg4Ny4wODEwMDA=',\n" +
Shields | " m: 'VllkNc8t8c+HzevSQn6gN1HbIsnCpP/sTiwjr9gDVD8=',\n" +
Shields | " i1: 'HQFaxtMnxowhFi1wqjEhyQ==',\n" +
Shields | " i2: 'B7J34O6RxGYnsn8L/efVIQ==',\n" +
Shields | " zh: 'UnJDyo9FrWqFHAM0dnr3Qrw4Ll86sU7CDCiveOM3u04=',\n" +
Shields | " uh: 'TpkbFKD1tc8StnPKYKs+s7jgc/cMW5LJ3hAL06zVhhM=',\n" +
Shields | " hh: 'lGQbzypQ55vDVgAzrKu7GNtEf1PrcZK3oqezycJ79vw=',\n" +
Shields | ' }\n' +
Shields | ' };\n' +
Shields | " var trkjs = document.createElement('img');\n" +
Shields | " trkjs.setAttribute('src', '/cdn-cgi/images/trace/jsch/js/transparent.gif?ray=783e05704a34d540');\n" +
Shields | " trkjs.setAttribute('style', 'display: none');\n" +
Shields | ' document.body.appendChild(trkjs);\n' +
Shields | " var cpo = document.createElement('script');\n" +
Shields | " cpo.src = '/cdn-cgi/challenge-platform/h/g/orchestrate/jsch/v1?ray=783e05704a34d540';\n" +
Shields | " window._cf_chl_opt.cOgUHash = location.hash === '' && location.href.indexOf('#') !== -1 ? '#' : location.hash;\n" +
Shields | " window._cf_chl_opt.cOgUQuery = location.search === '' && location.href.slice(0, -window._cf_chl_opt.cOgUHash.length).indexOf('?') !== -1 ? '?' : location.search;\n" +
Shields | ' if (window.history && window.history.replaceState) {\n' +
Shields | ' var ogU = location.pathname + window._cf_chl_opt.cOgUQuery + window._cf_chl_opt.cOgUHash;\n' +
Shields | ' history.replaceState(null, null, "\/users\/sign_in?__cf_chl_rt_tk=z.QPvMtN2RLqx3uWVm8PMk9hlZU72KqXDUHrHs5WMH8-1672772887-0-gaNycGzNCNE" + window._cf_chl_opt.cOgUHash);\n' +
Shields | ' cpo.onload = function() {\n' +
Shields | ' history.replaceState(null, null, ogU);\n' +
Shields | ' };\n' +
Shields | ' }\n' +
Shields | " document.getElementsByTagName('head')[0].appendChild(cpo);\n" +
Shields | ' }());\n' +
Shields | '</script>\n' +
Shields | '\n' +
Shields | '
\n' +
Shields | '\n' +
Shields | '
\n' +
Shields | '
\n' +
Shields | '\n' +
Shields | '',
Shields | [Symbol(kCapture)]: false,
Shields | [Symbol(kHeaders)]: {
Shields | date: 'Tue, 03 Jan 2023 19:08:07 GMT',
Shields | 'content-type': 'text/html; charset=UTF-8',
Shields | 'transfer-encoding': 'chunked',
Shields | connection: 'close',
Shields | 'cross-origin-embedder-policy': 'require-corp',
Shields | 'cross-origin-opener-policy': 'same-origin',
Shields | 'cross-origin-resource-policy': 'same-origin',
Shields | 'permissions-policy': 'accelerometer=(),autoplay=(),camera=(),clipboard-read=(),clipboard-write=(),fullscreen=(),geolocation=(),gyroscope=(),hid=(),interest-cohort=(),magnetometer=(),microphone=(),payment=(),publickey-credentials-get=(),screen-wake-lock=(),serial=(),sync-xhr=(),usb=()',
Shields | 'referrer-policy': 'same-origin',
Shields | 'x-frame-options': 'SAMEORIGIN',
Shields | 'cache-control': 'private, max-age=0, no-store, no-cache, must-revalidate, post-check=0, pre-check=0',
Shields | expires: 'Thu, 01 Jan 1970 00:00:01 GMT',
Shields | 'report-to': '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=Nk7Mcts%2FCnwr6k%2BSM3q5s9zgqw3plJfvngeFzWk%2FwisnQxX9JCsIqv6tGjiKayzhRtfjGoEPC1AqfFhs0TR5OToBN1oHH96POh0wNv19K92LmjyfvWNAcuFXO1E%3D"}],"group":"cf-nel","max_age":604800}',
Shields | nel: '{"success_fraction":0.01,"report_to":"cf-nel","max_age":604800}',
Shields | vary: 'Accept-Encoding',
Shields | 'strict-transport-security': 'max-age=31536000',
Shields | 'x-content-type-options': 'nosniff',
Shields | server: 'cloudflare',
Shields | 'cf-ray': '783e05704a34d540-CDG'
Shields | },
Shields | [Symbol(kHeadersCount)]: 38,
Shields | [Symbol(kTrailers)]: null,
Shields | [Symbol(kTrailersCount)]: 0,
Shields | [Symbol(RequestTimeout)]: undefined
Shields | },
Shields | buffer: '\n' +
Shields | '\n' +
Shields | '\n' +
Shields | ' \n' +
Shields | ' <title>Checking your Browser - GitLab</title>\n' +
Shields | ' <style>body{align-items:center;color:#666;display:flex;flex-direction:column;font-family:Helvetica Neue,Helvetica,Arial,sans-serif;font-size:14px;justify-content:center;margin:auto;text-align:center}hr{border:0;border-bottom:1px solid #fff;border-top:1px solid #eee;margin:18px auto;max-width:800px}img{max-width:40vw}.container{margin:auto 20px}.cferror_details{list-style-type:none}.cf-error-details h1{color:#456;font-size:20px;font-weight:400;line-height:28px}</style>\n' +
Shields | '\n' +
Shields | '\n' +
Shields | '\n' +
Shields | '\n' +
Shields | '

\n' +
Shields | ' GitLab
\n' +
Shields | '

\n' +
Shields | '
\n' +
Shields | '
\n' +
Shields | ' \n' +
Shields | '

Please turn JavaScript on and reload the page.

\n' +
Shields | ' \n' +
Shields | '
\n' +
Shields | '
\n' +
Shields | '
\n' +
Shields | '
\n' +
Shields | '
\n' +
Shields | '
\n' +
Shields | '

Checking your browser before accessing gitlab.com.

\n' +
Shields | ' \n' +
Shields | '

This process is automatic. Your browser will redirect to your requested content shortly.

\n' +
Shields | '

Please allow up to 5 seconds...

\n' +
Shields | '

Redirecting...

\n' +
Shields | '
\n' +
Shields | ' \n' +
Shields | ' \n' +
Shields | ' \n' +
Shields | ' \n' +
Shields | <div id="trk_jschal_js" style="display:none;background-image:url('/cdn-cgi/images/trace/jsch/nojs/transparent.gif?ray=783e05704a34d540')"></div>\n +
Shields | ' <script>\n' +
Shields | ' (function(){\n' +
Shields | ' window._cf_chl_opt={\n' +
Shields | " cvId: '2',\n" +
Shields | " cType: 'non-interactive',\n" +
Shields | " cNounce: '24228',\n" +
Shields | " cRay: '783e05704a34d540',\n" +
Shields | " cHash: 'd21e961b0af4e8e',\n" +
Shields | ' cUPMDTk: "\/users\/sign_in?__cf_chl_tk=z.QPvMtN2RLqx3uWVm8PMk9hlZU72KqXDUHrHs5WMH8-1672772887-0-gaNycGzNCNE",\n' +
Shields | " cFPWv: 'g',\n" +
Shields | " cTTimeMs: '1000',\n" +
Shields | ' cTplV: 1,\n' +
Shields | " cTplB: 'cf',\n" +
Shields | ' cRq: {\n' +
Shields | " ru: 'aHR0cHM6Ly9naXRsYWIuY29tL3VzZXJzL3NpZ25faW4=',\n" +
Shields | " ra: 'c2hpZWxkcyAoc2VsZi1ob3N0ZWQpL3NlcnZlci0yMDIyLTEyLTAx',\n" +
Shields | " rm: 'R0VU',\n" +
Shields | " d: 'DJ0TSjEiwzW2tThBb8Tq4cuWaJiH4tbGDfUMD485tk7hEiGo/mYqnhIuYsnlaEAifVxqkf+n3KHzOQDAj8mxnOA17deXjDtPdB8INmjN3VgBo8LhCkRmphvEP0U5YMjUZ4jE6QXeorY/OB8FmUgCfOAPNSFEDtNW8+ovGLIvMDxixpwpa1x/IlROkh2lFZ2fYoAeyd8ckgVaB+fTqpBAsgigQhur/3JSyRocUH4wzpEWd5kIg8Psp2WASEteESxUe/gblV2JBA9Evcz0JZ/z+fxrrZvJIo9qRBvjHAHHf8EqqJMW2T5OPkWcz6wqSSeAhAkIGJ9nkPAslhtamBCIMB83rVixGK3jVMigklUwJFr5KzzRdI91/28UO5avYDx7yB1hUUq37tgnVcbDh2TYvmAgY25qIN3fkyewSUo9xuUllKGqyM1DAxk6+3jLla77v+oWa0MOoPCdXb/fYUs+mMtNu4noTJmtt279yY5cpggUsY2gu6bL/XeHKZ5Kel0vBVXUyH60/pxs455s0uC8+CrLNNCXDDMzkqYgYutrkWtLDs9mwBec8G41G8ncTXPgpnC38UAMqPtQa3dOFXdu9w==',\n" +
Shields | " t: 'MTY3Mjc3Mjg4Ny4wODEwMDA=',\n" +
Shields | " m: 'VllkNc8t8c+HzevSQn6gN1HbIsnCpP/sTiwjr9gDVD8=',\n" +
Shields | " i1: 'HQFaxtMnxowhFi1wqjEhyQ==',\n" +
Shields | " i2: 'B7J34O6RxGYnsn8L/efVIQ==',\n" +
Shields | " zh: 'UnJDyo9FrWqFHAM0dnr3Qrw4Ll86sU7CDCiveOM3u04=',\n" +
Shields | " uh: 'TpkbFKD1tc8StnPKYKs+s7jgc/cMW5LJ3hAL06zVhhM=',\n" +
Shields | " hh: 'lGQbzypQ55vDVgAzrKu7GNtEf1PrcZK3oqezycJ79vw=',\n" +
Shields | ' }\n' +
Shields | ' };\n' +
Shields | " var trkjs = document.createElement('img');\n" +
Shields | " trkjs.setAttribute('src', '/cdn-cgi/images/trace/jsch/js/transparent.gif?ray=783e05704a34d540');\n" +
Shields | " trkjs.setAttribute('style', 'display: none');\n" +
Shields | ' document.body.appendChild(trkjs);\n' +
Shields | " var cpo = document.createElement('script');\n" +
Shields | " cpo.src = '/cdn-cgi/challenge-platform/h/g/orchestrate/jsch/v1?ray=783e05704a34d540';\n" +
Shields | " window._cf_chl_opt.cOgUHash = location.hash === '' && location.href.indexOf('#') !== -1 ? '#' : location.hash;\n" +
Shields | " window._cf_chl_opt.cOgUQuery = location.search === '' && location.href.slice(0, -window._cf_chl_opt.cOgUHash.length).indexOf('?') !== -1 ? '?' : location.search;\n" +
Shields | ' if (window.history && window.history.replaceState) {\n' +
Shields | ' var ogU = location.pathname + window._cf_chl_opt.cOgUQuery + window._cf_chl_opt.cOgUHash;\n' +
Shields | ' history.replaceState(null, null, "\/users\/sign_in?__cf_chl_rt_tk=z.QPvMtN2RLqx3uWVm8PMk9hlZU72KqXDUHrHs5WMH8-1672772887-0-gaNycGzNCNE" + window._cf_chl_opt.cOgUHash);\n' +
Shields | ' cpo.onload = function() {\n' +
Shields | ' history.replaceState(null, null, ogU);\n' +
Shields | ' };\n' +
Shields | ' }\n' +
Shields | " document.getElementsByTagName('head')[0].appendChild(cpo);\n" +
Shields | ' }());\n' +
Shields | '</script>\n' +
Shields | '\n' +
Shields | '
\n' +
Shields | '\n' +
Shields | '
\n' +
Shields | '
\n' +
Shields | '\n' +
Shields | ''
Shields | }
Shields | Service data 🛡
Shields | { isError: true, message: 'inaccessible', color: 'lightgray' }

@chris48s chris48s added service-badge Accepted and actionable changes, features, and bugs and removed question Support questions, usage questions, unconfirmed bugs, discussions, ideas labels Jan 3, 2023
@chris48s
Copy link
Member

chris48s commented Jan 3, 2023

Right, yes. I see the issue now.

You should find all the other gitlab badges (license, issues, releases, contributors, etc) work fine for your private repos but pipeline status and coverage don't - right?

The reason why pipeline status and coverage don't work is because they don't get their data from the GitLab API. They are basically "scrapers" for the GitLab native badges which allow them to be re-styled with the shields formatting options. These badges were added a long time ago when GitLab's API rate limits were still really restrictive. Because they don't use the API, they can't pass an auth token. They'll only work for public repos.

To solve this, we'll need to rewrite those to get their data from the API like the other GitLab badges.

@Aurelienmasse
Copy link
Author

Fair enough that's quite clear. Didn't check the other badges. I will wait if one day the other method is implemented. Thanks a lot for your help.

@chris48s
Copy link
Member

chris48s commented Jan 3, 2023

If anyone wants to pick this up

  • Extending GitLabBase will automatically pass the auth header if token is configured
  • The relevant GitLab API will be https://docs.gitlab.com/ee/api/pipelines.html
  • There may be some nuances to consider to exactly match the behaviour of the current badges. For example:
    • What do we show when a build is in progress for the specified branch: In progress, or the status of the last complete build?
    • What do we show if there is no complete build on the specified branch
    • etc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
self-hosting Discussion, problems, features, and documentation related to self-hosting Shields service-badge Accepted and actionable changes, features, and bugs
Projects
None yet
Development

No branches or pull requests

2 participants