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

AWS CodeBuild requires a very long webhook URL and token #1951

Open
int128 opened this issue Apr 13, 2018 · 1 comment · May be fixed by #1977
Open

AWS CodeBuild requires a very long webhook URL and token #1951

int128 opened this issue Apr 13, 2018 · 1 comment · May be fixed by #1977

Comments

@int128
Copy link
Contributor

int128 commented Apr 13, 2018

I am trying GitBucket and AWS CodeBuild for continuous integration. AWS CodeBuild can generate a webhook URL and token but they are too long and GitBucket does not accept them.

For example, in the us-west-2 zone, a webhook URL seems 280~290 chars as like:

https://codebuild.us-west-2.amazonaws.com/webhooks?t=[VERY LONG STRING]&v=1

and a token seems 1000~1100 chars. As far as I know, AWS does not provide max length of webhook URL and token, but I think the followings are enough:

  • Webhook URL: 1024 chars
  • Security token: 2048 chars

Currently the webhook form accepts a very long string because it does not have length validation, but finally it causes a database error.

Issue

Impacted version: 4.23.0

Deployment mode: Running in a container behind a reverse proxy and SSL load balancer on AWS

@int128
Copy link
Contributor Author

int128 commented Apr 25, 2018

Stacktrace on registration of the long webhook:

org.postgresql.util.PSQLException: ERROR: current transaction is aborted, commands ignored until end of transaction block
	at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2477)
	...
	at com.github.takezoe.slick.blocking.BlockingJdbcProfile$BlockingAPI$BlockingQueryInvoker.firstOption(BlockingProfile.scala:87)
	at gitbucket.core.service.AccountService.getAccountByUserName(AccountService.scala:96)
	at gitbucket.core.service.AccountService.getAccountByUserName$(AccountService.scala:95)
Caused by: org.postgresql.util.PSQLException: ERROR: value too long for type character varying(200)
	at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2477)
	...
	at gitbucket.core.service.WebHookService.addWebHook(WebHookService.scala:101)
	at gitbucket.core.service.WebHookService.addWebHook$(WebHookService.scala:93)
	at gitbucket.core.controller.RepositorySettingsController.addWebHook(RepositorySettingsController.scala:24)
	at gitbucket.core.controller.RepositorySettingsControllerBase.$anonfun$$init$$29(RepositorySettingsController.scala:258)
	...

int128 added a commit to int128/gitbucket that referenced this issue Apr 26, 2018
@int128 int128 linked a pull request Apr 26, 2018 that will close this issue
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

2 participants