Giter Site home page Giter Site logo

canonical / lxd-demo-server Goto Github PK

View Code? Open in Web Editor NEW
74.0 19.0 26.0 263 KB

The LXD demo server

Home Page: https://linuxcontainers.org/lxd/try-it

License: Apache License 2.0

Go 15.56% Shell 0.16% Smarty 0.51% CSS 1.83% HTML 3.71% JavaScript 78.22%
lxd go containers demo

lxd-demo-server's Introduction

LXD demo server

This repository contains the backend code of the LXD online demo service.

https://linuxcontainers.org/lxd/try-it

What is it

Simply put, it's a small Go daemon exposing a REST API that users (mostly our javascript client) can interact with to create temporary test containers and attach to that container's console.

Those containers come with a bunch of resource limitations and an expiry, when the container expires, it's automatically deleted.

The main client can be found at the URL above, with its source available here:
https://github.com/lxc/linuxcontainers.org

Installing on Ubuntu

The easiest way to get the demo server running on Ubuntu is by using the snap package.

First install and configure LXD itself:

sudo snap install lxd
sudo lxd init

Then install and configure the LXD demo server:

sudo snap install lxd-demo-server
sudo snap connect lxd-demo-server:lxd lxd:lxd
sudo lxd-demo-server.configure

You can then access the server at: http://IP-ADDRESS:8080/

Dependencies

The server needs to be able to talk to a LXD daemon over the local unix socket, so you need to have a LXD daemon installed and functional before using this server.

Other than that, you can pull all the other necessary dependencies with:

go get github.com/lxc/lxd-demo-server

Building it

A very simple:

go build

Should do the trick.

Running it

To run your own, you should start by copying the example configuration file "lxd-demo.yaml.example" to "lxd-demo.yaml", then update its content according to your environment.

You will either need a container to copy for every request or a container image to use, set that up and set the appropriate configuration key.

Once done, simply run the daemon with:

./lxd-demo-server

The daemon isn't verbose at all, in fact it will only log critical LXD errors.

You can test things with:

curl http://localhost:8080/1.0
curl http://localhost:8080/1.0/terms

The server monitors the current directory for changes to its configuration file. It will automatically reload the configuration after it's changed.

Bug reports

Bug reports can be filed at https://github.com/lxc/lxd-demo-server/issues/new

Contributing

Fixes and new features are greatly appreciated but please read our contributing guidelines first.

Contributions to this project should be sent as pull requests on github.

Support and discussions

We use the LXC mailing-lists for developer and user discussions, you can find and subscribe to those at: https://lists.linuxcontainers.org

If you prefer live discussions, some of us also hang out in #lxcontainers on irc.freenode.net.

lxd-demo-server's People

Contributors

rsommer avatar stgraber avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

lxd-demo-server's Issues

Exposing container port

If I understand correctly, the way this works is that there is a go server that has access to the LXD daemon and can therefore spawn containers. It exposes the console output of a container through /1.0/console, and if server_console_only is false, it exposes an ssh server.

Also, it seems like there is an id (which is really a random string) required to access a container. So if I know the id of all the containers, I can basically access them remotely. Which is considered good enough for this use-case.

Assuming that this is not completely wrong, there is a thing I don't get: how does the SSH thing work (server_console_only=false)? How does the remote client connect to it? Wouldn't there be a need for a reverse proxy somewhere, translating <server_ip>:22 to <local_server_ip>:<exposed_container_ssh_port>?

I'm interested in that because I would like to try exposing a port for my demo. So that users could have a remote terminal into my container, and at the same time they could connect a separate RPC client to that same container.

It seems that with lxd, I should be able to expose a port with something like:

lxc config device add c1 proxy0 listen=tcp:127.0.0.1:80 connect=tcp:127.0.0.1:8080

So I'm trying to figure out the reverse proxy issue (mentioned above) and also how rest.go would need to be modified in order to run the proxy config line above when creating a container.

Getting errors while runing go build

