[RTFACT-14687] System import from Artifactory < 5.4 to Arifactory > 5.4 running in HA mode fails Created: 30/Jul/17  Updated: 27/Aug/18  Resolved: 06/Nov/17

Status: Resolved
Project: Artifactory Binary Repository
Component/s: Import/export
Affects Version/s: 5.4.0, 5.4.1, 5.4.2, 5.4.3, 5.4.4, 5.4.5
Fix Version/s: 5.6.0

Type: Bug Priority: Critical
Reporter: Andrei Komarov Assignee: Gal Ben Ami
Resolution: Fixed Votes: 2
Labels: None

Issue Links:
Duplicate
duplicates RTFACT-14690 System export of 4.14.2 cannot be imp... Open
Relationship
is related to RTFACT-15092 Exporting on 5.4.4 and importing on t... Open
Regression:
Yes

 Description   

The following list includes HA (tested) system exports and imports that work and range of versions that do not work, contrary to the past:

Successful imports:

5.4.5 -> 5.4.5 works
5.4.0 -> 5.4.5 works
5.4.0 -> 5.4.0 works

Failing:

5.2.1, 5.3.2 -> 5.4.0 ,5.4.5 fails

Evident exception (Access related) in the artifactory.log:

2017-07-26 13:35:11,129 [http-nio-8081-exec-10] [INFO ] (o.a.u.r.s.a.i.i.ImportSystemService:163) - Importing from directory...
2017-07-26 13:35:11,136 [http-nio-8081-exec-10] [INFO ] (o.a.s.ArtifactoryApplicationContext:481) - ### Beginning full system import ###
2017-07-26 13:35:11,147 [http-nio-8081-exec-10] [WARN ] (o.a.v.ArtifactoryVersionReader:84) - Closest matched version: 5.3.2
...
2017-07-26 13:35:11,322 [http-nio-8081-exec-10] [INFO ] (o.a.d.r.CentralConfigReader:78) - The current Artifactory config schema namespace is 'http://artifactory.jfrog.org/xsd/2.0.5' The provided config does not seem to be compliant with it.
2017-07-26 13:35:11,324 [http-nio-8081-exec-10] [INFO ] (o.a.d.r.CentralConfigReader:58) - Converting artifactory.config.xml version from 'v203' to 'v205'
...
2017-07-26 13:35:13,936 [http-nio-8081-exec-10] [INFO ] (o.a.s.ArtifactoryApplicationContext:433) - Artifactory application context set to NOT READY by reload
2017-07-26 13:35:14,003 [http-nio-8081-exec-10] [INFO ] (o.a.a.h.p.HaPropagationServiceImpl:119) - Recovering from an invalid communication token in file '/opt/jfrog/artifactory/etc/security/communication.token' (token failed verification) - deleting the existing token file and generating a new token.
2017-07-26 13:35:14,020 [http-nio-8081-exec-10] [ERROR] (o.a.s.a.AccessServiceImpl:322) - Failed to create token for subject 'jf-artifactory@54cec804-e78f-48b1-947f-002299fb33f4/nodes/node-f8eb00e73fe4': HTTP response status 401:{
  "errors" : [ {
    "code" : "UNAUTHORIZED",
    "message" : "Authentication required"
  } ]
}
2017-07-26 13:35:14,036 [http-nio-8081-exec-10] [INFO ] (o.a.s.ArtifactoryApplicationContext:433) - Artifactory application context set to READY by reload on error: Failed to create token for subject 'jf-artifactory@54cec804-e78f-48b1-947f-002299fb33f4/nodes/node-f8eb00e73fe4'.
2017-07-26 13:35:14,050 [http-nio-8081-exec-10] [ERROR] (o.a.c.CentralConfigServiceImpl:449) - Failed to reload configuration: Failed to create token for subject 'jf-artifactory@54cec804-e78f-48b1-947f-002299fb33f4/nodes/node-f8eb00e73fe4'.
java.lang.RuntimeException: Failed to create token for subject 'jf-artifactory@54cec804-e78f-48b1-947f-002299fb33f4/nodes/node-f8eb00e73fe4'.
	at org.artifactory.security.access.AccessServiceImpl.createToken(AccessServiceImpl.java:324) ~[artifactory-core-5.4.5.jar:na]
...
2017-07-26 13:35:14,060 [http-nio-8081-exec-10] [ERROR] (o.a.s.ArtifactoryApplicationContext:525) - Failed system import
java.lang.RuntimeException: Failed to generate service admin token using bootstrap credentials.
...
Caused by: java.lang.RuntimeException: Failed to reload configuration: Failed to create token for subject 'jf-artifactory@54cec804-e78f-48b1-947f-002299fb33f4/nodes/node-f8eb00e73fe4'.
...
2017-07-26 13:35:14,062 [http-nio-8081-exec-10] [ERROR] (o.a.u.r.s.a.i.i.ImportSystemService:146) - Error while importing system from '/var/opt/jfrog/artifactory/export/20170726.132019': Failed system import

Cause:
Access Http Client is not re-initialized with the imported credentials.
Therefore the next time Artifactory needs to generate communication.token it is failing.


Generated at Sat May 30 08:38:53 UTC 2020 using Jira 8.5.3#805003-sha1:b4933e02eaff29a49114274fe59e1f99d9d963d7.