Error when sending message using a quota project
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 35/100
Línea de trabajo
Empieza reproduciendo el fallo mediante FirebaseApp.Create, FirebaseMessaging.GetMessaging y FirebaseMessaging.SendAsync usando una credencial creada con CreateWithQuotaProject. Lee el stack trace a través de FirebaseMessagingClient.SendAsync y ConfigurableMessageHandler.CheckValidAfterInterceptors para determinar por qué se rechaza el encabezado x-goog-user-project. Se considera terminado cuando los mensajes se envían de forma fiable sin la InvalidOperationException.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
[REQUIRED] Step 2: Describe your environment
We are running our API on Google's cloud run.
- Firebase SDK version: FirebaseAdmin version 3.1.0
- Firebase Product: Messaging
- .NET version: 8.0
[REQUIRED] Step 3: Describe the problem
Steps to reproduce:
We are creating a FirebaseApp and retrieving the FirebaseMessaging instance via this code:
public FirebaseMessaging GetFirebaseMessaging()
{
var apiKey = _contextService.ApiKey;
var app = _apps.GetOrAdd(apiKey, key =>
{
var projectId = $"{_firebaseSettings.Value.ProjectIdPrefix}{key[..8]}-{key[^12..]}";
var credential = GoogleCredential.GetApplicationDefault().CreateWithQuotaProject(projectId);
var options = new AppOptions
{
Credential = credential,
ProjectId = projectId,
HttpClientFactory = _httpClientFactory
};
return FirebaseApp.Create(options, key);
});
return FirebaseMessaging.GetMessaging(app);
}
With the value returned by the previous method, we send a message using the following code:
var messageId = await messaging.SendAsync(message, cancellationToken);
but we sometimes get the following error:
System.InvalidOperationException: x-goog-user-project header can only be added through the credential or through the <Product>ClientBuilder.
at Google.Apis.Http.ConfigurableMessageHandler.CheckValidAfterInterceptors(HttpRequestMessage request)
at Google.Apis.Http.ConfigurableMessageHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationTokenSource cts, Boolean disposeCts, CancellationTokenSource pendingRequestsCts, CancellationToken originalCancellationToken)
at FirebaseAdmin.Util.ErrorHandlingHttpClient`1.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
at FirebaseAdmin.Util.ErrorHandlingHttpClient`1.SendAndReadAsync(HttpRequestMessage request, CancellationToken cancellationToken)
at FirebaseAdmin.Util.ErrorHandlingHttpClient`1.SendAndDeserializeAsync[TResult](HttpRequestMessage request, CancellationToken cancellationToken)
at FirebaseAdmin.Messaging.FirebaseMessagingClient.SendAsync(Message message, Boolean dryRun, CancellationToken cancellationToken)
at FirebaseAdmin.Messaging.FirebaseMessaging.SendAsync(Message message, Boolean dryRun, CancellationToken cancellationToken)
at FirebaseAdmin.Messaging.FirebaseMessaging.SendAsync(Message message, CancellationToken cancellationToken)
at Campaigns.Data.Clients.PushNotificationClient.SendPushNotificationAsync(SendPushNotification pushNotification, CancellationToken cancellationToken) in /src/campaign/src/Campaigns.Data/Clients/PushNotificationClient.cs:line 33
I may be missing something, but the x-goog-user-project header is added automatically via the SDK.
- Lenguaje dominante
- C#
- Estrellas
- 407
- Forks
- 147
- Merge medio
- 2 d 10 h
- PR fusionados (30 d)
- 12
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de firebase/firebase-admin-dotnet
-
AbstractFirebaseAuth.cs has a typo (accound/account)Quizá libre de nuevo Un pull request para esta issue se cerró sin fusionarse. Abiertoneeds-triage
Dificultad 1/5 Menos de una hora Aptitud para principiantes 72/100
firebase/firebase-admin-dotnet#334 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 42/100
firebase/firebase-admin-dotnet#591 · 1 comentario · 1 reacción ·
Los mantenedores suelen responder en 1 día
-
GetProjectId returns null on Compute Engine / Cloud Run with application default credentialsPosiblemente ocupada @lahirumaramba la tomó hace 4 días. Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 78/100
firebase/firebase-admin-dotnet#588 ·
Los mantenedores suelen responder en 1 día
-
Sending FCM notification with Fids Return NotRegisteredQuizá libre de nuevo @yvonnep165 la tomó hace 81 días y no hay ningún pull request abierto. Abierto
firebase/firebase-admin-dotnet#534 · 5 comentarios · 1 reacción · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Sending MulticastMessage does not work after replacing Tokens with FidsQuizá libre de nuevo @Doris-Ge la tomó hace 109 días y no hay ningún pull request abierto. Abiertoapi: messaging
firebase/firebase-admin-dotnet#530 · 2 comentarios · 2 asignados ·
Los mantenedores suelen responder en 1 día
Todos los issues de firebase/firebase-admin-dotnet
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Facepunch/sbox-public#12305 ·
Los mantenedores suelen responder en 5 días
-
分享 JVC DVD+RW 4.7G (铼德代工) 实测标定预设Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
JiaFeiMiao-K-Cat/DiscImageStudio#205 ·
Los mantenedores suelen responder en 1 día
-
bug keep-fresh
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Flow-Launcher/Flow.Launcher#4744 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
flyingpie/windows-terminal-quake#419 ·
Los mantenedores suelen responder en 1 día
-
Show the per-model weekly limitAbiertoenhancement help wanted
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100