Importing users xml fails with missing user group name node element

I have a very small users xml file with one group and one user (using the sample xml as a guide):

<?xml version="1.0" encoding="UTF-8"?>
<PKPUsers xmlns="http://pkp.sfu.ca" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pkp.sfu.ca pkp-users.xsd">
    <user_groups xsi:schemaLocation="http://pkp.sfu.ca pkp-users.xsd">
        <user_group>
            <role_id>65536</role_id>
            <context_id>8</context_id>
            <is_default>true</is_default>
            <show_title>false</show_title>
            <permit_self_registration>true</permit_self_registration>
            <name locale="de_DE">Autor/in</name>
            <name locale="en_US">Author</name>
            <name locale="es_ES">Autor</name>
            <name locale="fr_FR">Auteur</name>
            <name locale="pt_BR">Autor</name>
            <name locale="pt_PT">Autor</name>
            <name locale="zh_CN">##default.groups.name.author##</name>
            <abbrev locale="de_DE">AU</abbrev>
            <abbrev locale="en_US">AU</abbrev>
            <abbrev locale="es_ES">AU</abbrev>
            <abbrev locale="fr_FR">AU</abbrev>
            <abbrev locale="pt_BR">AU</abbrev>
            <abbrev locale="pt_PT">AU</abbrev>
            <abbrev locale="zh_CN">##default.groups.abbrev.author##</abbrev>
            <stage_assignments>1:3:4:5</stage_assignments>
        </user_group>
    </user_groups>
	<users>
		<user>
			<firstname>John</firstname>
			<lastname>Author</lastname>
			<email>john@author.com</email>
			<username>author</username>
			<password is_disabled="false" must_change="true">
                <value/>
            </password>
			<date_registered>2018-01-08 00:00:00</date_registered>
			<date_last_login>2018-01-08 00:00:00</date_last_login>
			<inline_help>true</inline_help>
			<user_group_ref>Author</user_group_ref>
		</user>
	</users>
</PKPUsers>

When I attempt to import from the webui, it seems to import but displays a blank file (when my xml was missing particular xml elements it would tell me which ones were missing).

The user_group element is directly copied from a previous OJS users xml export.

The errors I see in the logs (with stack trace on) are:

[Mon Jan 08 18:01:53.111558 2018] [:error] [pid 1594] [client 121.44.38.108:33772] ojs2: unable to find “name” userGroup node element. Check import XML document structure for validity., referer: http://…/journal/management/importexport/plugin/UserImportExportPlugin

However, the user_group has several name elements.

Any help much appreciated.

Further to my previous post, importing from the command line yields additional errors:

<h1>unable to find &quot;name&quot; userGroup node element.  Check import XML document structure for validity.</h1><h4>Stack Trace:</h4>
<strong>File:</strong> /var/www/html/lib/pkp/plugins/importexport/native/filter/NativeImportFilter.inc.php line 60<br />
<strong>Function:</strong> NativeXmlUserGroupFilter->handleElement(Object(DOMElement))<br />
<br/>
<strong>File:</strong> /var/www/html/lib/pkp/classes/filter/Filter.inc.php line 449<br />
<strong>Function:</strong> NativeImportFilter->process(Object(DOMDocument))<br />
<br/>
<strong>File:</strong> /var/www/html/lib/pkp/plugins/importexport/users/filter/UserXmlPKPUserFilter.inc.php line 63<br />
<strong>Function:</strong> Filter->execute(Object(DOMDocument))<br />
<br/>
<strong>File:</strong> /var/www/html/lib/pkp/plugins/importexport/users/filter/UserXmlPKPUserFilter.inc.php line 193<br />
<strong>Function:</strong> UserXmlPKPUserFilter->parseUserGroup(Object(DOMElement))<br />
<br/>
<strong>File:</strong> /var/www/html/lib/pkp/plugins/importexport/users/filter/UserXmlPKPUserFilter.inc.php line 180<br />
<strong>Function:</strong> UserXmlPKPUserFilter->handleChildElement(Object(DOMElement))<br />
<br/>
<strong>File:</strong> /var/www/html/lib/pkp/plugins/importexport/native/filter/NativeImportFilter.inc.php line 51<br />
<strong>Function:</strong> UserXmlPKPUserFilter->handleElement(Object(DOMElement))<br />
<br/>
<strong>File:</strong> /var/www/html/lib/pkp/classes/filter/Filter.inc.php line 449<br />
<strong>Function:</strong> NativeImportFilter->process(Object(DOMDocument))<br />
<br/>
<strong>File:</strong> /var/www/html/lib/pkp/plugins/importexport/users/PKPUserImportExportPlugin.inc.php line 218<br />
<strong>Function:</strong> Filter->execute(Object(DOMDocument))<br />
<br/>
<strong>File:</strong> /var/www/html/plugins/importexport/users/UserImportExportPlugin.inc.php line 82<br />
<strong>Function:</strong> PKPUserImportExportPlugin->importUsers("&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;PKPUsers xmlns=&quot;http://p...", Object(Journal), Null)<br />
<br/>
<strong>File:</strong> /var/www/html/tools/importExport.php line 63<br />
<strong>Function:</strong> UserImportExportPlugin->executeCLI("/var/www/html/tools/importExport.php", Array(0))<br />
<br/>
<strong>File:</strong> /var/www/html/tools/importExport.php line 69<br />
<strong>Function:</strong> importExport->execute()<br />
<br/>
ojs2: unable to find "name" userGroup node element.  Check import XML document structure for validity.

Hi @haydenyoung,

I think the problem is the 2 untranslated locale strings (e.g., ##default.groups.name.author##). It looks like this user had a similar problem: OJS 3.x import/export of users - #3 by asmecher. Can you try following the suggestions offered there?

Best,
Amanda Stevens
Public Knowledge Project Team

Thanks for the suggestion. It turned out the problem was with the numerous translated names and abbrevs. Removing all of them and simply having <name locale="en_us"/> and <abbrev locale="en_US"/> XML elements fixed the problem.

Thanks

Hayden Young
https://www.knowledgearc.com

Hi @haydenyoung,

That’s great to hear! Thanks for posting your fix. It will help other users.

Best,
Amanda Stevens
Public Knowledge Project Team