RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1236706 - Upon upgrading to 7.1.3, etcd will fail to start due to missing parameter ETCD_ADVERTISE_CLIENT_URLS
Summary: Upon upgrading to 7.1.3, etcd will fail to start due to missing parameter ETC...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: etcd
Version: 7.1
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Jan Chaloupka
QA Contact: Chris Evich
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-06-29 18:48 UTC by Jake Hunsaker
Modified: 2023-09-14 03:01 UTC (History)
3 users (show)

Fixed In Version: etcd-2.0.13-1.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-08-06 00:51:37 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
set ETCD_ADVERTISE_CLIENT_URLS to ETCD_LISTEN_CLIENT_URLS if empty (858 bytes, patch)
2015-07-07 00:52 UTC, Jan Chaloupka
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:1571 0 normal SHIPPED_LIVE etcd bug fix and enhancement update 2015-08-06 04:51:28 UTC

Description Jake Hunsaker 2015-06-29 18:48:19 UTC
Description of problem:

Upgrading to 7.1.3 from an existing Atomic Host causes etcd to fail to start due to there being a missing parameter, ETCD_ADVERTISE_CLIENT_URLS, in /etc/etcd.conf.

This was not a required arg in 7.1.2 but appears to be now. 

Version-Release number of selected component (if applicable):
atomic host 7.1.3
kubernetes-0.17

How reproducible:
Easily

Steps to Reproduce:
1. Have a 7.1.2 AH (presumably any older version as well)
2. Run 'atomic host upgrade'
3.

Actual results:

etcd will fail to start until ETCD_ADVERTISE_CLIENT_URLS is added to /etc/etcd.conf

Expected results:
This parameter should already be present in etcd.conf per the upgrade.

Additional info:
This appears to only be affecting Atomic Host, as on RHEL hosts it either works or drops an etcd.conf.rpmnew, whereas on AH there is no rpmnew file.

Comment 2 Jan Chaloupka 2015-06-30 06:18:34 UTC
Hi Jake,

since etcd-2.0.11-2 ETCD_ADVERTISE_CLIENT_URLS is set to default value in /etc/etcd.conf.

Update to 7.1.4 will fix this issue.

Jan

Comment 3 Colin Walters 2015-06-30 18:21:58 UTC
This is definitely an unfortunate bug.   The only thing I can think to do here is to check on startup (via a patch in the code)
whether ETCD_LISTEN_CLIENT_URLS="http://localhost:2379" and is unset, then set the latter to "http://localhost:2379".

Jan, what do you think?

Comment 4 Jan Chaloupka 2015-07-01 07:38:14 UTC
Colin,

I see. AH 7.1.3 release ships etcd-2.0.11-2 which sets ETCD_ADVERTISE_CLIENT_URLS="http://localhost:2379,http://localhost:4001".

As /etc/etcd/etcd.conf file is prefixed by %config(noreplace), it does not get replaced/updated when updating to AH 7.1.3. It has to be done manually on all machines with etcd installed.

Adding this line in etcd.service file in [service] section will fix the issue:
Environment="ETCD_ADVERTISE_CLIENT_URLS=http://localhost:2378"

[1] says "Settings from EnvironmentFile files override settings made with Environment=". So when there is no ETCD_ADVERTISE_CLIENT_URLS set in /etc/etcd/etcd.conf, the one defined in service file by Environment is taken. If ETCD_ADVERTISE_CLIENT_URLS is set in the config file, it overrides the one set in Environment.

[1] http://www.freedesktop.org/software/systemd/man/systemd.exec.html#EnvironmentFile=

Colin, can you verify?

Comment 5 Jan Chaloupka 2015-07-01 07:46:16 UTC
Sorry, it is:

Environment="ETCD_ADVERTISE_CLIENT_URLS=http://localhost:2379"

Comment 6 Jan Chaloupka 2015-07-07 00:51:21 UTC
Colin,

> This is definitely an unfortunate bug. The only thing I can think to do here
> is to check on startup (via a patch in the code)
> whether ETCD_LISTEN_CLIENT_URLS="http://localhost:2379" and is unset,
> then set the latter to "http://localhost:2379".

IINM, ETCD_LISTEN_CLIENT_URLS does not have to be set to "http://localhost:2379" only. 2379 and 4001 ports are preferred/allocated ports. However, there is nothing that stops administrator from using different ports for some reason.

What should be ETCD_ADVERTISE_CLIENT_URLS set to then? It is a good sign that etcd fails to start. If we decide to patch the source code/service file ETCD_ADVERTISE_CLIENT_URLS can be set to incorrect value. Then it will be more difficult to find out why etcd is not working as it is expected.

Besides in future other flags/envs can become mandatory and then patch etcd for each use case ... Would like to see this as an improvement of documentation to atomic host/etcd rather than patch etcd itself.

As Jake writes:
> Additional info:
> This appears to only be affecting Atomic Host, as on RHEL hosts it either
> works or drops an etcd.conf.rpmnew, whereas on AH there is no rpmnew file.

This seems to me as a bug in atomic host that is not providing rpmnew file.

This way or another update of etcd.conf is the correct fix, not patching/hacking etcd.

Comment 7 Jan Chaloupka 2015-07-07 00:52:45 UTC
Created attachment 1049015 [details]
set ETCD_ADVERTISE_CLIENT_URLS to ETCD_LISTEN_CLIENT_URLS if empty

Comment 8 Jan Chaloupka 2015-07-07 00:56:34 UTC
Colin,

the attached patch sets ETCD_ADVERTISE_CLIENT_URLS to ETCD_LISTEN_CLIENT_URLS if the former is empty. When a customer has ETCD_LISTEN_CLIENT_URLS set to different value then the default one he is responsible for setting ETCD_LISTEN_CLIENT_URLS to the correct value as well. So I don't think it is necessary to test for localhost infix.

Can you verify the patch?

Thanks
Jan

Comment 12 errata-xmlrpc 2015-08-06 00:51:37 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2015-1571.html

Comment 13 Red Hat Bugzilla 2023-09-14 03:01:20 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 1000 days


Note You need to log in before you can comment on or make changes to this bug.