Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

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

in OpenNebula 5.8.1 sunstone does not start without an IPv4 address #3282

Closed
7 tasks
telmich opened this issue Apr 28, 2019 · 10 comments
Closed
7 tasks

in OpenNebula 5.8.1 sunstone does not start without an IPv4 address #3282

telmich opened this issue Apr 28, 2019 · 10 comments

Comments

@telmich
Copy link

telmich commented Apr 28, 2019

Description
Previously it was possible to start sunstone without having an IPv4 address on the system.

To Reproduce
Setup a host that only has IPv4 on localhost like this:

root@devuan:/etc/one# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 02:00:f0:a9:c3:fa brd ff:ff:ff:ff:ff:ff
    inet6 2a0a:e5c0:2:12:0:f0ff:fea9:c3fa/64 scope global 
       valid_lft forever preferred_lft forever
    inet6 fe80::f0ff:fea9:c3fa/64 scope link 
       valid_lft forever preferred_lft forever

The result is as follows:

/var/lib/gems/2.3.0/gems/eventmachine-1.2.7/lib/eventmachine.rb:532:in `start_tcp_server': no acceptor (port is in use or requires root privileges) (RuntimeError)
	from /var/lib/gems/2.3.0/gems/eventmachine-1.2.7/lib/eventmachine.rb:532:in `start_server'
	from /var/lib/gems/2.3.0/gems/thin-1.7.2/lib/thin/backends/tcp_server.rb:17:in `connect'
	from /var/lib/gems/2.3.0/gems/thin-1.7.2/lib/thin/backends/base.rb:63:in `block in start'
	from /var/lib/gems/2.3.0/gems/eventmachine-1.2.7/lib/eventmachine.rb:195:in `run_machine'
	from /var/lib/gems/2.3.0/gems/eventmachine-1.2.7/lib/eventmachine.rb:195:in `run'
	from /var/lib/gems/2.3.0/gems/thin-1.7.2/lib/thin/backends/base.rb:73:in `start'
	from /var/lib/gems/2.3.0/gems/thin-1.7.2/lib/thin/server.rb:162:in `start'
	from /var/lib/gems/2.3.0/gems/rack-2.0.6/lib/rack/handler/thin.rb:22:in `run'
	from /var/lib/gems/2.3.0/gems/sinatra-2.0.5/lib/sinatra/base.rb:1525:in `start_server'
	from /var/lib/gems/2.3.0/gems/sinatra-2.0.5/lib/sinatra/base.rb:1459:in `run!'
	from /usr/lib/one/sunstone/sunstone-server.rb:898:in `<main>'

If I add a random IPv4 address to eth0, it starts:

root@devuan:/etc/one# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 02:00:f0:a9:c3:fa brd ff:ff:ff:ff:ff:ff
    inet 10.0.0.5/24 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 2a0a:e5c0:2:12:0:f0ff:fea9:c3fa/64 scope global 
       valid_lft forever preferred_lft forever
    inet6 fe80::f0ff:fea9:c3fa/64 scope link 
       valid_lft forever preferred_lft forever
root@devuan:/etc/one# 

Expected behavior
Sunstone can be started on IPv6 only systems.
Even if IPv4 only bindings work, listening on localhost, as defined in the configuration, should work:

root@devuan:/etc/one# grep -e :host -e :port /etc/one/sunstone-server.conf
:host: 127.0.0.1
:port: 9869

Even better / really correct behaviour would be if :host can actually be "[::1]"

Details

  • Affected Component: Sunstone
  • Hypervisor: any
  • Version: 5.8.1

Additional context

Progress Status

  • Branch created
  • Code committed to development branch
  • Testing - QA
  • Documentation
  • Release notes - resolved issues, compatibility, known issues
  • Code committed to upstream release/hotfix branches
  • Documentation committed to upstream release/hotfix branches
@al3xhh
Copy link
Contributor

al3xhh commented May 7, 2019

Hello @telmich

I have done some tests and for it's working if I use the IPV6 address as a host in the sunstone-server.conf, could you try this way and tell me if it works for you?

$ grep -e :host -e :port /etc/one/sunstone-server.conf
:host: 2a0a:e5c0:2:12:0:f0ff:fea9:c3fa 
:port: 9869
$ ss -tanp -6
State      Recv-Q Send-Q Local Address:Port               Peer Address:Port              
LISTEN     0      128     2a0a:e5c0:2:12:0:f0ff:fea9:c3fa:9869                     :::*                   users:(("ruby",pid=2392,fd=11))

@telmich
Copy link
Author

telmich commented May 13, 2019

That is correct, 2a0a:e5c0:2:12:0:f0ff:fea9:c3fa as :host: works. However ::1, binding to IPv6 localhost does not work. If I add :host: ::1 then I get the following behaviour:

root@devuan:/etc/one# netstat -anp | grep ruby
tcp        0      0 0.0.0.0:9869            0.0.0.0:*               LISTEN      26283/ruby          

So take away:

  • I used the wrong format: [..] based
  • Using the right format (literal IPv6) with extended ipv6 address / GUA works
  • Binding to IPv6 localhost using ::1 does not work

@al3xhh
Copy link
Contributor

al3xhh commented May 13, 2019

Hello @telmich

I did more tests and it worked in these scenarios:

$ grep -e :host -e :port /etc/one/sunstone-server.conf
:host: 0::1
:port: 9869

ss -tanp -6
State       Recv-Q Send-Q                        Local Address:Port                                       Peer Address:Port              
LISTEN      0      100                                     ::1:9869
$ grep -e :host -e :port /etc/one/sunstone-server.conf
:host: 0::0
:port: 9869

ss -tanp -6
State       Recv-Q Send-Q                        Local Address:Port                                       Peer Address:Port              
LISTEN      0      100                                     :::9869

We will add a note in the documentation.

@al3xhh
Copy link
Contributor

al3xhh commented May 13, 2019

Closing this.

@al3xhh al3xhh closed this as completed May 13, 2019
@telmich
Copy link
Author

telmich commented May 13, 2019

@al3xhh It's good to know it works, but using 0::1 or 0::0 are really counterintuitive for anyone using IPv6 and I'd also say it contradicts all IPv6 RFCs out there.

@al3xhh
Copy link
Contributor

al3xhh commented May 13, 2019

@telmich this is a workaround for the ruby gems we use in Sunstone, it's not related directly with our code.

@telmich
Copy link
Author

telmich commented May 13, 2019

Ohhh, I understand. Can you point me to that gem? I'll open a bug report there.

@al3xhh
Copy link
Contributor

al3xhh commented May 13, 2019

@telmich I have done more tests. You can use :: if you are using sunstone + apache. So the problem would be in thin gem, but I'm not sure where do you have to open the issue.

@telmich
Copy link
Author

telmich commented May 13, 2019

@al3xhh Not sure if I understand "sunstone + apache" - is there an apache module for sunstone? We are running a couple of different ruby on rails projects that use unicorn and as far as I remember that works also with ::.

@al3xhh
Copy link
Contributor

al3xhh commented May 13, 2019

You can run sunstone behind apache server, see this.

rsmontero pushed a commit that referenced this issue Nov 7, 2024
When filtering storage config. It now explicitly includes the deployment mode set during the VM template's  storage configuration

Signed-off-by: Victor Hansson <vhansson@opennebula.io>
Co-authored-by: Tino Vázquez <cvazquez@opennebula.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants