What app is this about, and its version : Nextcloud upgrading from 32.0.6~ynh1 to 33.0.2~ynh1
What YunoHost version are you running : 12.1.39
What type of hardware are you using : Old laptop or computer
Describe your issue
I have been trying to update Nextcloud for a few weeks now but it’s failing. I’ve examined the debug log but I can’t tell what the issue is. The update script fails right after the ldapEmail= line, but I am not sure if that is the smoking gun or not. I have read through a dozen or so other forum issues related to upgrading Nextcloud, but they describe issues that seem unrelated to mine or have resolutions that did not help in my case.
The URL for the log is pasted below, thanks for taking a look! Please let me know if you have any questions or suggestions.
Share relevant logs or error messages
https://paste.yunohost.org/raw/xuremezufa
Seems similar at this issue
It seems you haven’t the valuefor ldapEmail
Normally it should be a value mail or maildrop
Can you verify if you have two ldap configurations in the admin of nextcloud =>
some time a new one which is empty is created.
what returns
yunohost app setting nextcloud enable_forward_email
Can you verify if you have two ldap configurations in the admin of nextcloud =>
some time a new one which is empty is created, you can keep just one, take care that the LDAP must have the values for communicat…
You need define the value for `ldapEmail`
If nextcloud is restored try this to see if it’s configured
what returns :
yunohost app shell nextcloud
php occ ldap:show-config s02 | grep ldapEmailAttribute
and
yunohost app setting nextcloud enable_forward_email
I do not have s02for some reason:
nextcloud@yunohost:\~$ php occ ldap:show-config s02
Invalid configID
I have a s03 config, and also another one where the name of the config appears to be blank. They both have mail as the value for ldapEmailAttribute.
nextcloud@yunohost:~$ php occ ldap:show-config | grep ldapEmailAttribute
| ldapEmailAttribute | mail |
| ldapEmailAttribute | mail |
This command does not have any output. I ran the update again after running it, but it has not changed the result. https://paste.yunohost.org/raw/locizukuji
So you have the same issue as explain here
So, a closer look into the upgrade script revealed, that my situation (having ldap config without prefix used to be normal) had already been contemplated by alexAubin, thus modifying the setting ldap_config_prefix from ldap_config_prefix: s02 to ldap_config_prefix: '' was sufficient to take advantage of the upgrade logic and smoothly transition to 32.0.6!
# Before NCv32, Yunohost was not using any prefix for the LDAP config.
# This is now mandatory so we need to create a new config with a prefi…
You need have a prefix for LDAP config…
try a shell in nextcloud
yunohost app shell nextcloud
and then then copy-paste this bloc
if [ "$ldap_config_prefix" = "" ]
then
ldap_config_prefix=$(exec_occ ldap:create-empty-config --only-print-prefix)
ynh_app_setting_set --key=ldap_config_prefix --value="$ldap_config_prefix"
fi
I did read that issue, but I am not sure how to benefit from the script they referenced.
So, a closer look into the upgrade script revealed, that my situation (having ldap config without prefix used to be normal) had already been contemplated by alexAubin, thus modifying the setting ldap_config_prefix from ldap_config_prefix: s02 to ldap_config_prefix: '' was sufficient to take advantage of the upgrade logic and smoothly transition to 32.0.6!
# Before NCv32, Yunohost was not using any prefix for the LDAP config.
# This is now mandatory so we need to create a new config with a prefix.
if [ "$ldap_config_prefix" = "" ]
then
ldap_config_prefix=$(exec_occ ldap:create-empty-config --only-print-prefix)
ynh_app_setting_set --key=ldap_config_prefix --value="$ldap_config_prefix"
fi
That appears to be a change that was merged back in December: fix(ldap): Explicitly test created config by artonge · Pull Request #837 · YunoHost-Apps/nextcloud_ynh · GitHub
I guess I would think if that was the fix, I would already have it.
Edit
I didn’t see the edit to your post, hang on one sec while I try that.
Edit 2
rodinux:
try a shell in nextcloud
yunohost app shell nextcloud
and then then copy-paste this bloc
if [ "$ldap_config_prefix" = "" ]
then
ldap_config_prefix=$(exec_occ ldap:create-empty-config --only-print-prefix)
ynh_app_setting_set --k
There is no output when I run this, but unfortunately the update still fails afterward. https://paste.yunohost.org/raw/jilogenuxu
Can you look in nextcloud on admin => Parameters => Integration LDAP/AD (domain.tld/settings/admin/ldap) the differents configs ?
I have two in here, “1. Server: localhost” and “2. Server: localhost”. They both say “configuration OK” at the bottom, I’m not sure if that is relevant or not.
Ok, it’s a bad idea… So what returns this command after be connected on a shell app nextcloud
php occ ldap:show-config
Or in the admin of nextcloud also perhaps tou see differents configs in the parameters LDAP ?
It is strange because some times I also have 2 configs, I don’t understand why its looking for a s02 in the upgrade, and you say you have a s03 perhaps with same parameters…
It looks like I have s03, and a blank one.
+-------------------------------+-------------------------------------------------------------------------------------------------------------------------+
| Configuration | |
+-------------------------------+-----------------------------------------------------------------------
--------------------------------------------------+
| hasMemberOfFilterSupport | 1 |
| homeFolderNamingRule | |
| lastJpegPhotoLookup | 0 |
| ldapAdminGroup | |
| ldapAgentName | |
| ldapAgentPassword | *** |
| ldapAttributeAddress | |
| ldapAttributeAnniversaryDate | |
| ldapAttributeBiography | |
| ldapAttributeBirthDate | |
| ldapAttributeFediverse | |
| ldapAttributeHeadline | |
| ldapAttributeOrganisation | |
| ldapAttributePhone | |
| ldapAttributePronouns | |
| ldapAttributeRole | |
| ldapAttributeTwitter | |
| ldapAttributeWebsite | |
| ldapAttributesForGroupSearch | |
| ldapAttributesForUserSearch | |
| ldapBackgroundHost | |
| ldapBackgroundPort | |
| ldapBackupHost | |
| ldapBackupPort | |
| ldapBase | dc=yunohost,dc=org |
| ldapBaseGroups | ou=groups,dc=yunohost,dc=org |
| ldapBaseUsers | ou=users,dc=yunohost,dc=org |
| ldapCacheTTL | 600 |
| ldapConfigurationActive | 1 |
| ldapConnectionTimeout | 15 |
| ldapDefaultPPolicyDN | |
| ldapDynamicGroupMemberURL | |
| ldapEmailAttribute | mail |
| ldapExperiencedAdmin | 0 |
| ldapExpertUUIDGroupAttr | |
| ldapExpertUUIDUserAttr | |
| ldapExpertUsernameAttr | uid |
| ldapExtStorageHomeAttribute | |
| ldapGidNumber | gidnumber |
| ldapGroupDisplayName | cn |
| ldapGroupFilter | (&(objectclass=top)(memberUid=*)) |
| ldapGroupFilterGroups | |
| ldapGroupFilterMode | 0 |
| ldapGroupFilterObjectclass | posixGroup |
| ldapGroupMemberAssocAttr | memberuid |
| ldapHost | localhost |
| ldapIgnoreNamingRules | |
| ldapLoginFilter | (&(|(objectclass=posixAccount))(|(uid=%uid)(mail=%uid))(permission=cn=nextcloud.main,ou=permission,dc=yunohost,dc=org)) |
| ldapLoginFilterAttributes | |
| ldapLoginFilterEmail | 0 |
| ldapLoginFilterMode | 0 |
| ldapLoginFilterUsername | 1 |
| ldapMatchingRuleInChainState | unknown |
| ldapNestedGroups | 0 |
| ldapOverrideMainServer | |
| ldapPagingSize | 500 |
| ldapPort | 389 |
| ldapQuotaAttribute | userquota |
| ldapQuotaDefault | |
| ldapTLS | 0 |
| ldapUserAvatarRule | default |
| ldapUserDisplayName | displayname |
| ldapUserDisplayName2 | |
| ldapUserFilter | objectclass=posixAccount |
| ldapUserFilterGroups | |
| ldapUserFilterMode | 0 |
| ldapUserFilterObjectclass | posixAccount |
| ldapUuidGroupAttribute | auto |
| ldapUuidUserAttribute | auto |
| markRemnantsAsDisabled | 0 |
| turnOffCertCheck | 0 |
| turnOnPasswordChange | 0 |
| useMemberOfToDetectMembership | 1 |
+-------------------------------+-------------------------------------------------------------------------------------------------------------------------+
+-------------------------------+------------------------------------------------+
| Configuration | s03 |
+-------------------------------+------------------------------------------------+
| hasMemberOfFilterSupport | 1 |
| homeFolderNamingRule | |
| lastJpegPhotoLookup | 0 |
| ldapAdminGroup | |
| ldapAgentName | |
| ldapAgentPassword | *** |
| ldapAttributeAddress | |
| ldapAttributeAnniversaryDate | |
| ldapAttributeBiography | |
| ldapAttributeBirthDate | |
| ldapAttributeFediverse | |
| ldapAttributeHeadline | |
| ldapAttributeOrganisation | |
| ldapAttributePhone | |
| ldapAttributePronouns | |
| ldapAttributeRole | |
| ldapAttributeTwitter | |
| ldapAttributeWebsite | |
| ldapAttributesForGroupSearch | |
| ldapAttributesForUserSearch | |
| ldapBackgroundHost | |
| ldapBackgroundPort | |
| ldapBackupHost | |
| ldapBackupPort | |
| ldapBase | dc=yunohost,dc=org |
| ldapBaseGroups | ou=groups,dc=yunohost,dc=org |
| ldapBaseUsers | ou=users,dc=yunohost,dc=org |
| ldapCacheTTL | 600 |
| ldapConfigurationActive | 1 |
| ldapConnectionTimeout | 15 |
| ldapDefaultPPolicyDN | |
| ldapDynamicGroupMemberURL | |
| ldapEmailAttribute | mail |
| ldapExperiencedAdmin | 0 |
| ldapExpertUUIDGroupAttr | |
| ldapExpertUUIDUserAttr | |
| ldapExpertUsernameAttr | uid |
| ldapExtStorageHomeAttribute | |
| ldapGidNumber | gidnumber |
| ldapGroupDisplayName | cn |
| ldapGroupFilter | (&(objectclass=top)(memberUid=*)) |
| ldapGroupFilterGroups | |
| ldapGroupFilterMode | 0 |
| ldapGroupFilterObjectclass | posixGroup |
| ldapGroupMemberAssocAttr | memberuid |
| ldapHost | localhost |
| ldapIgnoreNamingRules | |
| ldapLoginFilter | (&(&(|(objectclass=inetOrgPerson)))(uid=%uid)) |
| ldapLoginFilterAttributes | |
| ldapLoginFilterEmail | 0 |
| ldapLoginFilterMode | 0 |
| ldapLoginFilterUsername | 1 |
| ldapMatchingRuleInChainState | unknown |
| ldapNestedGroups | 0 |
| ldapOverrideMainServer | |
| ldapPagingSize | 500 |
| ldapPort | 389 |
| ldapQuotaAttribute | |
| ldapQuotaDefault | |
| ldapTLS | 0 |
| ldapUserAvatarRule | default |
| ldapUserDisplayName | displayname |
| ldapUserDisplayName2 | |
| ldapUserFilter | (&(|(objectclass=inetOrgPerson))) |
| ldapUserFilterGroups | |
| ldapUserFilterMode | 0 |
| ldapUserFilterObjectclass | inetOrgPerson |
| ldapUuidGroupAttribute | auto |
| ldapUuidUserAttribute | auto |
| markRemnantsAsDisabled | 0 |
| turnOffCertCheck | 0 |
| turnOnPasswordChange | 0 |
| useMemberOfToDetectMembership | 1 |
+-------------------------------+------------------------------------------------+
The s03 have the same values in each key isn’t it ?
Some of the values are different. I’m not really sure what the significance of the differences are, or where the two configs came from.
Ok, so there something wrong… ldap create normally configs fisrt s01 and then s02, here something is wrong and I don’t know why…
I suggest you create a config first like this
php occ ldap:create-empty-config
and then tell me if the new one created is s01 or s02 looking with the previous php occ ldap:show-config
The goal will be recreate a config s02 with good values after this
If by chance the whisper config with s02 is created, then we could provide him the values needed like this
php occ ldap:set-config s02 ldapBase "dc=yunohost,dc=org"
php occ ldap:set-config s02 ldapBaseGroups "ou=groups,dc=yunohost,dc=org"
php occ ldap:set-config s02 ldapBaseUsers "ou=users,dc=yunohost,dc=org"
php occ ldap:set-config s02 ldapCacheTTL "600",
php occ ldap:set-config s02 ldapConfigurationActive "1"
php occ ldap:set-config s02 ldapUserDisplayName "displayname"
php occ ldap:set-config s02 ldapEmailAttribute "mail"
php occ ldap:set-config s02 ldapExpertUsernameAttr "uid"
php occ ldap:set-config s02 ldapGroupDisplayName "cn"
php occ ldap:set-config s02 ldapGroupFilter "(&(objectclass=top)(memberUid=*))"
php occ ldap:set-config s02 lldapGroupFilterMode "0"
php occ ldap:set-config s02 ldapGroupFilterObjectclass "posixGroup"
php occ ldap:set-config s02 ldapGroupMemberAssocAttr "memberUid"
php occ ldap:set-config s02 ldapHost "localhost"
php occ ldap:set-config s02 ldapLoginFilter "(&(|(objectclass=posixAccount))(uid=%uid)(permission=cn=nextcloud.main,ou=permission,dc=yunohost,dc=org))"
php occ ldap:set-config s02 ldapLoginFilterMode "0"
php occ ldap:set-config s02 ldapPort "389"
php occ ldap:set-config s02 ldapQuotaAttribute "userquota"
php occ ldap:set-config s02 ldapTLS "0"
php occ ldap:set-config s02 ldapUserDisplayName "cn"
php occ ldap:set-config s02 ldapUserFilter_Mode" "0"
php occ ldap:set-config s02 ldapUserFilterObjectclass "posixAccount"
php occ ldap:set-config s02 ldapUserlistFilter": "objectclass=posixAccount"
This is the recommended from the install of the package
But in fact the attribute for ldapEmailAttribute "mail" may be a variable in the install, for the choice in the setting of the app to avoid used "maildrop" if want use foward emails…
~~Ok , I see something broken in the code about this !!~~ not sure…
Ok, I am discovering also a value you may perhaps have in the settings of the app, what’s returns
yunohost app setting nextcloud ldap_config_prefix
Perhaps it is more simple choosing the s03 config if this command show you s02 ?? It’s horrible because in the web admin you can see configurations and also remove someones, the better choice is to keep only one… But you don’t see the prefixes
rodinux:
I suggest you create a config first like this
php occ ldap:create-empty-config
and then tell me if the new one created is s01 or s02 looking with the previous php occ ldap:show-config
This gave me s04 for some reason. I though maybe I could “rename” it, but I can’t figure out any way to do that (perhaps it doesn’t work like that).
root@yunohost ~# yunohost app setting nextcloud ldap_config_prefix
s02
It seems like Nextcloud “remembers” s02 even though it is nowhere to be found.
That’s seems the mistake !! try change this key like this
yunohost app setting set nextcloud ldap_config_prefix -v "s03"
If the s03 seems good… Later we should others configs
root@yunohost ~# yunohost app setting nextcloud ldap_config_prefix -v "s03"
root@yunohost ~# yunohost app setting nextcloud ldap_config_prefix
s03
Looks good! Let me try the update now.
Edit
It worked!
Thank you so much for your help @rodinux !
1 Like
Ok… now perhaps you can remove in the admin in nextcloud oldest configs… But take care the first one, I think is the blank one, the second one I believe is the s03 and the third one may be the s04 created…
I have also cleaned my nextcloud with a blank config (without prefix , but I mistake first removing the s01 and in my settings in the one off the app… I realize the nextcloud was still using the fisrt config without prefix !
so I had to recreate a config
php occ ldap:create-empty-config
php occ ldap:set-config s01 ldapBase “dc=yunohost,dc=org”
php occ ldap:set-config s01 ldapBaseGroups “ou=groups,dc=yunohost,dc=org”
php occ ldap:set-config s01 ldapBaseUsers “ou=users,dc=yunohost,dc=org”
php occ ldap:set-config s01 ldapCacheTTL “600”
php occ ldap:set-config s01 ldapConfigurationActive “1”
php occ ldap:set-config s01 ldapUserDisplayName “displayname”
php occ ldap:set-config s01 ldapEmailAttribute “mail”
php occ ldap:set-config s01 ldapExpertUsernameAttr “uid”
php occ ldap:set-config s01 ldapGroupDisplayName “cn”
php occ ldap:set-config s01 ldapGroupFilter “(&(objectclass=top)(memberUid=*))”
php occ ldap:set-config s01 ldapGroupFilterMode “0”
php occ ldap:set-config s01 ldapGroupFilterObjectclass “posixGroup”
php occ ldap:set-config s01 ldapGroupMemberAssocAttr “memberUid”
php occ ldap:set-config s01 ldapHost “localhost”
php occ ldap:set-config s01 ldapLoginFilter “(&(|(objectclass=posixAccount))(uid=%uid)(permission=cn=nextcloud.main,ou=permission,dc=yunohost,dc=org))”
php occ ldap:set-config s01 ldapLoginFilterMode “0”
php occ ldap:set-config s01 ldapPort “389”
php occ ldap:set-config s01 ldapQuotaAttribute “userquota”
php occ ldap:set-config s01 ldapTLS “0”
php occ ldap:set-config s01 ldapUserDisplayName “cn”
php occ ldap:set-config s01 ldapUserFilterMode “0”
php occ ldap:set-config s01 ldapUserFilterObjectclass “posixAccount”
php occ ldap:set-config s01 ldapUserlistFilter “objectclass=posixAccount”
and then remove the first config to keep only the s01 new one…
1 Like