Skip to content

Return response body in log output when bbs2gh encounters a 5xx #1556

Description

@jfine

The example below was encountered...

...
[2026-05-19 23:18:41] [DEBUG] HTTP POST: https://HOST/rest/api/1.0/migration/exports
[2026-05-19 23:18:41] [DEBUG] HTTP BODY: {"repositoriesRequest":{"includes":[{"projectKey":"PROJECT","slug":"REPOSITORY"}]}}
[2026-05-19 23:18:41] [DEBUG] RESPONSE (ServiceUnavailable): {"errors":[{"message":"Could not start migration job as the limit of concurrent jobs has been reached.","exceptionName":"com.atlassian.bitbucket.migration.MaxConcurrentMigrationJobsException"}]}
[2026-05-19 23:18:41] [ERROR] [HTTP ERROR 503] System.Net.Http.HttpRequestException: Response status code does not indicate success: 503 (Service Unavailable).
   at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()
   at OctoshiftCLI.Services.BbsClient.SendAsync(HttpMethod httpMethod, String url, Object body)
   at OctoshiftCLI.Services.BbsClient.PostAsync(String url, Object body)
   at OctoshiftCLI.Services.BbsApi.StartExport(String projectKey, String slug)
   at OctoshiftCLI.BbsToGithub.Commands.MigrateRepo.MigrateRepoCommandHandler.GenerateArchive(MigrateRepoCommandArgs args)
   at OctoshiftCLI.BbsToGithub.Commands.MigrateRepo.MigrateRepoCommandHandler.Handle(MigrateRepoCommandArgs args)
   at OctoshiftCLI.Extensions.CommandExtensions.RunHandler[TArgs,THandler](TArgs args, ServiceProvider sp, CommandBase`2 command)
   at OctoshiftCLI.Extensions.CommandExtensions.<>c__DisplayClass1_0`3.<<ConfigureCommand>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Invocation.AnonymousCommandHandler.InvokeAsync(InvocationContext)
   at System.CommandLine.Invocation.InvocationPipeline.<>c__DisplayClass4_0.<<BuildInvocationChain>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass17_0.<<UseParseErrorReporting>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass12_0.<<UseHelp>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass22_0.<<UseVersionOption>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass19_0.<<UseTypoCorrections>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseSuggestDirective>b__18_0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass16_0.<<UseParseDirective>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<RegisterWithDotnetSuggest>b__5_0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass8_0.<<UseExceptionHandler>b__0>d.MoveNext()

...and although the above response can be seen in the verbose.log it is not shown in the standard log output. Adding the response body to the standard log output would help with confusion instead of simply seeing...

[2026-05-19 23:18:41] [ERROR] An unexpected error happened. Please see the logs for details.

Todo

  • Output response body as additional context when a "An unexpected error happened" log message is rendered due to a 5xx

Dependencies

  • ...

Metadata

Metadata

Assignees

Labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions