Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Refused to execute script because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled. #7412

Closed
jmelosegui opened this issue Apr 22, 2024 · 7 comments
Assignees

Comments

@jmelosegui
Copy link

Describe the bug
After deploying pgadmin4 to kubernetes. when I try to access the site, the spinning icon appears, but the page never finish loading.
When inspecting the console I find the following error:

Refused to execute script from 'http://my-url.com/login?next=%2Fbrowser%2F' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.

A clear and concise description of what the bug is.

To Reproduce

Steps to reproduce the behavior:

  1. Deploy pgadming to kubernetes using the following file:
apiVersion: apps/v1
kind: Deployment
metadata:
 name: pgadmin-deployment
spec:
 replicas: 1
 selector:
   matchLabels:
     app: pgadmin
 template:
   metadata:
     labels:
       app: pgadmin
   spec:
     containers:
     - name: pgadmin
       image: dpage/pgadmin4
       ports:
       - containerPort: 80
       env:
       - name: PGADMIN_DEFAULT_EMAIL
         value: "my-email@example.com"
       - name: PGADMIN_DEFAULT_PASSWORD
         value: "P@ssw0rd!"
---

apiVersion: v1
kind: Service
metadata:
 name: pgadmin-service
spec:
 selector:
   app: pgadmin
 ports:
   - protocol: TCP
     port: 8080
     targetPort: 80
 type: ClusterIP # Expose the service outside the cluster

---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
 name: pgadmin-ingress
spec:
 rules:
 - host: my-url.com
   http:
     paths:
     - path: /
       pathType: Prefix
       backend:
         service:
           name: pgadmin-service
           port:
             number: 8080  # Use the port exposed by your pgadmin-service
  1. Navigate to the URL defined in the ingress
  2. The page never loads. Open the console and see the error mentioned above.

Expected behavior

the page should load to allow the user to provide the credentials and login to the site.

Error message

Refused to execute script from 'http://my-url.com/login?next=%2Fbrowser%2F' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.
@jmelosegui jmelosegui added the Bug label Apr 22, 2024
@akshay-joshi
Copy link
Contributor

@jmelosegui

Can you please share the pgAdmin logs and screenshots of the Network tab of the browser using DevTools(inspect)?

@neutrino2211
Copy link

This is happening to me as well but in my case there is an extra error in the console

Error: Script error for "security.pages"
https://requirejs.org/docs/errors.html#scripterror
    at makeError (http://37.1.219.62:8888/static/vendor/require/require.min.js?ver=80500:9:1795)
    at HTMLScriptElement.onScriptError (http://37.1.219.62:8888/static/vendor/require/require.min.js?ver=80500:9:17095)

Here's the console screenshot

Screenshot 2024-04-28 at 14 53 59

And the logs screenshot

image


There is also a lot of inconsistency with the errors, sometimes the login page loads but you can't login and sometimes the error message is complaining about a different module.

@nickbendasg
Copy link

This is happening on my end as well. Attempting to deploy to Kubernetes cluster. Exact same error log

@adityatoshniwal
Copy link
Contributor

@RohitBhati8269 Can you please test this once?

@narendral590
Copy link

In which release it is going to be released?

@adityatoshniwal
Copy link
Contributor

In which release it is going to be released?

@jmelosegui has closed the issue. So it looks like it is working for him.

@narendral590
Copy link

I had the similar issue where and I am setting this for the first time with latest version/snapshot which was released 2 days ago. Please let me know if I need to use any specific version ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants