Bug 34414 - Confusing (mixed) error message "E: Option The property Service Name is required is not valid"
Confusing (mixed) error message "E: Option The property Service Name is requi...
Status: RESOLVED WONTFIX
Product: UCS
Classification: Unclassified
Component: univention-lib
UCS 4.1
All Linux
: P5 minor (vote)
: ---
Assigned To: UCS maintainers
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-03-28 13:40 CET by Philipp Hahn
Modified: 2019-01-03 07:19 CET (History)
2 users (show)

See Also:
What kind of report is it?: Development Internal
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:
best: Patch_Available+


Attachments
check parameters in ldap.sh for empty values. (7.07 KB, patch)
2014-03-28 13:40 CET, Philipp Hahn
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Philipp Hahn univentionstaff 2014-03-28 13:40:49 CET
Created attachment 5841 [details]
check parameters in ldap.sh  for empty values.

Accidentally caused by:
        SERVICE=''
	ucs_addServiceToLocalhost "$SERVICE" "$@" ||
		die "Failed to register service '$SERVICE' on host in LDAP."

Seems to be a mix of two error messages:

$ git grep -n "The property.*is required" -- \*.py
management/univention-directory-manager-modules/modules/univention/admin/handlers/__init__.py:215:              
        raise univention.admin.uexceptions.valueRequired, _('The property %s is required') % self.descriptions[key].short_description

management/univention-directory-manager-modules/modules/univention/admincli/admin.py:798:                       
        out.append('E: Option %s is not valid' %err)


Without digging further into UDM, our shell libraries should probably converted to using '${var:?error message}', which not only checks if the parameter is supplied, but also that is non-empty.
This is also supported by dash.
Notice the following change in behavior: on errors the shell will immediately "exit 2" and not "return 2", which would terminate the script only when combined with "set -e".
Comment 1 Stefan Gohmann univentionstaff 2019-01-03 07:19:43 CET
This issue has been filled against UCS 4.1. The maintenance with bug and security fixes for UCS 4.1 has ended on 5st of April 2018.

Customers still on UCS 4.1 are encouraged to update to UCS 4.3. Please contact
your partner or Univention for any questions.

If this issue still occurs in newer UCS versions, please use "Clone this bug" or simply reopen the issue. In this case please provide detailed information on how this issue is affecting you.