Closed bantyK closed 6 months ago
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.
Thanks @frouioui ! Would you mind sharing where you see the Origin
being set, and the network request if you have it available? 🙏
Ok, I was able to recreate on my new m2 laptop 😄 Might have something to do with capitalization:
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"
Good news is that after normalizing the hostnames in the start up scripts, this works fine now:
This should be fixed now that https://github.com/vitessio/vitess/pull/15839 is merged. It's backported to 19 and 18 as well. Please let us know if you run into anymore issues @bantyK
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.
@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?
hi @notfelineit I had to do a fresh install and now its working. Thank you for fixing this. :)
@bantyK yay that's great! 🥳
Overview of the Issue
Upon following all the steps mention in Local install via source in mac, after running the script
./101_initial_cluster.sh
script the command output in the terminal shows all steps being run successfully but the vtadmin UI portal shows no data. Keyspace, cluster, schema etc all show "No result".The script output is shown below
Underlying database is created as shown in the screenshot below.
Vtadmin shows no data
Create keyspace page also shows error
Further more the last step in the document asks to run the command
source ../common/env.sh
does not work in mac and fails with the error../common/env.sh:83: command not found: shopt
Reproduction Steps
Go to this link: https://vitess.io/docs/19.0/get-started/local-mac/ Do a clean installation. Run the last 101_initial_cluster.sh Open the vtadmin portal via http://:14200/api/clusters (this is the URL given by the 101_initial_cluster.sh script
Observe the count of keyspaces, Gates, Clusters etc. They will all be 0
Binary Version
Operating System and Environment details
Log Fragments
No response