$ go build
_/home/dilip/lxd-demo-server
./db.go:158: undefined: sqlite3 in sqlite3.ErrLocked
./db.go:158: undefined: sqlite3 in sqlite3.ErrBusy
please can you explain me why this error happens?

502 proxy error

Hello.
When i try to access https://linuxcontainers.org/lxd/try-it i receive this error:

Proxy Error
The proxy server received an invalid response from an upstream server.
The proxy server could not handle the request

Reason: DNS lookup failure for: web-dl01.srv.dcmtl.stgraber.net

Apache/2.4.29 (Ubuntu) Server at linuxcontainers.org Port 443

After some time running the container not start.

I saw a similar question but running on your own server. Here, my lxd-demo-server is running and create normally the container when the "rules" were accepted.

But, if I not create any container for some hours and try to create a new one, the server creates the container itself (but it remains stopped), but the container was not started, so the interface did not open the terminal.

Not saw any logs on the terminal on the running lxd-demo-server process.

I think that, probably, some process was not starting the container after that change related to the alias container image.

If I kill the lxd-demo-server process, it start to create and remove the containers again, but keep one container on stopped state and I need to remove it manually.

Only to clarify, I create this environment here to allow my computer science students to play with Linux. Thanks a lot for LXD/LXD-demo-server environment created.

How to launch multiple demo server ?

Hi,

I'm exploring replacement for Docker environment for webminal.org and found this project.

Followed these steps https://ubuntu.com/blog/run-your-own-lxd-demo-server and accessed demo server locally. As a LXD newbie, I'm not sure whether its possible to setup multiple lxd-demo-server on a host. I guess I need to modify default port 8080 or may be pass custom profile for each lxd-demo-server? Any thoughts on how to setup/launch lxd-demo-server per user? thanks.

Whitelist GitHub

It looks like it is impossible to clone stuff from GitHub even given that git is installed. That quite limits the things you can try.

Cannot create container

#11 Is pretty much an exact description of my issue, only a local build and not the demo server hosted on the website. Same build script always worked in the past so Im not sure the best place to start in determining the cause. Any suggestions?

https and ssl

hello,

i am french student,
i work with lxd-demo- server for school project.
the project goal is to create server of network lab.
with it the student can discover the network and test many think with no knowlage of linux.

we have chose lxd because this is light and fast.

so we have got some probleme with your technologie, i have install lxd-demo-server and it don't work whith https , so i think is it ssl probleme ecause i have try to use http protocol and it work !!
but not for connexion with the container.

the lxd-demo-server doesn't print error, i had read the log wiht wireqhark and i had see , error encrypted packets malformated

have you already have this problem ?

Go error

Just a heads up that starting today builds of the demo server started to fail for me. The error given matches the one referenced in Errors in rest.go #4
Anything I can be doing to help myself ?

remote mode simplestreams

In some of your tutorials, you explain how to use an lxd server as an image server with the command lxc config set core.https_address "[::]:8443"

The lxd.go client used for the API does only accept servers using the simplestream protocol.
Is it possible to set lxd server in simplestream for the remote mode ?

Container Not Found

*****My config file

quota_cpu: 1
quota_ram: 128
quota_disk: 5
quota_sessions: 2
quota_time: 3000
quota_processes: 200
container: "u1"
image: "ubuntu_wily"
server_addr: "[::]:8080"
server_banned_ips:
- 1.2.3.4
server_console_only: true
server_containers_max: 50
server_cpu_count: 2
server_ipv6_only: true
server_maintenance: false
server_terms: |-
  By using the LXD demonstration server, you agree that:<br />
  <ul>
    <li>Access to this service may be revoked at any time for any reason</li>
    <li>Access to this service is solely provided to evaluate LXD</li>
    <li>Your IP address, access time and activity on the test server may be recorded</li>
    <li>Any abuse of this service may lead to a ban or other applicable actions</li>
  </ul>

******* $ lxc list

+------+---------+--------------------------------+------+------------+-----------+
| NAME |  STATE  |              IPV4              | IPV6 |    TYPE    | SNAPSHOTS |
+------+---------+--------------------------------+------+------------+-----------+
| u1   | RUNNING | 10.0.3.67 (eth0)               |      | PERSISTENT | 0         |
|      |         | 10.0.3.1 (lxcbr0)              |      |            |           |
+------+---------+--------------------------------+------+------------+-----------+

****** i contain container named ''u1'' but while curling i get the following error
*****curl http://localhost:8080/1.0/info )
***
** Container not found
I want to know the mistake i did and how to write the config file?

Errors in rest.go

I suspect this repo hasn't been updated for awhile...

~ go build
# _/home/u/localhost/var/www/lxd
./rest.go:175: not enough arguments in call to lxdDaemon.Init
./rest.go:458: not enough arguments in call to shared.ReaderToChannel

Whitelist Fedora mirrors

Being able to execute Fedora in Ubuntu is a killer feature, IMHO. )

But there is nothing to test even if container started. It comes even without Python. I can not copy/paste code to prove that, because of #5, but it would be much better experience being able to install some packages, and for that at least https://mirrors.fedoraproject.org/ should be whitelisted.

LXD from snap and lxd-demo-server compiled

It's only a question if we have an option to configure that.

If I use LXD from ubuntu repository (3.0.2), the LXD compiled work as expected (and I have some issues, probably related to the old version of LXD). Now, I'm trying to use my compiled version with the snap installed.

When I try to run the lxd-demo-server compiled, I saw this message:

$ ./lxd-demo-server Waiting for the LXD server to come online.

And the LXD from snap:

$ lxc version Client version: 3.8 Server version: 3.8

Thanks a lot for your work @stgraber

An unknown error occured. Please try again in a few minutes.

currently the website does not allow to create any new containers...

Server status
You are connected over: IPv4 (196.3.50.248)
The demo server is currently running 0 user sessions out of 32
Unable to create a new container
An unknown error occured. Please try again in a few minutes. 

Installed LXD and lxd-demo-server via Snap, but not working

Ubuntu: 18.04
LXD: 3.7

The log from lxd-demo-server:

goroutine 274 [running]:
net/http.(*conn).serve.func1(0xc420506000)
	/build/lxd-demo-server/parts/go/build/src/net/http/server.go:1726 +0xd0
panic(0x9a3800, 0xefe040)
	/build/lxd-demo-server/parts/go/build/src/runtime/panic.go:502 +0x229
main.restStartHandler(0xaac820, 0xc4203361c0, 0xc420276900)
	/build/lxd-demo-server/parts/lxd-demo-server/go/src/github.com/lxc/lxd-demo-server/rest.go:436 +0x746
net/http.HandlerFunc.ServeHTTP(0xa68540, 0xaac820, 0xc4203361c0, 0xc420276900)
	/build/lxd-demo-server/parts/go/build/src/net/http/server.go:1947 +0x44
github.com/gorilla/mux.(*Router).ServeHTTP(0xc4201fe460, 0xaac820, 0xc4203361c0, 0xc420276900)
	/build/lxd-demo-server/parts/lxd-demo-server/go/src/github.com/gorilla/mux/mux.go:162 +0xed
net/http.serverHandler.ServeHTTP(0xc420220ea0, 0xaac820, 0xc4203361c0, 0xc420459600)
	/build/lxd-demo-server/parts/go/build/src/net/http/server.go:2694 +0xbc
net/http.(*conn).serve(0xc420506000, 0xaad060, 0xc42028c080)
	/build/lxd-demo-server/parts/go/build/src/net/http/server.go:1830 +0x651
created by net/http.(*Server).Serve
	/build/lxd-demo-server/parts/go/build/src/net/http/server.go:2795 +0x27b
2018/12/14 09:48:17 http: panic serving 10.87.0.42:44978: runtime error: invalid memory address or nil pointer dereference
goroutine 236 [running]:
net/http.(*conn).serve.func1(0xc4204f4000)
	/build/lxd-demo-server/parts/go/build/src/net/http/server.go:1726 +0xd0
panic(0x9a3800, 0xefe040)
	/build/lxd-demo-server/parts/go/build/src/runtime/panic.go:502 +0x229
main.restStartHandler(0xaac820, 0xc420562000, 0xc42044e300)
	/build/lxd-demo-server/parts/lxd-demo-server/go/src/github.com/lxc/lxd-demo-server/rest.go:436 +0x746
net/http.HandlerFunc.ServeHTTP(0xa68540, 0xaac820, 0xc420562000, 0xc42044e300)
	/build/lxd-demo-server/parts/go/build/src/net/http/server.go:1947 +0x44
github.com/gorilla/mux.(*Router).ServeHTTP(0xc4201fe460, 0xaac820, 0xc420562000, 0xc42044e300)
	/build/lxd-demo-server/parts/lxd-demo-server/go/src/github.com/gorilla/mux/mux.go:162 +0xed
net/http.serverHandler.ServeHTTP(0xc420220ea0, 0xaac820, 0xc420562000, 0xc42033e900)
	/build/lxd-demo-server/parts/go/build/src/net/http/server.go:2694 +0xbc
net/http.(*conn).serve(0xc4204f4000, 0xaad060, 0xc42002f600)
	/build/lxd-demo-server/parts/go/build/src/net/http/server.go:1830 +0x651
created by net/http.(*Server).Serve
	/build/lxd-demo-server/parts/go/build/src/net/http/server.go:2795 +0x27b
2018/12/14 09:48:17 http: panic serving 10.87.0.42:44984: runtime error: invalid memory address or nil pointer dereference
goroutine 217 [running]:
net/http.(*conn).serve.func1(0xc4201de0a0)
	/build/lxd-demo-server/parts/go/build/src/net/http/server.go:1726 +0xd0
panic(0x9a3800, 0xefe040)
	/build/lxd-demo-server/parts/go/build/src/runtime/panic.go:502 +0x229
main.restStartHandler(0xaac820, 0xc4205620e0, 0xc42033e100)
	/build/lxd-demo-server/parts/lxd-demo-server/go/src/github.com/lxc/lxd-demo-server/rest.go:436 +0x746
net/http.HandlerFunc.ServeHTTP(0xa68540, 0xaac820, 0xc4205620e0, 0xc42033e100)
	/build/lxd-demo-server/parts/go/build/src/net/http/server.go:1947 +0x44
github.com/gorilla/mux.(*Router).ServeHTTP(0xc4201fe460, 0xaac820, 0xc4205620e0, 0xc42033e100)
	/build/lxd-demo-server/parts/lxd-demo-server/go/src/github.com/gorilla/mux/mux.go:162 +0xed
net/http.serverHandler.ServeHTTP(0xc420220ea0, 0xaac820, 0xc4205620e0, 0xc420458a00)
	/build/lxd-demo-server/parts/go/build/src/net/http/server.go:2694 +0xbc
net/http.(*conn).serve(0xc4201de0a0, 0xaad060, 0xc42019c100)
	/build/lxd-demo-server/parts/go/build/src/net/http/server.go:1830 +0x651
created by net/http.(*Server).Serve
	/build/lxd-demo-server/parts/go/build/src/net/http/server.go:2795 +0x27b
2018/12/14 09:48:17 http: panic serving 10.87.0.42:44990: runtime error: invalid memory address or nil pointer dereference
goroutine 175 [running]:
net/http.(*conn).serve.func1(0xc42019a140)
	/build/lxd-demo-server/parts/go/build/src/net/http/server.go:1726 +0xd0
panic(0x9a3800, 0xefe040)
	/build/lxd-demo-server/parts/go/build/src/runtime/panic.go:502 +0x229
main.restStartHandler(0xaac820, 0xc4204b6000, 0xc4201ca400)
	/build/lxd-demo-server/parts/lxd-demo-server/go/src/github.com/lxc/lxd-demo-server/rest.go:436 +0x746
