lxd-webgui
lxd-webgui copied to clipboard
Couldn't get config but API access Ok
Hello,
so I have setup the web server with its certificate and a certificate for my browser (on my Mac). LXD and lxd-webgui are on the same server. I still get the "couldn't get config from..." but I can access the LXD API trough my browser.
Lxd config :
config: core.https_address: 10.3.12.1:8443 core.https_allowed_credentials: "true" core.https_allowed_headers: Origin, X-Requested-With, Content-Type, Accept core.https_allowed_methods: GET, POST, PUT, DELETE, OPTIONS core.https_allowed_origin: '*' core.trust_password: true
I have put the lxd server on debug mode also but no error except a warning for my Mac IP address. See the 2 screenshots enclosed for details maybe.
Thanks
hello
i have the same problem, this is from https://localhost:9000/
{"type":"sync","status":"Success","status_code":200,"operation":"","error_code":0,"error":"","metadata":["/1.0"]}
I have same problem too on Ubuntu 14.04. Please help.
Same here, maybe I should have looked here first at the unanswered post going back to may.
Sorry, other projects had higher priority than this one. Will look into it the next few days.
Ok guys, can you try to specify the allowed IP addresses, instead of using "*"?
$ sudo lxc config set core.https_allowed_origin <your_ip_addess>
Maybe <your_ip_address> is 127.0.0.1, or your real internal ip (192.168....).
I am in the same situation. Here is my lxc config: config: core.https_address: 0.0.0.0:9000 core.https_allowed_credentials: "true" core.https_allowed_headers: Origin, X-Requested-With, Content-Type, Accept core.https_allowed_methods: GET, POST, PUT, DELETE, OPTIONS core.https_allowed_origin: 10.1.0.10 core.trust_password: true I've tried the following settings for core.https_allowed_origin: https://localhost:8000 https://0.0.0.0:8000 https://10.1.0.10:8000 (Server IP address) https://10.1.0.86:8000 (Remote PC IP address accessing WEBGUI) "*" All of these setting result in the same "Could not get config from server: https://localhost:9000" error. Any assistance would be appreciated. I rebuilt the Ubuntu 16.04 server and followed the following guide to install lxd: https://linuxcontainers.org/lxd/getting-started-cli/
I can access the API at the following URL: http://10.1.0.10:9000 and I receive the following response: {"type":"sync","status":"Success","status_code":200,"operation":"","error_code":0,"error":"","metadata":["/1.0"]}
I am running the web server using the following command: http-server -S -a 0.0.0.0 -p 8000
Any assistance would be greatly appreciated. I cannot find any errors in the lxd.log and nothing in journalctl -xe. Are there any other places to look for errors?
Thanks in advance.
Thanks a lot. I was initially unable to make lxd-webgui work too (again...). but after some hours of debugging:
There are a variety of problems here:
- The LXD version of Ubuntu 16.04 does not support the "core.https_allowed_credentials", which is pretty important
- Chrome will use "localhost:8000" as origin
- While Firefox will use "127.0.0.1:8000" as origin
- Firefox will not send its client certificate on XHR requests if "with-credentials" in not specified in the ajax request (therefore depends on the allowed_credentials response header)
So i got it to work on Ubuntu 16.04 with:
- Chrome
- core.https_allowed_origin "https://localhost:8000"
- "send XHRs with credentials" DISABLED
CC #42, #39, #36
For further reference: Debugging involves using F12 "Console" to see Cross-Origin request error, "Network" to see actual requests and HTTP headers, and starting LXD with the following command line:
/usr/bin/lxd --group lxd --logfile=/var/log/lxd/lxd.log --debug --verbose
I got it working in firefox by setting:
core.https_allowed_origin "https://127.0.0.1:8000"
as firefox doesn't send localhost