Bug 38391 - Replace <serveraddress> on the EC2 welcome page
Replace <serveraddress> on the EC2 welcome page
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: System setup
UCS 4.0
Other Linux
: P5 normal (vote)
: UCS 4.0-2-errata
Assigned To: Philipp Hahn
Florian Best
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2015-04-30 07:21 CEST by Stefan Gohmann
Modified: 2015-07-03 14:11 CEST (History)
2 users (show)

See Also:
What kind of report is it?: ---
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments
Screenshot (98.26 KB, image/png)
2015-07-01 17:34 CEST, Florian Best
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Gohmann univentionstaff 2015-04-30 07:21:37 CEST
With Bug #34388 a new welcome page was added which describes the first steps:

-------------------------------------------------------------------------------
Welcome to UCS initial configuration

Before starting the setup wizard, an initial password for the root user must be set.

Connect to this server instance as root via ssh and your selected private ssh key. Set a password with passwd, e.g., by issuing the following command:

ssh -i <path/to/privatekey> root@<serveraddress> passwd

If a password for root has been set, start the setup wizard.
-------------------------------------------------------------------------------

The place holder <serveraddress> should be replaced with the real name / IP of the instance.
Comment 1 Philipp Hahn univentionstaff 2015-06-02 14:33:31 CEST
Also note the incomplete address for https this on login to EC2:

> This system is not completely configured yet. To finalise the configuration
> of this system you need to login to the web-based Univention Management
> Console which can be reached with a web browser via the following URL
> 
>   https://
> 
...
> Linux unassigned-hostname 3.16-ucs109-amd64 #1 SMP Debian 3.16.5-1.109.201412161258 (2014-12-16) x86_64

univention-cloud-init also shows <serveraddress>.

r60989 | Bug #38391 USS: Show address in welcome message.
r60987 | Bug #38391: Copyright 2015
r60991 | Bug #38391 Cloud: Show address in welcome message.
r60993 | Bug #38391 USS: Fix debian/control file

Package: univention-apache
Version: 7.0.16-10.232.201506021257
Branch: ucs_4.0-0
Scope: errata4.0-2

Package: univention-system-setup
Version: 8.1.69-2.890.201506021327
User: phahn
Branch: ucs_4.0-0
Scope: errata4.0-2

r60992 | Bug #38391, Bug #38016: apache,uss overview YAML
r60994 | Bug #38391: uss overview YAML
 2015-06-02-univention-apache.yaml
 2015-06-02-univention-system-setup.yaml
 2015-06-02-univention-cloud-init.yaml
Comment 2 Florian Best univentionstaff 2015-06-11 11:16:28 CEST
After a regular upgrade the overview page is broken and does not load up.
/ucs-overview/entries.json is simply "\n\n".

Also error handling is missing there.
socket.error → not catched
especially socket.timeout as socket.setdefaulttimeout(2) is set.

The new things in entries.json should not prevent the rest to be working.
Please add {"traceback": ...} to that json data if something fails so that "service", "admin" and "ucr.domainname" + "ucs.hostname" is always set!
Comment 3 Florian Best univentionstaff 2015-06-11 11:31:41 CEST
root@master70:~# ucr commit /var/www/ucs-overview/entries.json 
File: /var/www/ucs-overview/entries.json
Traceback (most recent call last):
  File "<stdin>", line 146, in <module>
  File "/usr/lib/python2.7/json/__init__.py", line 238, in dumps
    **kw).encode(obj)
  File "/usr/lib/python2.7/json/encoder.py", line 202, in encode
    chunks = list(chunks)
  File "/usr/lib/python2.7/json/encoder.py", line 427, in _iterencode
    for chunk in _iterencode_dict(o, _current_indent_level):
  File "/usr/lib/python2.7/json/encoder.py", line 401, in _iterencode_dict
    for chunk in chunks:
  File "/usr/lib/python2.7/json/encoder.py", line 401, in _iterencode_dict
    for chunk in chunks:
  File "/usr/lib/python2.7/json/encoder.py", line 435, in _iterencode
    o = _default(o)
  File "/usr/lib/python2.7/json/encoder.py", line 177, in default
    raise TypeError(repr(o) + " is not JSON serializable")
TypeError: IPv4Network('10.200.27.70/24') is not JSON serializable
Comment 4 Philipp Hahn univentionstaff 2015-06-11 12:28:33 CEST
(In reply to Florian Best from comment #2)
> After a regular upgrade the overview page is broken and does not load up.
> /ucs-overview/entries.json is simply "\n\n".

Should be fixed.

> Also error handling is missing there.
> socket.error → not catched
> especially socket.timeout as socket.setdefaulttimeout(2) is set.

Replaced by urllib2.urlopen(timeout=2), which raises the timeout as urllib2.URLError(). socket.error added nevertheless.

> The new things in entries.json should not prevent the rest to be working.
> Please add {"traceback": ...} to that json data if something fails so that
> "service", "admin" and "ucr.domainname" + "ucs.hostname" is always set!

Added.

(In reply to Florian Best from comment #3)
> TypeError: IPv4Network('10.200.27.70/24') is not JSON serializable

Using .ip now and forcing translation to string.

r61186 | Bug #38391 Apache: Show real address in welcome message

Package: univention-apache
Version: 7.0.16-13.235.201506111221
Branch: ucs_4.0-0
Scope: errata4.0-2

r61187 | Bug #38391 Apache: Show real address in welcome message YAML
 2015-06-02-univention-apache.yaml
Comment 5 Florian Best univentionstaff 2015-07-01 17:34:51 CEST
Created attachment 6991 [details]
Screenshot
Comment 6 Florian Best univentionstaff 2015-07-01 17:35:33 CEST
(In reply to Florian Best from comment #5)
> Created attachment 6991 [details]
> Screenshot
The amazon DNS name is too long so that a scrollbar is shown.
Comment 7 Florian Best univentionstaff 2015-07-01 17:57:28 CEST
If the IP address is obtained via DHCP the overview is broken again:
# ucr commit /var/www/ucs-overview/entries.json
File: /var/www/ucs-overview/entries.json
Traceback (most recent call last):
File "<stdin>", line 156, in <module>
File "<stdin>", line 134, in get_ec2_address
AttributeError: 'str' object has no attribute 'ip'

get_ip_address() returns a str.

ToBeFixed1:
addr = get_ip_address(ifname) if iface.type in DHCP else iface.ipv4_address()

ToBeFixed2:
addr = get_ip_address(ifname)
Comment 8 Florian Best univentionstaff 2015-07-01 18:05:29 CEST
The scrollbar is only shown in FF but not shown in chromium btw.
Comment 9 Philipp Hahn univentionstaff 2015-07-01 23:52:52 CEST
(In reply to Florian Best from comment #7)
> If the IP address is obtained via DHCP the overview is broken again:
> AttributeError: 'str' object has no attribute 'ip'

Fixed:
r61632 | Bug #38391 Apache: Fix IP address by DHCP

Package: univention-apache
Version: 7.0.16-15.237.201507011923
Branch: ucs_4.0-0
Scope: errata4.0-2

r61634 | Bug #38391 Apache: Fix IP address by DHCP YAML
 2015-06-02-univention-apache.yaml


(In reply to Florian Best from comment #6)
> The amazon DNS name is too long so that a scrollbar is shown.

Fixed: <pre> → <p><tt>
r61641 | Bug #38391: Show server address in welcome message.

Package: univention-system-setup
Version: 8.1.69-12.899.201507012316
Branch: ucs_4.0-0
Scope: errata4.0-2

Package: univention-cloud-init
Version: 2.0.1-4.9.201507012316
Branch: ucs_4.0-0
Scope: errata4.0-2

r61642 | Bug #38391: Show server address in welcome message YAML
 2015-06-02-univention-system-setup.yaml
 2015-06-02-univention-cloud-init.yaml

OK:
 sed -i -e '/serveraddress/s/"[^"]*",/"ec2-00-00-00-00.eu-west-1.compute.amazonaws.com",/' /var/www/ucs-overview/entries.json
 firefox http://localhost/ucs-overview/cloud-init-setup.html
 ec2-00-00-00-00.eu-west-1.compute.amazonaws.com
Comment 10 Florian Best univentionstaff 2015-07-02 11:32:19 CEST
OK: {cloud-init,system-setup}{EN,DE}{Firefox,Chromium,IE}
OK: DHCP
OK: retriggering of entries.json in interfaces/ change
OK: YAML entries
Comment 11 Janek Walkenhorst univentionstaff 2015-07-03 14:05:30 CEST
<http://errata.univention.de/ucs/4.0/219.html>
Comment 12 Janek Walkenhorst univentionstaff 2015-07-03 14:05:56 CEST
<http://errata.univention.de/ucs/4.0/218.html>
Comment 13 Janek Walkenhorst univentionstaff 2015-07-03 14:11:16 CEST
<http://errata.univention.de/ucs/4.0/220.html>