net/http.HandlerFunc.ServeHTTP(0xa68540, 0xaac820, 0xc4204b6000, 0xc4201ca400)
	/build/lxd-demo-server/parts/go/build/src/net/http/server.go:1947 +0x44
github.com/gorilla/mux.(*Router).ServeHTTP(0xc4201fe460, 0xaac820, 0xc4204b6000, 0xc4201ca400)
	/build/lxd-demo-server/parts/lxd-demo-server/go/src/github.com/gorilla/mux/mux.go:162 +0xed
net/http.serverHandler.ServeHTTP(0xc420220ea0, 0xaac820, 0xc4204b6000, 0xc420458900)
	/build/lxd-demo-server/parts/go/build/src/net/http/server.go:2694 +0xbc
net/http.(*conn).serve(0xc42019a140, 0xaad060, 0xc4202bc240)
	/build/lxd-demo-server/parts/go/build/src/net/http/server.go:1830 +0x651
created by net/http.(*Server).Serve
	/build/lxd-demo-server/parts/go/build/src/net/http/server.go:2795 +0x27b
2018/12/14 09:48:17 http: panic serving 10.87.0.42:44980: runtime error: invalid memory address or nil pointer dereference
goroutine 239 [running]:
net/http.(*conn).serve.func1(0xc4204f4140)
	/build/lxd-demo-server/parts/go/build/src/net/http/server.go:1726 +0xd0
panic(0x9a3800, 0xefe040)
	/build/lxd-demo-server/parts/go/build/src/runtime/panic.go:502 +0x229
main.restStartHandler(0xaac820, 0xc4203ac000, 0xc42033e100)
	/build/lxd-demo-server/parts/lxd-demo-server/go/src/github.com/lxc/lxd-demo-server/rest.go:436 +0x746
net/http.HandlerFunc.ServeHTTP(0xa68540, 0xaac820, 0xc4203ac000, 0xc42033e100)
	/build/lxd-demo-server/parts/go/build/src/net/http/server.go:1947 +0x44
github.com/gorilla/mux.(*Router).ServeHTTP(0xc4201fe460, 0xaac820, 0xc4203ac000, 0xc42033e100)
	/build/lxd-demo-server/parts/lxd-demo-server/go/src/github.com/gorilla/mux/mux.go:162 +0xed
net/http.serverHandler.ServeHTTP(0xc420220ea0, 0xaac820, 0xc4203ac000, 0xc420458400)
	/build/lxd-demo-server/parts/go/build/src/net/http/server.go:2694 +0xbc
net/http.(*conn).serve(0xc4204f4140, 0xaad060, 0xc4202bc000)
	/build/lxd-demo-server/parts/go/build/src/net/http/server.go:1830 +0x651
created by net/http.(*Server).Serve
	/build/lxd-demo-server/parts/go/build/src/net/http/server.go:2795 +0x27b
2018/12/14 09:48:17 http: panic serving 10.87.0.42:44982: runtime error: invalid memory address or nil pointer dereference
goroutine 216 [running]:
net/http.(*conn).serve.func1(0xc4201de000)
	/build/lxd-demo-server/parts/go/build/src/net/http/server.go:1726 +0xd0
panic(0x9a3800, 0xefe040)
	/build/lxd-demo-server/parts/go/build/src/runtime/panic.go:502 +0x229
main.restStartHandler(0xaac820, 0xc4204b6000, 0xc4201f0100)
	/build/lxd-demo-server/parts/lxd-demo-server/go/src/github.com/lxc/lxd-demo-server/rest.go:436 +0x746
net/http.HandlerFunc.ServeHTTP(0xa68540, 0xaac820, 0xc4204b6000, 0xc4201f0100)
	/build/lxd-demo-server/parts/go/build/src/net/http/server.go:1947 +0x44
github.com/gorilla/mux.(*Router).ServeHTTP(0xc4201fe460, 0xaac820, 0xc4204b6000, 0xc4201f0100)
	/build/lxd-demo-server/parts/lxd-demo-server/go/src/github.com/gorilla/mux/mux.go:162 +0xed
net/http.serverHandler.ServeHTTP(0xc420220ea0, 0xaac820, 0xc4204b6000, 0xc42033e400)
	/build/lxd-demo-server/parts/go/build/src/net/http/server.go:2694 +0xbc
net/http.(*conn).serve(0xc4201de000, 0xaad060, 0xc4201e00c0)
	/build/lxd-demo-server/parts/go/build/src/net/http/server.go:1830 +0x651
created by net/http.(*Server).Serve
	/build/lxd-demo-server/parts/go/build/src/net/http/server.go:2795 +0x27b
2018/12/14 09:48:17 http: panic serving 10.87.0.42:44986: runtime error: invalid memory address or nil pointer dereference
goroutine 218 [running]:
net/http.(*conn).serve.func1(0xc4201de280)
	/build/lxd-demo-server/parts/go/build/src/net/http/server.go:1726 +0xd0
panic(0x9a3800, 0xefe040)
	/build/lxd-demo-server/parts/go/build/src/runtime/panic.go:502 +0x229
main.restStartHandler(0xaac820, 0xc4204b60e0, 0xc4201f0700)
	/build/lxd-demo-server/parts/lxd-demo-server/go/src/github.com/lxc/lxd-demo-server/rest.go:436 +0x746
net/http.HandlerFunc.ServeHTTP(0xa68540, 0xaac820, 0xc4204b60e0, 0xc4201f0700)
	/build/lxd-demo-server/parts/go/build/src/net/http/server.go:1947 +0x44
github.com/gorilla/mux.(*Router).ServeHTTP(0xc4201fe460, 0xaac820, 0xc4204b60e0, 0xc4201f0700)
	/build/lxd-demo-server/parts/lxd-demo-server/go/src/github.com/gorilla/mux/mux.go:162 +0xed
net/http.serverHandler.ServeHTTP(0xc420220ea0, 0xaac820, 0xc4204b60e0, 0xc4201f0400)
	/build/lxd-demo-server/parts/go/build/src/net/http/server.go:2694 +0xbc
net/http.(*conn).serve(0xc4201de280, 0xaad060, 0xc4205740c0)
	/build/lxd-demo-server/parts/go/build/src/net/http/server.go:1830 +0x651
created by net/http.(*Server).Serve
	/build/lxd-demo-server/parts/go/build/src/net/http/server.go:2795 +0x27b
2018/12/14 09:48:17 http: panic serving 10.87.0.42:44992: runtime error: invalid memory address or nil pointer dereference
goroutine 176 [running]:
net/http.(*conn).serve.func1(0xc42019a280)
	/build/lxd-demo-server/parts/go/build/src/net/http/server.go:1726 +0xd0
panic(0x9a3800, 0xefe040)
	/build/lxd-demo-server/parts/go/build/src/runtime/panic.go:502 +0x229
main.restStartHandler(0xaac820, 0xc4203ac000, 0xc42033e100)
	/build/lxd-demo-server/parts/lxd-demo-server/go/src/github.com/lxc/lxd-demo-server/rest.go:436 +0x746
net/http.HandlerFunc.ServeHTTP(0xa68540, 0xaac820, 0xc4203ac000, 0xc42033e100)
	/build/lxd-demo-server/parts/go/build/src/net/http/server.go:1947 +0x44
github.com/gorilla/mux.(*Router).ServeHTTP(0xc4201fe460, 0xaac820, 0xc4203ac000, 0xc42033e100)
	/build/lxd-demo-server/parts/lxd-demo-server/go/src/github.com/gorilla/mux/mux.go:162 +0xed
net/http.serverHandler.ServeHTTP(0xc420220ea0, 0xaac820, 0xc4203ac000, 0xc42033e500)
	/build/lxd-demo-server/parts/go/build/src/net/http/server.go:2694 +0xbc
net/http.(*conn).serve(0xc42019a280, 0xaad060, 0xc4201e04c0)
	/build/lxd-demo-server/parts/go/build/src/net/http/server.go:1830 +0x651
