'Something went wrong' on page startup


#1

Hi,

I am in the process of setting up a prod instance of Indico to allow me to test the install of a development wheel I created (using a dev instance of indico) as discussed yesterday.

I have followed instructions in indico install and although at the end the application starts up it displays the ‘something went wrong’ page with the message ‘ValueError: u’fe80::96e7:732b:511f:4f97%enp0s3’ does not appear to be an IPv4 or IPv6 address’

Have you any ideas what this is?

Centos 7 machine – oracle VB VM.

Cheers

Mark.


#2

Hey,

probably you have invalid data in your DB in the indico.ip_networks table. Make sure that all rows contain valid IPv4 or IPv6.

Regards


#3

Full traceback would be helpful, might also be a bad IP for the user (maybe if you access Indico via a link-local IP)…


#4

sorry for late reply - in meeting.

i checked the DB and nothing at all in the ip table.

below is log from indico - hope this helps

2019-04-05 14:19:40,015  ERROR    898fbbe58dd147d9  indico.flask              u'fe80::96e7:732b:511f:4f97%enp0s3' does not appear to be an IPv4 or IPv6 address
Traceback (most recent call last):
  File "/opt/indico/.venv/lib/python2.7/site-packages/flask/app.py", line 1612, in full_dispatch_request
    rv = self.dispatch_request()
  File "/opt/indico/.venv/lib/python2.7/site-packages/flask/app.py", line 1598, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/opt/indico/.venv/lib/python2.7/site-packages/indico/web/flask/util.py", line 114, in wrapper
    return obj().process()
  File "/opt/indico/.venv/lib/python2.7/site-packages/indico/web/rh.py", line 289, in process
    res = self._do_process()
  File "/opt/indico/.venv/lib/python2.7/site-packages/indico/web/rh.py", line 259, in _do_process
    rv = self._process()
  File "/opt/indico/.venv/lib/python2.7/site-packages/indico/web/rh.py", line 210, in _process
    return method()
  File "/opt/indico/.venv/lib/python2.7/site-packages/indico/modules/bootstrap/controllers.py", line 56, in _process_GET
    show_local_warning=(config.DEBUG or is_private_url(request.url_root)))
  File "/opt/indico/.venv/lib/python2.7/site-packages/indico/util/network.py", line 31, in is_private_url
    return any(ipaddress.ip_address(unicode(item[4][0])).is_private for item in host_data)
  File "/opt/indico/.venv/lib/python2.7/site-packages/indico/util/network.py", line 31, in <genexpr>
    return any(ipaddress.ip_address(unicode(item[4][0])).is_private for item in host_data)
  File "/opt/indico/.venv/lib/python2.7/site-packages/ipaddress.py", line 168, in ip_address
    address)
ValueError: u'fe80::96e7:732b:511f:4f97%enp0s3' does not appear to be an IPv4 or IPv6 address

#5
ValueError: u'fe80::96e7:732b:511f:4f97%enp0s3' does not appear to be an IPv4 or IPv6 address
2019-04-05 14:19:39,802  INFO     898fbbe58dd147d9  indico.rh                 GET /bootstrap [IP=10.0.2.15] [PID=4530] [UID=None]
2019-04-05 14:19:40,015  ERROR    898fbbe58dd147d9  indico.flask              u'fe80::96e7:732b:511f:4f97%enp0s3' does not appear to be an IPv4 or IPv6 address
Traceback (most recent call last):


#6

I am guessing it is related to the fact that you are running Indico inside a Virtual Machine (not sure thought). What url are you using to access Indico?


#7

https://centos.centosdev (centos.centosdev is hostname)


#8
root@centos apache]# hostnamectl
   Static hostname: centos.centosdev
         Icon name: computer-vm
           Chassis: vm
        Machine ID: 6b94403747a44f8d965bb55929c1fab6
           Boot ID: 03db5433420648168205efdc96dbd175
    Virtualization: kvm
  Operating System: CentOS Linux 7 (Core)
       CPE OS Name: cpe:/o:centos:centos:7
            Kernel: Linux 3.10.0-957.el7.x86_64
      Architecture: x86-64
[root@centos apache]# 

#9

OK
I just noticed in my junk mail a ‘few’ emails from the indico system
As info I changed the domain name from localhost.localdomain HALF WAY through the installation process – i.e. when the documentation said to include it in the configuration files.
I notice the email mention the OLD name (localhost…….) and not the ne name (centos…….) – do you think this may be relevant?
Email title;
Unexpected Exception occurred at localhost.localdomain: u’fe80::96e7:732b:511f:4f97%enp0s3’ does not appear to be an IPv4 or IPv6 address
Email content
2019-04-05 14:19:40,015 898fbbe58dd147d9 indico.flask - ERROR errors.py:107 – u’fe80::96e7:732b:511f:4f97%enp0s3’ does not appear to be an IPv4 or IPv6 address

Traceback (most recent call last):
File “/opt/indico/.venv/lib/python2.7/site-packages/flask/app.py”, line 1612, in full_dispatch_request
rv = self.dispatch_request()
File “/opt/indico/.venv/lib/python2.7/site-packages/flask/app.py”, line 1598, in dispatch_request
return self.view_functionsrule.endpoint
File “/opt/indico/.venv/lib/python2.7/site-packages/indico/web/flask/util.py”, line 114, in wrapper
return obj().process()
File “/opt/indico/.venv/lib/python2.7/site-packages/indico/web/rh.py”, line 289, in process
res = self._do_process()
File “/opt/indico/.venv/lib/python2.7/site-packages/indico/web/rh.py”, line 259, in _do_process
rv = self._process()
File “/opt/indico/.venv/lib/python2.7/site-packages/indico/web/rh.py”, line 210, in _process
return method()
File “/opt/indico/.venv/lib/python2.7/site-packages/indico/modules/bootstrap/controllers.py”, line 56, in _process_GET
show_local_warning=(config.DEBUG or is_private_url(request.url_root)))
File “/opt/indico/.venv/lib/python2.7/site-packages/indico/util/network.py”, line 31, in is_private_url
return any(ipaddress.ip_address(unicode(item[4][0])).is_private for item in host_data)
File “/opt/indico/.venv/lib/python2.7/site-packages/indico/util/network.py”, line 31, in
return any(ipaddress.ip_address(unicode(item[4][0])).is_private for item in host_data)
File “/opt/indico/.venv/lib/python2.7/site-packages/ipaddress.py”, line 168, in ip_address
address)
ValueError: u’fe80::96e7:732b:511f:4f97%enp0s3’ does not appear to be an IPv4 or IPv6 address

{u’data’: {u’get’: {},
u’headers’: {‘Accept’: u’text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,/;q=0.8,application/signed-exchange;v=b3’,
‘Accept-Encoding’: u’gzip, deflate, br’,
‘Accept-Language’: u’en-GB,en-US;q=0.9,en;q=0.8’,
‘Cache-Control’: u’max-age=0’,
‘Connection’: u’keep-alive’,
‘Host’: u’centos.centosdev’,
‘Upgrade-Insecure-Requests’: u’1’,
‘User-Agent’: u’Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36’},
u’json’: None,
u’post’: {},
u’url’: {}},
u’endpoint’: u’bootstrap.index’,
u’id’: ‘898fbbe58dd147d9’,
u’ip’: ‘10.0.2.15’,
u’method’: ‘GET’,
u’referrer’: None,
u’rh’: ‘RHBootstrap’,
u’time’: ‘2019-04-05T14:19:40.098113’,
u’url’: u’https://centos.centosdev/bootstrap’,
u’user’: None,
u’user_agent’: u’Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36’}


#10

Can you check what is being returned when you execute:

import socket
socket.getaddrinfo('centos.centosdev', None, 0, 0, socket.IPPROTO_TCP)

#11

I think that we should fix it on our side anyway. You could change the function is_private_url locally, so that it looks like the one below:

def is_private_url(url):
    """Check if the provided URL points to a private IP address."""
    hostname = url_parse(url).host.strip('[]')
    if '.' not in hostname and ':' not in hostname:
        return True

    try:
        host_data = socket.getaddrinfo(hostname, None, 0, 0, socket.IPPROTO_TCP)
        return any(ipaddress.ip_address(unicode(item[4][0])).is_private for item in host_data)
    except (socket.gaierror, ipaddress.AddressValueError, ValueError):
        return True

#12

it doesnt like ‘import’!! LOL - command not found - both inside and outside of .venv

However…

i added a user using the indico CLI and i have got into the app and moving around!

i know the error does need to get fixed, but I am managing to carry on - all i wanted to do is have a ‘working’ env to allow me to test the pip install …wheel file - we have a ‘proper’ VM which is the real production and i didn’t want to break that with my testing!

and a bonus (i think) - i got a badge for being twat, sorry, user, of the month fro yourselves :slight_smile: LOL


#13

it doesnt like ‘import’!! LOL - command not found - both inside and outside of .venv

You should execute those statements inside a Python interpreter or indico shell