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

Invalid Github API token causes webhook to fail silently #380

Open
dregad opened this issue Dec 24, 2021 · 2 comments
Open

Invalid Github API token causes webhook to fail silently #380

dregad opened this issue Dec 24, 2021 · 2 comments

Comments

@dregad
Copy link
Member

dregad commented Dec 24, 2021

The Webhook delivery results in an HTTP 200 return code, but the response is actually a MantisBT error page: INTERNAL APPLICATION ERROR

Delivering the payload with $g_show_detailed_errors = ON; yields additional information

Client error: `GET https://api.github.com/rate_limit?per_page=100` resulted in a `401 Unauthorized` response:
{
"message": "Bad credentials",
"documentation_url": "https://docs.github.com/rest"
}

Stack trace

0	.../vendor/guzzlehttp/guzzle/src/Middleware.php	65	GuzzleHttp\Exception\RequestException	::	create	-
1	.../vendor/guzzlehttp/promises/src/Promise.php	204	GuzzleHttp\Middleware	::	GuzzleHttp\{closure}	-
2	.../vendor/guzzlehttp/promises/src/Promise.php	153	GuzzleHttp\Promise\Promise	::	callHandler	-
3	.../vendor/guzzlehttp/promises/src/TaskQueue.php	48	GuzzleHttp\Promise\Promise	::	GuzzleHttp\Promise\{closure}	-
4	.../vendor/guzzlehttp/promises/src/Promise.php	248	GuzzleHttp\Promise\TaskQueue	->	run	-
5	.../vendor/guzzlehttp/promises/src/Promise.php	224	GuzzleHttp\Promise\Promise	->	invokeWaitFn	-
6	.../vendor/guzzlehttp/promises/src/Promise.php	269	GuzzleHttp\Promise\Promise	->	waitIfPending	-
7	.../vendor/guzzlehttp/promises/src/Promise.php	226	GuzzleHttp\Promise\Promise	->	invokeWaitList	-
8	.../vendor/guzzlehttp/promises/src/Promise.php	62	GuzzleHttp\Promise\Promise	->	waitIfPending	-
9	.../vendor/guzzlehttp/guzzle/src/Client.php	182	GuzzleHttp\Promise\Promise	->	wait	-
10	.../vendor/guzzlehttp/guzzle/src/Client.php	95	GuzzleHttp\Client	->	request	-
11	.../plugins/SourceGithub/SourceGithub.php	506	GuzzleHttp\Client	->	__call	-
12	.../plugins/SourceGithub/SourceGithub.php	546	SourceGithubPlugin	->	api_get	-
13	.../plugins/SourceGithub/SourceGithub.php	720	SourceGithubPlugin	->	api_json_url	-
14	.../plugins/SourceGithub/SourceGithub.php	639	SourceGithubPlugin	->	import_commits	-
15	.../plugins/Source/Source.API.php	524	SourceGithubPlugin	->	commit	-
16	.../plugins/source-integration/Source/pages/checkin.php	86	SourceVCSWrapper	->	__call	-
17	.../plugin.php	74	-	-	include	<string>'/srv/plugins/source-integration/Source/pages/checkin.php'

The Guzzle RequestException should be caught and reported as a meaningful error.

@dregad
Copy link
Member Author

dregad commented Dec 30, 2021

Same root cause as #266

@dregad
Copy link
Member Author

dregad commented Sep 16, 2024

Problem will probably be fixed by https://mantisbt.org/bugs/view.php?id=34634

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant