Pode ser algo no servidor se sim, o que pode ser ?
Porque em homologação funciona.
Lucas_Camara1 like
Em outro ambiente funciona com arquivos acima de 1MB então?
Estava dando uma lida aqui para ver se encontrava algo, mas parece que está certo sua configuração. Vc usa o tomcat para subir o projeto? E qual a versão do spring-boot?
Eita, então esse erro soh acontece no ambiente de produção? Quando vc roda local, funciona?
guilhermebhte
Local e ambiente de homologação funcionam
Lucas_Camara1 like
Acho que tu pode colocar um log no endpoint que imprima todos os headers da requisição que estão chegando. E também investigar se realmente as propriedades de multipart que aumentam o limite do upload estão realmente sendo aplicadas em produção (tu consegue imprimir elas no log usando o @Value).
guilhermebhte
Como consigo imprimir estes logs ?
A requisição não chega nem no endpoint, entendo que o cors não deixa.
guilhermebhte1 like
Pelo que entendi as configurações para o spring 2.3.5, deve ser estas, no properties
2021-12-1309:38:37[http-nio-9103-exec-1]INFO-b.c.g.g.crud.config.SmpleCORSFilter-nextHeaderName:x-forwarded-for2021-12-1309:38:37[http-nio-9103-exec-1]INFO-b.c.g.g.crud.config.SmpleCORSFilter-headerValue:191.185.125.2152021-12-1309:38:37[http-nio-9103-exec-1]INFO-b.c.g.g.crud.config.SmpleCORSFilter-nextHeaderName:host2021-12-1309:38:37[http-nio-9103-exec-1]INFO-b.c.g.g.crud.config.SmpleCORSFilter-headerValue:xxxxxx2021-12-1309:38:37[http-nio-9103-exec-1]INFO-b.c.g.g.crud.config.SmpleCORSFilter-nextHeaderName:connection2021-12-1309:38:37[http-nio-9103-exec-1]INFO-b.c.g.g.crud.config.SmpleCORSFilter-headerValue:close2021-12-1309:38:37[http-nio-9103-exec-1]INFO-b.c.g.g.crud.config.SmpleCORSFilter-nextHeaderName:content-length2021-12-1309:38:37[http-nio-9103-exec-1]INFO-b.c.g.g.crud.config.SmpleCORSFilter-headerValue:[telefoneremovido]-12-1309:38:37[http-nio-9103-exec-1]INFO-b.c.g.g.crud.config.SmpleCORSFilter-nextHeaderName:sec-ch-ua2021-12-1309:38:37[http-nio-9103-exec-1]INFO-b.c.g.g.crud.config.SmpleCORSFilter-headerValue:" Not A;Brand";v="99","Chromium";v="96","Google Chrome";v="96"2021-12-1309:38:37[http-nio-9103-exec-1]INFO-b.c.g.g.crud.config.SmpleCORSFilter-nextHeaderName:accept2021-12-1309:38:37[http-nio-9103-exec-1]INFO-b.c.g.g.crud.config.SmpleCORSFilter-headerValue:application/json,text/plain,*/*2021-12-13 09:38:37 [http-nio-9103-exec-1] INFO - b.c.g.g.crud.config.SmpleCORSFilter - nextHeaderName: content-type2021-12-13 09:38:37 [http-nio-9103-exec-1] INFO - b.c.g.g.crud.config.SmpleCORSFilter - headerValue: multipart/form-data; boundary=----WebKitFormBoundaryBG5jKKXk4qGIDqYQ2021-12-13 09:38:37 [http-nio-9103-exec-1] INFO - b.c.g.g.crud.config.SmpleCORSFilter - nextHeaderName: authorization2021-12-13 09:38:37 [http-nio-9103-exec-1] INFO - b.c.g.g.crud.config.SmpleCORSFilter - headerValue: bearer 9e02166b-5c74-45ec-83be-9b4004029f752021-12-13 09:38:37 [http-nio-9103-exec-1] INFO - b.c.g.g.crud.config.SmpleCORSFilter - nextHeaderName: sec-ch-ua-mobile2021-12-13 09:38:37 [http-nio-9103-exec-1] INFO - b.c.g.g.crud.config.SmpleCORSFilter - headerValue: ?02021-12-13 09:38:37 [http-nio-9103-exec-1] INFO - b.c.g.g.crud.config.SmpleCORSFilter - nextHeaderName: user-agent2021-12-13 09:38:37 [http-nio-9103-exec-1] INFO - b.c.g.g.crud.config.SmpleCORSFilter - headerValue: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.93 Safari/537.362021-12-13 09:38:37 [http-nio-9103-exec-1] INFO - b.c.g.g.crud.config.SmpleCORSFilter - nextHeaderName: sec-ch-ua-platform2021-12-13 09:38:37 [http-nio-9103-exec-1] INFO - b.c.g.g.crud.config.SmpleCORSFilter - headerValue: "Windows"2021-12-13 09:38:37 [http-nio-9103-exec-1] INFO - b.c.g.g.crud.config.SmpleCORSFilter - nextHeaderName: origin2021-12-13 09:38:37 [http-nio-9103-exec-1] INFO - b.c.g.g.crud.config.SmpleCORSFilter - headerValue: 2021-12-13 09:38:37 [http-nio-9103-exec-1] INFO - b.c.g.g.crud.config.SmpleCORSFilter - nextHeaderName: sec-fetch-site2021-12-13 09:38:37 [http-nio-9103-exec-1] INFO - b.c.g.g.crud.config.SmpleCORSFilter - headerValue: same-site2021-12-13 09:38:37 [http-nio-9103-exec-1] INFO - b.c.g.g.crud.config.SmpleCORSFilter - nextHeaderName: sec-fetch-mode2021-12-13 09:38:37 [http-nio-9103-exec-1] INFO - b.c.g.g.crud.config.SmpleCORSFilter - headerValue: cors2021-12-13 09:38:37 [http-nio-9103-exec-1] INFO - b.c.g.g.crud.config.SmpleCORSFilter - nextHeaderName: sec-fetch-dest2021-12-13 09:38:37 [http-nio-9103-exec-1] INFO - b.c.g.g.crud.config.SmpleCORSFilter - headerValue: empty2021-12-13 09:38:37 [http-nio-9103-exec-1] INFO - b.c.g.g.crud.config.SmpleCORSFilter - nextHeaderName: referer2021-12-13 09:38:37 [http-nio-9103-exec-1] INFO - b.c.g.g.crud.config.SmpleCORSFilter - headerValue: https://app.movimentoneem.life/2021-12-13 09:38:37 [http-nio-9103-exec-1] INFO - b.c.g.g.crud.config.SmpleCORSFilter - nextHeaderName: accept-encoding2021-12-13 09:38:37 [http-nio-9103-exec-1] INFO - b.c.g.g.crud.config.SmpleCORSFilter - headerValue: gzip, deflate, br2021-12-13 09:38:37 [http-nio-9103-exec-1] INFO - b.c.g.g.crud.config.SmpleCORSFilter - nextHeaderName: accept-language2021-12-13 09:38:37 [http-nio-9103-exec-1] INFO - b.c.g.g.crud.config.SmpleCORSFilter - headerValue: pt-BR,pt;q=0.9,en-US;q=0.8,en;q=0.7,fr;q=0.6
guilhermebhte
Quando o arquivo é maior que 1 Mega, não chega no servidor nem no cors, poir não imprimi log
guilhermebhte
spring.servlet.multipart.max-file-size = 1MB # Tamanho máximo do arquivo. Os valores podem usar os sufixos “MB” ou “KB” para indicar megabytes ou kilobytes, respectivamente.
spring.servlet.multipart.max-request-size = 10MB # Tamanho máximo da solicitação. Os valores podem usar os sufixos “MB” ou “KB” para indicar megabytes ou kilobytes, respectivamente.
Estou achando bem estranho isso, de não estar funcionando
Lucas_Camara1 like
Rapaiz, deve ter alguma camada em produção que está barrando requisições grandes, como um proxy, por exemplo.
guilhermebhte1 like
Estou olhando com a infra
G
Solucao aceita
gbuenoo1 like
Você usa Nginx como Load Balancer/Reverse Proxy/etc ?
Se sim, por default o tamanho maximo de um arquivo importado é de 1MB.