Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

MIME type ('text/html') is not executable, #8423

Open
FreddieOnly opened this issue Feb 5, 2025 · 5 comments
Open

MIME type ('text/html') is not executable, #8423

FreddieOnly opened this issue Feb 5, 2025 · 5 comments
Assignees

Comments

@FreddieOnly
Copy link

On a Synology 1821 with the newest DSM I am running several containers behind traefik and crowdsec. Now I try to get pgadmin running,also with the help of CHAT GPT, but with no success. I receive the following error messages:
Refused to execute script from 'https://pgadmin.bfg-ott.de/#?next=/browser/' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled. The result on the log in page I see the circle rotating. When I try to access pgadmin via Host Ip and Port, it is no problem. I am happy to receive idears to solve the problem.

Here is what chrome dev tools expose: Arguments [Error: Script error for "security.pages"
https://requirejs.org/docs/errors.html#scripterror
at …, callee: ƒ, Symbol(Symbol.iterator): ƒ]
0
:
Error: Script error for "security.pages" https://requirejs.org/docs/errors.html#scripterror at makeError (https://pgadmin.bfg-ott.de/static/vendor/require/require.min.js?ver=81400:9:1795) at HTMLScriptElement.onScriptError (https://pgadmin.bfg-ott.de/static/vendor/require/require.min.js?ver=81400:9:17095)
originalError
:
Event {isTrusted: true, type: 'error', target: script, currentTarget: null, eventPhase: 0, …}
requireModules
:
['security.pages']
requireType
:
"scripterror"
message
:
"Script error for "security.pages"\nhttps://requirejs.org/docs/errors.html#scripterror"
stack
:
"Error: Script error for "security.pages"\nhttps://requirejs.org/docs/errors.html#scripterror\n at makeError (https://pgadmin.bfg-ott.de/static/vendor/require/require.min.js?ver=81400:9:1795)\n at HTMLScriptElement.onScriptError (https://pgadmin.bfg-ott.de/static/vendor/require/require.min.js?ver=81400:9:17095)"
[[Prototype]]
:
Object
callee
:
ƒ ()
length
:
1
Symbol(Symbol.iterator)
:
ƒ values()
[[Prototype]]
:
Object

I am looking forward to a solution. Thank you in advance!

@FreddieOnly
Copy link
Author

After trying to log in I receive the following error message on the screen:

Image

@adityatoshniwal
Copy link
Contributor

Hi @FreddieOnly,

  1. Pleas share the traefik config for the MIME type ('text/html') issue.
  2. For unlocking the account, either you can open the pgAdmin.db and update the table or remove it completely. If you remove the file, then you'll lose all your server config. If you're not using persistent volumes for pgAdmin containers then you can simply restart the instance.

Thanks.

@FreddieOnly
Copy link
Author

As requested here is the traefik config file
global:
checkNewVersion: true
sendAnonymousUsage: false

log:
level: debug
format: json
filePath: /var/log/traefik/traefik.log
accessLog:
filePath: /var/log/traefik/access.log

api:
dashboard: true
insecure: true
debug: false

entryPoints:
web:
address: :80
http:
middlewares:
- crowdsec-bouncer@file
redirections:
entryPoint:
to: websecure
scheme: https
websecure:
address: :443
http:
middlewares:
- crowdsec-bouncer@file

http:
routers:
directus:
rule: "Host(xxxxxxxx.xxx-ott.de)"
entrypoints: "websecure"
service: "xxxxxx"
tls:
certresolver: "cloudflare"

services:
directus:
loadBalancer:
servers:
- url: "http://172.20.0.9:8055"

certificatesResolvers:
cloudflare:
acme:
email: example.@example.com
# For testing un-comment the following line:
# caServer: https://acme-v02.api.letsencrypt.org/directory
# keyType: EC256
# For testing:
# storage: /etc/traefik/certs/cloudflare-test.json
# For production:
storage: /etc/traefik/certs/cloudflare-acme.json
dnsChallenge:
provider: cloudflare
resolvers:
- "1.1.1.1:53"
- "1.0.0.1:53"

serversTransport:
insecureSkipVerify: true

providers:
docker:
exposedByDefault: false
endpoint: 'unix:///var/run/docker.sock'
watch: true
# swarmMode: false # Not needed any longer in v. 3
file:
directory: /etc/traefik/conf/
watch: true

@yogeshmahajan-1903
Copy link
Contributor

@FreddieOnly
Kindly share yaml file for checking Mime type issue and are you able to login?

@FreddieOnly
Copy link
Author

Dear Yogeshmahajan, thank you for reminding me!. Yes, i can log in, but only via local ip adress.
Here comes the yaml file—pw changed:
version: '3'

services:
pgadmin:
image: dpage/pgadmin4
container_name: pgadmin
environment:
PGADMIN_DEFAULT_EMAIL: example@gmail.com
PGADMIN_DEFAULT_PASSWORD: "blablablae" # Change this to a strong password
# PGADMIN_CONFIG_SERVER_MODE: false
# PGADMIN_CONFIG_PATH: /pgadmin4
PGADMIN_LISTEN_PORT: 80
PGADMIN_LISTEN_ADDRESS: 0.0.0.0
#PGADMIN_CONFIG_COOKIE_DOMAIN: .pgadmin.bla.de
# PGADMIN_CONFIG_COOKIE_SECURE: True
ports:
- 5050:80
volumes:
- /volume1/docker/pgadmin/data:/var/lib/pgadmin
- ./config_local.py:/pgadmin4/config_local.py:ro
- ./base.html:/pgadmin4/pgadmin/templates/base.html:ro

labels:
  - traefik.enable=true
  # HTTP router
  - traefik.http.routers.pgadmin-http.entrypoints=web
  - traefik.http.routers.pgadmin-http.rule=Host(`example.de`)
  - traefik.http.routers.pgadmin-http.service=pgadmin
  # HTTPS router
  - traefik.http.routers.pgadmin-https.entrypoints=websecure
  - traefik.http.routers.pgadmin-https.rule=Host(`example.de`)
  - traefik.http.routers.pgadmin-https.tls=true
  - traefik.http.routers.pgadmin-https.tls.certresolver=cloudflare
  # Service configuration: point to pgAdmin's internal port
  - traefik.http.services.pgadmin.loadbalancer.server.port=80
networks:
  - proxy

volumes:
pgadmin-data:

networks:
proxy:
external: true

I am looking forward hearing from you

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

3 participants