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

Locally Self hosted Docker returns internal error #4862

Closed
apobekiaris opened this issue Apr 3, 2020 · 8 comments
Closed

Locally Self hosted Docker returns internal error #4862

apobekiaris opened this issue Apr 3, 2020 · 8 comments
Labels
question Support questions, usage questions, unconfirmed bugs, discussions, ideas self-hosting Discussion, problems, features, and documentation related to self-hosting Shields

Comments

@apobekiaris
Copy link

apobekiaris commented Apr 3, 2020

I started the Docker container locally as per docks and the site runs fine. However none of the badges are created. Is there some component i miss? Are there any instructions to debug it?

image

@apobekiaris apobekiaris added the question Support questions, usage questions, unconfirmed bugs, discussions, ideas label Apr 3, 2020
@paulmelnikow
Copy link
Member

Hi! Shields emits stack traces for the errors to standard output, so you should be able to get more details in the container.

@paulmelnikow paulmelnikow added the self-hosting Discussion, problems, features, and documentation related to self-hosting Shields label Apr 3, 2020
@apobekiaris
Copy link
Author

Hi

this is what it reprots

2020-04-05T17:47:15.381086328Z: [ERROR]      at TokenPool._nextBatch (/usr/src/app/core/token-pooling/token-pool.js:268:11)
2020-04-05T17:47:15.381095828Z: [ERROR]      at TokenPool.next (/usr/src/app/core/token-pooling/token-pool.js:305:20)
2020-04-05T17:47:15.381099828Z: [ERROR]      at GithubApiProvider.tokenForUrl (/usr/src/app/services/github/github-api-provider.js:158:34)
2020-04-05T17:47:15.381103628Z: [ERROR]      at GithubApiProvider.request (/usr/src/app/services/github/github-api-provider.js:172:22)
2020-04-05T17:47:15.381107528Z: [ERROR]      at Promise (/usr/src/app/services/github/github-api-provider.js:211:12)
2020-04-05T17:47:15.381111228Z: [ERROR]      at new Promise (<anonymous>)
2020-04-05T17:47:15.381115328Z: [ERROR]      at GithubApiProvider.requestAsPromise (/usr/src/app/services/github/github-api-provider.js:210:12)
2020-04-05T17:47:15.381118928Z: [ERROR]      at GithubStars._requestFetcher (/usr/src/app/services/github/github-auth-service.js:13:23)
2020-04-05T17:47:15.381129928Z: [ERROR]      at GithubStars._request (/usr/src/app/core/base-service/base.js:230:40)
2020-04-05T17:47:15.381134528Z: [ERROR]      at GithubStars._requestJson (/usr/src/app/core/base-service/base-json.js:47:35)

@apobekiaris
Copy link
Author

here a more complete version just in case

Configuration:
{ bind: { address: '0.0.0.0' },
  metrics: { prometheus: { enabled: false } },
  ssl: { isSecure: false },
  cors: { allowedOrigin: [] },
  persistence: { dir: './private' },
  services:
   { github:
      { baseUri: 'https://api.github.com/',
        debug: { enabled: false, intervalSeconds: 200 } },
     trace: false },
  profiling: { makeBadge: false },
  cacheHeaders: { defaultCacheLengthSeconds: 120 },
  rateLimit: true,
  handleInternalErrors: true,
  fetchLimit: '10MB' }
0405173356 FsTokenPersistence configured with /usr/src/app/private/github-user-tokens.json
0405173356 Server is starting up: http://0.0.0.0/
0405174424 Error: Token pool is exhausted
    at TokenPool._nextBatch (/usr/src/app/core/token-pooling/token-pool.js:268:11)
    at TokenPool.next (/usr/src/app/core/token-pooling/token-pool.js:305:20)
    at GithubApiProvider.tokenForUrl (/usr/src/app/services/github/github-api-provider.js:156:33)
    at GithubApiProvider.request (/usr/src/app/services/github/github-api-provider.js:172:22)
    at Promise (/usr/src/app/services/github/github-api-provider.js:211:12)
    at new Promise (<anonymous>)
    at GithubApiProvider.requestAsPromise (/usr/src/app/services/github/github-api-provider.js:210:12)
    at GithubForks._requestFetcher (/usr/src/app/services/github/github-auth-service.js:13:23)
    at GithubForks._request (/usr/src/app/core/base-service/base.js:230:40)
    at GithubForks._requestGraphql (/usr/src/app/core/base-service/base-graphql.js:72:35)

so it looks i must be missing something?

@paulmelnikow
Copy link
Member

To use the GitHub badges, you need to set a GitHub token:

https://github.com/badges/shields/blob/master/doc/server-secrets.md#github

In theory you should be able to generate 60 badges/hr without a token, however this isn't possible because of #2754.

@calebcartwright
Copy link
Member

Are you able to get any of the other, non-GitHub badges, to work?

@apobekiaris
Copy link
Author

apobekiaris commented Apr 6, 2020

excellent it now works on Azure with minimum efforts, I only added a GH_TOKEN through Azure UI. Great work guys!

I have another question, my needs are to support my Os project and I have shields public on Azure is there some setting that will allow only my Os organization repos to access it?

@paulmelnikow
Copy link
Member

I have another question, my needs are to support my Os project and I have shields public on Azure is there some setting that will allow only my Os organization repos to access it?

No, there is nothing like this today. If you want to limit access, you'd probably have to host it inside your firewall.

@calebcartwright
Copy link
Member

You could also potentially restrict access to your self-hosted Shields instance leveraging Azure features (depending on which services you're leveraging)

paulmelnikow added a commit that referenced this issue Apr 6, 2020
Should provide better debuggability in self-hosting cases like #4862 but also on the production server.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Support questions, usage questions, unconfirmed bugs, discussions, ideas self-hosting Discussion, problems, features, and documentation related to self-hosting Shields
Projects
None yet
Development

No branches or pull requests

3 participants