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 [BUG]Blocked a frame with origin "http://127.0.0.1:5000" from accessing a cross-origin frame. #6434 [BUG]Blocked a frame with origin "http://127.0.0.1:5000" from accessing a cross-origin frame. #6434 Euraxluo opened this issue Aug 10, 2022 · 4 comments

Willingness to contribute

Yes. I would be willing to contribute a fix for this bug with guidance from the MLflow community.

MLflow version

1.27.0

System information

  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04) : windows
  • Python version : python3.9
  • yarn version, if running the dev UI :
  • Describe the problem

    AppErrorBoundary.js:19 DOMException: Blocked a frame with origin " http://127.0.0.1:5000 " from accessing a cross-origin frame.
    at Function.value ( http://127.0.0.1:5000/static-files/static/js/main.97f0d444.js:2:4837071 )
    at n.value ( http://127.0.0.1:5000/static-files/static/js/main.97f0d444.js:2:6358085 )
    at vs ( http://127.0.0.1:5000/static-files/static/js/main.97f0d444.js:2:2610200 )
    at Dl ( http://127.0.0.1:5000/static-files/static/js/main.97f0d444.js:2:2627080 )
    at t.unstable_runWithPriority ( http://127.0.0.1:5000/static-files/static/js/main.97f0d444.js:2:3481594 )
    at Ko ( http://127.0.0.1:5000/static-files/static/js/main.97f0d444.js:2:2568947 )
    at Nl ( http://127.0.0.1:5000/static-files/static/js/main.97f0d444.js:2:2623815 )
    at bl ( http://127.0.0.1:5000/static-files/static/js/main.97f0d444.js:2:2619901 )
    at http://127.0.0.1:5000/static-files/static/js/main.97f0d444.js:2:2569170
    at t.unstable_runWithPriority ( http://127.0.0.1:5000/static-files/static/js/main.97f0d444.js:2:3481594 ) Object

    Steps to reproduce the bug

  • mlflow ui
  • open index.html:
    all code:
  • <!DOCTYPE html>
    <html lang="en">
       <meta charset="UTF-8">
       <title>Title</title>
    </head>
    <iframe src="http://127.0.0.1:5000/", height="1920", width="1080"></iframe>
    </body>
    </html>

    Code to generate data required to reproduce the bug

    Is the console panel in DevTools showing errors relevant to the bug?

    react-dom.production.min.js:216 DOMException: Blocked a frame with origin " http://127.0.0.1:5000 " from accessing a cross-origin frame.
    at Function.value ( http://127.0.0.1:5000/static-files/static/js/main.97f0d444.js:2:4837071 )
    at n.value ( http://127.0.0.1:5000/static-files/static/js/main.97f0d444.js:2:6358085 )
    at vs ( http://127.0.0.1:5000/static-files/static/js/main.97f0d444.js:2:2610200 )
    at Dl ( http://127.0.0.1:5000/static-files/static/js/main.97f0d444.js:2:2627080 )
    at t.unstable_runWithPriority ( http://127.0.0.1:5000/static-files/static/js/main.97f0d444.js:2:3481594 )
    at Ko ( http://127.0.0.1:5000/static-files/static/js/main.97f0d444.js:2:2568947 )
    at Nl ( http://127.0.0.1:5000/static-files/static/js/main.97f0d444.js:2:2623815 )
    at bl ( http://127.0.0.1:5000/static-files/static/js/main.97f0d444.js:2:2619901 )
    at http://127.0.0.1:5000/static-files/static/js/main.97f0d444.js:2:2569170
    at t.unstable_runWithPriority ( http://127.0.0.1:5000/static-files/static/js/main.97f0d444.js:2:3481594 )
    cs @ react-dom.production.min.js:216
    AppErrorBoundary.js:19 DOMException: Blocked a frame with origin " http://127.0.0.1:5000 " from accessing a cross-origin frame.
    at Function.value ( http://127.0.0.1:5000/static-files/static/js/main.97f0d444.js:2:4837071 )
    at n.value ( http://127.0.0.1:5000/static-files/static/js/main.97f0d444.js:2:6358085 )
    at vs ( http://127.0.0.1:5000/static-files/static/js/main.97f0d444.js:2:2610200 )
    at Dl ( http://127.0.0.1:5000/static-files/static/js/main.97f0d444.js:2:2627080 )
    at t.unstable_runWithPriority ( http://127.0.0.1:5000/static-files/static/js/main.97f0d444.js:2:3481594 )
    at Ko ( http://127.0.0.1:5000/static-files/static/js/main.97f0d444.js:2:2568947 )
    at Nl ( http://127.0.0.1:5000/static-files/static/js/main.97f0d444.js:2:2623815 )
    at bl ( http://127.0.0.1:5000/static-files/static/js/main.97f0d444.js:2:2619901 )
    at http://127.0.0.1:5000/static-files/static/js/main.97f0d444.js:2:2569170
    at t.unstable_runWithPriority ( http://127.0.0.1:5000/static-files/static/js/main.97f0d444.js:2:3481594 ) Object

    Does the network panel in DevTools contain failed requests relevant to the bug?

    @Euraxluo Can you share how you solved the cross-domain problem in this case, specifically?

    If you're referencing the problem with cors running mlflow behind a k8's nginx ingress controller with networking.k8s.io/v1 .

    Adding the annotation nginx.ingress.kubernetes.io/enable-cors: "true" seems to get around the cors issue with serving static files. Additional annotations might be needed if the defaults this turns on don't work for you.

    https://github.com/kubernetes/ingress-nginx/blob/main/docs/user-guide/nginx-configuration/annotations.md#enable-cors