Missing fields in doctype after migration

env

ERPNext: v11.0.3-beta.34 () (staging)
Frappe Framework: v11.0.3-beta.48 () (staging)
OS: Debian GNU/Linux 8.11 (jessie)

issue

Migrated to v11 staging + python3.
Ran bench --site site1.local migrate and all related commands.
Everything seemed fine until I wanted to use LDAP login. It didn’t work. Apart from this non-issue I ran into problem that now when trying to log in “StartTLS is not supported” error is shown. Exception message is following: 'LDAPSettings' object has no attribute 'ssl_tls_mode' (see here, here). After little investigation found out that /doctype/ldap_settings/ldap_settings.json got new fields, but when I open “LDAP Settings” via erpnext i see old set of fields (missing the new ones).

@hpema108 @felix @saurabh6790

do again bench migrate command

Ran following:

  • bench migrate-env python3.6
  • bench migrate
    • bench --site site1.local migrate
    • bench --site all migrate
  • bench --site all bench clear-cache
  • bench --site all bench clear-website-cache

didn’t help.

Also ran:

  • bench update
  • bench migrate
  • bench clear-cache
  • bench clear-website-cache

Same result.

Checked again apps/frappe/frappe/integrations/doctype/ldap_settings/ldap_settings.json to confirm it has new fields. But LDAP Settings editing new fields do not show up.

Adding missing fields to ldap_settings doctype via ErpNext DocType editor according to ldap_settings.json file changes. Fixed the issue.
After saving doctype and validating that ldap works, reverted code changes.
Apparently for some reason DocType wasn’t updating in database.

Marking as solved, but haven’t figured out what was the reason for problem to appear in the first place.

UPDATE
Was thinking that somehow during all uapdes migrations and so on I’ve put system into state that it wasn’t able to peroperly migrate. But after clean install py2 master production and migrating to staging py3 resulted in the same issue, wich indicated that migration process isn’t robust.

2 Likes