created by net/http.(*Server).Serve
	/build/lxd-demo-server/parts/go/build/src/net/http/server.go:2795 +0x27b
2018/12/14 09:48:17 http: panic serving 10.87.0.42:44996: runtime error: invalid memory address or nil pointer dereference
goroutine 320 [running]:
net/http.(*conn).serve.func1(0xc4205063c0)
	/build/lxd-demo-server/parts/go/build/src/net/http/server.go:1726 +0xd0
panic(0x9a3800, 0xefe040)
	/build/lxd-demo-server/parts/go/build/src/runtime/panic.go:502 +0x229
main.restStartHandler(0xaac820, 0xc4201361c0, 0xc4201f0300)
	/build/lxd-demo-server/parts/lxd-demo-server/go/src/github.com/lxc/lxd-demo-server/rest.go:436 +0x746
net/http.HandlerFunc.ServeHTTP(0xa68540, 0xaac820, 0xc4201361c0, 0xc4201f0300)
	/build/lxd-demo-server/parts/go/build/src/net/http/server.go:1947 +0x44
github.com/gorilla/mux.(*Router).ServeHTTP(0xc4201fe460, 0xaac820, 0xc4201361c0, 0xc4201f0300)
	/build/lxd-demo-server/parts/lxd-demo-server/go/src/github.com/gorilla/mux/mux.go:162 +0xed
net/http.serverHandler.ServeHTTP(0xc420220ea0, 0xaac820, 0xc4201361c0, 0xc4201f0100)
	/build/lxd-demo-server/parts/go/build/src/net/http/server.go:2694 +0xbc
net/http.(*conn).serve(0xc4205063c0, 0xaad060, 0xc42002f840)
	/build/lxd-demo-server/parts/go/build/src/net/http/server.go:1830 +0x651
created by net/http.(*Server).Serve
	/build/lxd-demo-server/parts/go/build/src/net/http/server.go:2795 +0x27b
2018/12/14 09:48:17 http: panic serving 10.87.0.42:44998: runtime error: invalid memory address or nil pointer dereference
goroutine 390 [running]:
net/http.(*conn).serve.func1(0xc42019a000)
	/build/lxd-demo-server/parts/go/build/src/net/http/server.go:1726 +0xd0
panic(0x9a3800, 0xefe040)
	/build/lxd-demo-server/parts/go/build/src/runtime/panic.go:502 +0x229
main.restStartHandler(0xaac820, 0xc420136380, 0xc4201f0400)
	/build/lxd-demo-server/parts/lxd-demo-server/go/src/github.com/lxc/lxd-demo-server/rest.go:436 +0x746
net/http.HandlerFunc.ServeHTTP(0xa68540, 0xaac820, 0xc420136380, 0xc4201f0400)
	/build/lxd-demo-server/parts/go/build/src/net/http/server.go:1947 +0x44
github.com/gorilla/mux.(*Router).ServeHTTP(0xc4201fe460, 0xaac820, 0xc420136380, 0xc4201f0400)
	/build/lxd-demo-server/parts/lxd-demo-server/go/src/github.com/gorilla/mux/mux.go:162 +0xed
net/http.serverHandler.ServeHTTP(0xc420220ea0, 0xaac820, 0xc420136380, 0xc4201f0200)
	/build/lxd-demo-server/parts/go/build/src/net/http/server.go:2694 +0xbc
net/http.(*conn).serve(0xc42019a000, 0xaad060, 0xc42028c4c0)
	/build/lxd-demo-server/parts/go/build/src/net/http/server.go:1830 +0x651
created by net/http.(*Server).Serve
	/build/lxd-demo-server/parts/go/build/src/net/http/server.go:2795 +0x27b```

So, the container was not started. But, if I try to start manually one container using:

`lxc launch ubuntu c0`

Works normally

Switch to xterm.js

It is impossible to copy/paste instructions into Try it online console to try things. Context menu doesn't work for this either.

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.