GithubHelp home page GithubHelp logo

Comments (9)

frouioui avatar frouioui commented on July 20, 2024

To add to this issue, when reproducing the steps in the consol we can see that API requests are blocked by CORS as seen in the log below (visible in the web consol). This issue happens even though we use the URL printed by the 101 script and also when going on localhost. The --http-origin flag on the vtadmin-api side seems to be set correctly according to the log, however in the request header when calling the API the field Origin is set to localhost (instead of http://Florents-MacBook-Pro-2.local in my case).

Access to fetch at 'http://florents-macbook-pro-2.local:14200/api/vtctlds' from origin 'http://florents-macbook-pro-2.local:14201' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

from vitess.

notfelineit avatar notfelineit commented on July 20, 2024

Thanks @frouioui ! Would you mind sharing where you see the Origin being set, and the network request if you have it available? 🙏

from vitess.

notfelineit avatar notfelineit commented on July 20, 2024

Ok, I was able to recreate on my new m2 laptop 😄 Might have something to do with capitalization:
Screenshot 2024-05-03 at 2 12 53 PM
Screenshot 2024-05-03 at 2 12 40 PM

snippet from my startup script:

vtadmin-api expects vtadmin-web at, and set http-origin to "http://Francess-MacBook-Pro.local:14201"
vtadmin-api is running!
  - API: http://Francess-MacBook-Pro.local:14200
  - Logs: /Users/francesthai/planetscale/vitess/examples/local/vtdataroot/tmp/vtadmin-api.out
  - PID: 13404

Building vtadmin-web...
~/planetscale/vitess ~/planetscale/vitess/examples/local
~/planetscale/vitess/examples/local

Installing nvm...

nvm is already installed!

Configuring Node.js 20.12.2

v20.12.2 is already installed.
Now using node v20.12.2 (npm v10.7.0)

Setting VITE_VTADMIN_API_ADDRESS to "http://Francess-MacBook-Pro.local:14200"

from vitess.

notfelineit avatar notfelineit commented on July 20, 2024

Good news is that after normalizing the hostnames in the start up scripts, this works fine now:
Screenshot 2024-05-03 at 2 28 03 PM

from #15839

from vitess.

notfelineit avatar notfelineit commented on July 20, 2024

This should be fixed now that #15839 is merged. It's backported to 19 and 18 as well. Please let us know if you run into anymore issues @bantyK

from vitess.

bantyK avatar bantyK commented on July 20, 2024

I am sorry folks, but still the same issue. I took the latest pull on main for version 19 and ran the 101_initial_cluster script.
Screenshot 2024-05-07 at 9 36 46 PM

from vitess.

notfelineit avatar notfelineit commented on July 20, 2024

@bantyK can you share your output from running ./101_initial_cluster.sh as well as the request body of one of those CORS errors in your network tab?

from vitess.

bantyK avatar bantyK commented on July 20, 2024

hi @notfelineit I had to do a fresh install and now its working. Thank you for fixing this. :)

from vitess.

notfelineit avatar notfelineit commented on July 20, 2024

@bantyK yay that's great! 🥳

from vitess.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.