@Dudder

Как исправить ошибку The Application Default Credentials are not available в Heroku?

В приложении из gcp используется: bucket для картинок и Secrets Manager. В секретах хранится connection string для бд, секрет для jwt и json для bucket. Эта ошибка не появлялась при локальном запуске проекта.
at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirError)
2023-10-06T18:47:40.662837+00:00 app[web.1]: at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode, Func`4 createOpenException)
2023-10-06T18:47:40.662841+00:00 app[web.1]: at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, UnixFileMode openPermissions, Int64& fileLength, UnixFileMode& filePermissions, Func`4 createOpenException)
2023-10-06T18:47:40.662844+00:00 app[web.1]: at System.IO.Strategies.OSFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)
2023-10-06T18:47:40.662844+00:00 app[web.1]: at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access)
2023-10-06T18:47:40.662844+00:00 app[web.1]: at Google.Apis.Auth.OAuth2.DefaultCredentialProvider.GetStream(String filePath)
2023-10-06T18:47:40.662845+00:00 app[web.1]: at Google.Apis.Auth.OAuth2.DefaultCredentialProvider.CreateDefaultCredentialFromFileAsync(String credentialPath, CancellationToken cancellationToken)
2023-10-06T18:47:40.662845+00:00 app[web.1]: at Google.Apis.Auth.OAuth2.DefaultCredentialProvider.<CreateDefaultCredentialAsync>g__GetAdcFromEnvironmentVariableAsync|11_0()
2023-10-06T18:47:40.662845+00:00 app[web.1]: --- End of inner exception stack trace ---
2023-10-06T18:47:40.662845+00:00 app[web.1]: at Google.Apis.Auth.OAuth2.DefaultCredentialProvider.<CreateDefaultCredentialAsync>g__GetAdcFromEnvironmentVariableAsync|11_0()
2023-10-06T18:47:40.662845+00:00 app[web.1]: at Google.Apis.Auth.OAuth2.DefaultCredentialProvider.CreateDefaultCredentialAsync()
2023-10-06T18:47:40.662845+00:00 app[web.1]: at Google.Api.Gax.Grpc.DefaultChannelCredentialsCache.<.ctor>b__5_1()
2023-10-06T18:47:40.662846+00:00 app[web.1]: at Google.Api.Gax.Grpc.ChannelPool.GetChannelAsync(GrpcAdapter grpcAdapter, String endpoint, GrpcChannelOptions channelOptions, CancellationToken cancellationToken)
2023-10-06T18:47:40.662846+00:00 app[web.1]: at Google.Api.Gax.Grpc.ClientBuilderBase`1.CreateCallInvokerAsync(CancellationToken cancellationToken)
2023-10-06T18:47:40.662847+00:00 app[web.1]: at Google.Cloud.SecretManager.V1.SecretManagerServiceClientBuilder.BuildAsyncImpl(CancellationToken cancellationToken)
2023-10-06T18:47:40.662854+00:00 app[web.1]: at CircleCI.Services.GoogleSecrets.SecretManager.GetSecretVersionResponse(String secretString, String version) in /tmp/build_8cd2f356/CircleCI/CircleCI.Services/GoogleSecrets/SecretManager.cs:line 32
2023-10-06T18:47:40.662854+00:00 app[web.1]: at CircleCI.Services.GoogleSecrets.SecretManager.GetConnectionString() in /tmp/build_8cd2f356/CircleCI/CircleCI.Services/GoogleSecrets/SecretManager.cs:line 14
2023-10-06T18:47:40.662854+00:00 app[web.1]: at Program.<Main>$(String[] args) in /tmp/build_8cd2f356/CircleCI/CircleCI.Api/Program.cs:line 19
2023-10-06T18:47:40.662854+00:00 app[web.1]: at Program.<Main>(String[] args)
Unhandled exception. System.InvalidOperationException: The Application Default Credentials are not available. They are available if running in Google Compute Engine. Otherwise, the environment variable GOOGLE_APPLICATION_CREDENTIALS must be defined pointing to a file defining the credentials. See https://developers.google.com/accounts/docs/application-default-credentials for more information.
  • Вопрос задан
  • 53 просмотра
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы