Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

182
Visualizações
Strapi CMS Get Bad Request when starting Admin Panel

i have a really strange behavour. I dockerized my Strapi CMS App and everything worked fine until a few days ago. Now i cannot start the application without getting the following error on loading:

In console:

[2022-04-25 11:40:11.922] error: Malicious Path BadRequestError: Malicious Path
at resolvePath (MY_PATH/backend/node_modules/resolve-path/index.js:78:11)

In Browser:

enter image description here

It calls the following URL:

http://0.0.0.0:1337//admin/init

I noticed the // after the port. When i curl http://0.0.0.0:1337/admin/init i get the following response:

{"data":{"uuid":"SOME_UUID","hasAdmin":true}}

But that doesnt help me.

This is my server.js:

  module.exports = ({ env }) => ({
  host: env('HOST'),
  port: env.int('BACKEND_PORT'),
  //url: env("PUBLIC_URL"),
  app: {
    keys: env.array('APP_KEYS'),
  },
});

In my .env file is set the following:

HOST=localhost 
BACKEND_PORT=1337

It would be awesome if anyone could help me, i am stuck with this problem for a few days. :/ Thank you!

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

After testing a loooot of stuff i was really with my latin at the end, like we germans like to say for "i have absolutely no idea what is going on here". So at some point i thought this was a bug within strapi. After heavy weird "hooking into my node_modules and editing urls their" i realized, that when i use docker-compose to spin up my containers there is some kind of cache even if i rebuild the images.

So i started docker compose with:

docker-compose up --build -d

So turned out a few days ago i added a backslash to the STRAPI_ADMIN_BACKEND_URL and/or PUBLIC_URL environment variable and this was some kind of cached the whole time..

So if you have the same problem, make sure that your .env file inside your docker container is correct and do compose with the --build flag to make sure everything is builded new until you fixed your bug. You can also exec -it into the container als check with nano how the .env file looks.

Hope this saves someone some time.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda