Bug 30409 - repository/online/server is set to local system without having a local repository
repository/online/server is set to local system without having a local reposi...
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: Update - Repository administration
UCS 3.0
Other Linux
: P3 normal (vote)
: UCS 3.1-1
Assigned To: Philipp Hahn
Stefan Gohmann
:
: 25374 28060 (view as bug list)
Depends on:
Blocks: 30990
  Show dependency treegraph
 
Reported: 2013-02-13 09:29 CET by Tim Petersen
Modified: 2013-08-28 13:41 CEST (History)
4 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
Cleanup (8.02 KB, patch)
2013-02-27 21:51 CET, Philipp Hahn
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tim Petersen univentionstaff 2013-02-13 09:29:28 CET
This occured at least at these forum threads:
http://forum.univention.de/viewtopic.php?f=48&t=2379&p=8116
http://forum.univention.de/viewtopic.php?f=48&t=2365&p=8075
http://forum.univention.de/viewtopic.php?f=48&t=2375&p=8070
http://forum.univention.de/viewtopic.php?f=48&t=2304&p=7980
http://forum.univention.de/viewtopic.php?f=70&t=2140&p=7490
http://forum.univention.de/viewtopic.php?f=28&t=2137&p=7475


Here is the output of the important ucr values from one case as an example (component variables are stripped off due to better visibility):
###########################################################################
local/repository: <empty>
online/repository/clean: <empty>
repository/mirror/architectures: <empty>
repository/mirror/basepath: /var/lib/univention-repository
repository/mirror/httpmethod: <empty>
repository/mirror/port: <empty>
repository/mirror/prefix: <empty>
repository/mirror/recreate_packages: yes
repository/mirror/server: <empty>
repository/mirror/sources: <empty>
repository/mirror/threads: 10
repository/mirror/version/end: <empty>
repository/mirror/version/start: <empty>
repository/mirror: false
repository/online/architectures: <empty>
repository/online/errata/start: 130
repository/online/hotfixes: no
repository/online/httpmethod: <empty>
repository/online/maintained: yes
repository/online/port: 80
repository/online/prefix: <empty>
repository/online/server: univention-repository.meinedomain.de
repository/online/sources: <empty>
repository/online/unmaintained: no
repository/online: yes
############################################################################

As you can see the problem is "repository/online/server". We saw this issue quite often and there might be more forum threads with this problem.

"repository/online/server" is set to "univention-repository.<hostname>.<domainname>" there and till now we were not able to track this down.

It seems that this only occured on c't editions.
Comment 1 Stefan Gohmann univentionstaff 2013-02-13 09:40:05 CET
Can you provide a package list and a replog of UCR? Maybe updater.log* and installation.log* are also helpful.
Comment 2 Tim Petersen univentionstaff 2013-02-13 09:48:20 CET
(In reply to comment #1)
> Can you provide a package list and a replog of UCR? Maybe updater.log* and
> installation.log* are also helpful.

Unfortunately not, as this only occured at forum posts. The only updater.logs we have show the updates after fixing the variable.

We should keep this in mind and ask for an usi if it occurs again in the forum.
Comment 3 Tim Petersen univentionstaff 2013-02-14 07:32:43 CET
Again happened at http://forum.univention.de/viewtopic.php?f=67&t=2397&p=8150.
I'll try to get some information.
Comment 4 Tim Petersen univentionstaff 2013-02-14 16:21:24 CET
"unfortunately" the customer reinstalled the system.
Comment 5 Stefan Gohmann univentionstaff 2013-02-14 21:24:39 CET
*** Bug 28060 has been marked as a duplicate of this bug. ***
Comment 6 Stefan Gohmann univentionstaff 2013-02-14 21:26:33 CET
(In reply to comment #5)
> *** Bug 28060 has been marked as a duplicate of this bug. ***

Another non-c't reporter.
Comment 7 Stefan Gohmann univentionstaff 2013-02-15 08:12:24 CET
(In reply to comment #6)
> (In reply to comment #5)
> > *** Bug 28060 has been marked as a duplicate of this bug. ***
> 
> Another non-c't reporter.

Maybe in this case was univention-debmirror installed which is allowed to change the setting. Or the DNS alias for univention-repository exists.
Comment 8 Tim Petersen univentionstaff 2013-02-26 07:47:58 CET
Another case in the forum - I'll try to fetch an usi again...
Comment 9 Philipp Hahn univentionstaff 2013-02-27 21:50:08 CET
This looks like its causes by the "ucr.save()" from UMC.
Examples for repository/online/server:
  univention-repository.meinedomain.de
  univention-repository.lw-systems.net
  univention.test-dc.com


There are two code path, were repository/online/server is set:

1.

svn34070 for Bug #26765 introduced a bug in univention-debmirror/77univention-debmirror.inst:
...
> if is_ucr_true "local/repository"
> then
...
> 	FQDN="$hostname.$domainname"
...
> fi
...
> univention-config-registry set \
> 	repository/online/server="$FQDN" \

FQDN is undefined if local/repository is not enabled. This in only done on upgrades, not on fresh installs.
Then repository/online/server is then set to the empty string.

2.

On the next upgrade of univention-upgrade.postinst finds univention-repository.$domainname and invokes
  univention-config-registry set repository/online/server?"univention-repository.$domainname"


But ucr set with ? doesn't trigger on empty UCRVs, only on unset UCRVs.
TBC...
Comment 10 Philipp Hahn univentionstaff 2013-02-27 21:51:59 CET
Created attachment 5103 [details]
Cleanup

Remove duplicate chmod
Remove reminder of Bug #13220
Fix undefined FQDN
Pylint cleanup for univention-policy-set-repository-server
Comment 11 Stefan Gohmann univentionstaff 2013-02-28 06:36:53 CET
(In reply to comment #9)
> This looks like its causes by the "ucr.save()" from UMC.
> Examples for repository/online/server:
>   univention-repository.meinedomain.de
>   univention-repository.lw-systems.net
>   univention.test-dc.com
> 
> 
> There are two code path, were repository/online/server is set:
> 
> 1.
> 
> svn34070 for Bug #26765 introduced a bug in
> univention-debmirror/77univention-debmirror.inst:
> ...
> > if is_ucr_true "local/repository"
> > then
> ...
> > 	FQDN="$hostname.$domainname"
> ...
> > fi
> ...
> > univention-config-registry set \
> > 	repository/online/server="$FQDN" \
> 
> FQDN is undefined if local/repository is not enabled. This in only done on
> upgrades, not on fresh installs.
> Then repository/online/server is then set to the empty string.

In this case univention-debmirror must be already installed, then local/repository is set and the local system is configured as repository server.

> 2.
> 
> On the next upgrade of univention-upgrade.postinst finds
> univention-repository.$domainname and invokes
>   univention-config-registry set
> repository/online/server?"univention-repository.$domainname"
> 
> 
> But ucr set with ? doesn't trigger on empty UCRVs, only on unset UCRVs.
> TBC...

That could make sense. The error occurred mostly for c't users and they have often configured an external nameserver. The external nameserver maybe give an answer for every host query.

It could be an easy fix to ask directly the LDAP for the DNS alias.
Comment 12 Philipp Hahn univentionstaff 2013-02-28 16:34:12 CET
(In reply to comment #11)
> (In reply to comment #9)
> > 2.
> > 
> > On the next upgrade of univention-upgrade.postinst finds
> > univention-repository.$domainname and invokes
> >   univention-config-registry set
> > repository/online/server?"univention-repository.$domainname"
> > 
> > But ucr set with ? doesn't trigger on empty UCRVs, only on unset UCRVs.
> > TBC...
> 
> That could make sense. The error occurred mostly for c't users and they have
> often configured an external nameserver. The external nameserver maybe give an
> answer for every host query.

<http://en.wikipedia.org/wiki/Wildcard_DNS_record#Registries.2FISPs_that_employ_wildcards>

$ host univention-repository.univention.kr ; echo $?
univention-repository.univention.kr has address 222.231.8.226
0

I personally also know about some (wireless) routers, which re-dreict every access to a login page.

> It could be an easy fix to ask directly the LDAP for the DNS alias.

The call is done in univention-updater.postinst, which is done during installation when LDAP is not yet available.

Implemented change: svn39319..25
Always set repository/online/server?"updates.software-univention.de" and advise the admin to setup a policies/repositoryserver to change the server to a local repository server.

Since we can't change the version already shipped on the c't DVD, the change well be done for 3.1-1.

univention-updater_8.0.68-2.1162.201302281628

ChangeLog: svn16620
\item The \ucsName{univention-updater} now always configures \ucrUrl{updates.software-univention.de} as the repository server during the first installation, because some external DNS servers always return a valid address for \emph{univention-repository.\$domainname}. If a local repository is used, the \ucsUCRV{repository/online/server} must be changed manu
ally, best through a Repository Policy (\ucsBug{30409}).
Comment 13 Philipp Hahn univentionstaff 2013-03-19 10:00:29 CET
Format fix: Use Python raw string, because the backslash at the end of the output is for the Shell and not Python.

svn39685, univention-updater_8.0.77-2.1172.201303190957
ChangeLog: ±0
Comment 14 Stefan Gohmann univentionstaff 2013-03-19 14:24:36 CET
Tests: OK

Changelog: OK
Comment 15 Stefan Gohmann univentionstaff 2013-03-25 19:57:10 CET
UCS 3.1-1 has been released: 
 http://download.univention.de/doc/release-notes-3.1-1_en.pdf
 http://download.univention.de/doc/release-notes-3.1-1.pdf

If this error occurs again, please use "Clone This Bug".
Comment 16 Philipp Hahn univentionstaff 2013-04-04 08:23:35 CEST
*** Bug 25374 has been marked as a duplicate of this bug. ***
Comment 17 Moritz Muehlenhoff univentionstaff 2013-08-28 13:41:01 CEST
http://errata.univention.de/ucs/3.1/171.html