AWS Lambda detection never matches because the environment variable name has a trailing space
Mantenedores costumam responder em até 6 dias
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 2/5
- Tempo estimado
- 1-3 horas
- Facilidade para iniciantes
- 76/100
Direção de pesquisa
Comece em src/Exceptionless/Extensions/ExceptionlessConfigurationExtensions.cs, em ReadFromEnvironmentalVariables(), e inspecione a busca de GetEnvironmentalVariable. Remova o espaço no final do nome da variável do AWS Lambda e adicione testes para as variáveis do AWS e do Azure Functions. Execute os testes de configuração relevantes; o trabalho estará concluído quando a variável do AWS habilitar ProcessQueueOnCompletedRequest por padrão, seguindo o comportamento do Azure.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
In Exceptionless 6.2.0 (core Exceptionless package), ReadFromEnvironmentalVariables() is meant to turn on ProcessQueueOnCompletedRequest automatically when running in AWS Lambda, but it looks up "AWS_LAMBDA_FUNCTION_NAME " (with a trailing space). No such variable exists, so the Lambda check never fires.
Where
- https://github.com/exceptionless/Exceptionless.Net/blob/5792f00d175f94a35fe0559c8e9999234a8163be/src/Exceptionless/Extensions/ExceptionlessConfigurationExtensions.cs#L496-L506 (the check is on line 500)
- https://github.com/exceptionless/Exceptionless.Net/blob/5792f00d175f94a35fe0559c8e9999234a8163be/src/Exceptionless/Extensions/ExceptionlessConfigurationExtensions.cs#L518-L535 (
GetEnvironmentalVariabledoes an exact, untrimmed key lookup)
What happens
On AWS Lambda, AWS_LAMBDA_FUNCTION_NAME is set, but the lookup is for AWS_LAMBDA_FUNCTION_NAME , so it returns null. ProcessQueueOnCompletedRequest stays false unless the app sets it explicitly, and the ASP.NET Core middleware does not flush the queue at the end of each request. Lambda freezes the process after the response is sent, so queued events can sit unsent until a later invocation, or be lost when the environment is recycled (see #215 for the original report of this behavior). The Azure Functions check on the next line (FUNCTIONS_WORKER_RUNTIME) works because it has no trailing space.
Expected
When AWS_LAMBDA_FUNCTION_NAME is set and Exceptionless:ProcessQueueOnCompletedRequest is not configured, ProcessQueueOnCompletedRequest is set to true, the same as on Azure Functions.
Steps to reproduce
- Set the environment variable
AWS_LAMBDA_FUNCTION_NAME=testand do not setExceptionless__ProcessQueueOnCompletedRequest. - Create a client and call
client.Configuration.ReadFromEnvironmentalVariables()(orclient.Startup()). client.Configuration.ProcessQueueOnCompletedRequestisfalse. Repeat withFUNCTIONS_WORKER_RUNTIME=dotnetand it istrue.
Suggested fix
Remove the trailing space: GetEnvironmentalVariable("AWS_LAMBDA_FUNCTION_NAME"), and add a test that covers both serverless variables.
- Linguagem predominante
- C#
- Estrelas
- 573
- Forks
- 143
- Merge médio
- 5d 9h
- PRs com merge (30d)
- 1
Preparar o ambiente
Inicia o contêiner de desenvolvimento do projeto no navegador, com a sua própria conta do GitHub.
- Sem Dockerfile nem arquivo Docker Compose
- Sem modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de exceptionless/Exceptionless.Net
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 86/100
exceptionless/Exceptionless.Net#391 ·
Mantenedores costumam responder em até 6 dias
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
exceptionless/Exceptionless.Net#390 ·
Mantenedores costumam responder em até 6 dias
-
bug
Dificuldade 1/5 1-3 horas Facilidade para iniciantes 88/100
exceptionless/Exceptionless.Net#387 ·
Mantenedores costumam responder em até 6 dias
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 35/100
exceptionless/Exceptionless.Net#389 ·
Mantenedores costumam responder em até 6 dias
-
bug
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 72/100
exceptionless/Exceptionless.Net#388 ·
Mantenedores costumam responder em até 6 dias
Todas as issues de exceptionless/Exceptionless.Net
Issues semelhantes
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 74/100
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
Mantenedores costumam responder em até 1 dia
-
[Bug] Dashboard renders attachment links that resolve to 404 when the FILES binding is absentAbertabug 優先: 低
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
Mantenedores costumam responder em até 1 dia
-
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 92/100
-
.NET area: storage bug good first issue
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
Larson-Logan/medal-sync#61 ·
Mantenedores costumam responder em até 1 dia