Jump to content


P4DTG JIRA not working (statusCode=Optional.absent())


  • Please log in to reply
5 replies to this topic

#1 Skylonxe

Skylonxe

    Member

  • Members
  • PipPip
  • 13 posts

Posted 17 April 2020 - 04:56 PM

I configured and setup P4DTG for JIRA on Windows, everything seems to be running correctly but tasks/issues are not replicated to P4D. I belive it may be caused by using outdated JIRA API.

log
2020/04/17 16:28:05 UTC: Log opened
2020/04/17 16:28:05 UTC: Rev. p4dtg-repl/NTX64/2018.1/1699871
2020/04/17 16:28:05 UTC: 2018 09 11
2020/04/17 16:28:05 UTC: Root: .\
2020/04/17 16:28:05 UTC: SettingFile: .\config\set-JIRA.xml
2020/04/17 16:28:05 UTC: Start: 2020/04/16 13:00:00
2020/04/17 16:28:05 UTC: SCMLast: 2020/04/17 16:15:31
2020/04/17 16:28:05 UTC: DTSLast: 2020/04/17 18:15:31
2020/04/17 16:28:05 UTC: Force Update: Yes
2020/04/17 16:28:05 UTC: MappingFile: .\config\map-JIRA.xml
2020/04/17 16:28:05 UTC: SCMSourceFile: .\config\src-P4V.xml
2020/04/17 16:28:05 UTC: DTSSourceFile: .\config\src-Jira.xml
2020/04/17 16:28:05 UTC: PluginDir: .\plugins
2020/04/17 16:28:05 UTC: Loaded Plugin: .\plugins\p4jobdt.dll:
2020/04/17 16:28:05 UTC: Perforce Jobs (Rev. p4jobdt/NTX64/2018.1/1699871 2018 09 11)
2020/04/17 16:28:05 UTC: Loaded Plugin: .\plugins\redminemysql5.dll:
2020/04/17 16:28:05 UTC: Redmine MySQL 5 (Rev. redminemysql5/NTX64/2018.1/1699871 2018 09 11)
2020/04/17 16:28:05 UTC: Loaded Plugin: .\plugins\mysql5.dll:
2020/04/17 16:28:05 UTC: MySQL 5 (Rev. Perforce Jobs to MySQL5 plugin NTX64/2018.1/1699871 2018 09 11)
2020/04/17 16:28:05 UTC: Loaded Plugin: .\plugins\jirarest.dll:
2020/04/17 16:28:05 UTC: JIRA-REST (Rev. jirarest/NTX64/2018.1/1699871 2018 09 11)
2020/04/17 16:28:05 UTC: Loaded Plugin: .\plugins\jiradtg.dll:
2020/04/17 16:28:05 UTC: JIRA (Rev. jiradtg/NTX64/2018.1/1699871 2018 09 11)
2020/04/17 16:28:05 UTC: Loaded Plugin: .\plugins\bugz3mysql5.dll:
2020/04/17 16:28:05 UTC: Bugzilla 3 MySQL 5 (Rev. bugz3mysql5/NTX64/2018.1/1699871 2018 09 11)
2020/04/17 16:28:05 UTC: Map Attr: log_level=3
2020/04/17 16:28:05 UTC: Map Attr: wait_duration=5
2020/04/17 16:28:05 UTC: Map Attr: polling_period=2
2020/04/17 16:28:05 UTC: Log Level: 3
2020/04/17 16:28:05 UTC: Polling Period: 2
2020/04/17 16:28:05 UTC: Connection Reset: 1000
2020/04/17 16:28:05 UTC: General offline wait duration: 5
2020/04/17 16:28:05 UTC: Cycle Logging Threshold: 0
2020/04/17 16:28:05 UTC: Cycle Logging Update Period: 0
2020/04/17 16:28:05 UTC: Enable write to SCM read-only: 0
2020/04/17 16:28:12 UTC: Recheck on new SCM: N
2020/04/17 16:28:12 UTC: Recheck on new DTS: N
2020/04/17 16:28:12 UTC: Valid map SCM - P4V: ssl:xxxxxxxx.com:1666
2020/04/17 16:28:12 UTC: Server version: P4D/LINUX26X86_64/2019.1/1927394 (2020/03/04)
2020/04/17 16:28:12 UTC: SCM Attr: charset=iso8859-15
2020/04/17 16:28:12 UTC: SCM Attr: sub_missing=y
2020/04/17 16:28:12 UTC: SCM Attr: gen_jobname=y
2020/04/17 16:28:12 UTC: Valid map DTS - Jira: https://xxxxxxxx.atlassian.net:443
2020/04/17 16:28:12 UTC: Server version: 1.0
2020/04/17 16:28:12 UTC: Attributes passed into plug-in:
charset: iso8859-15
sub_missing: y
gen_jobname: y
DTG-MapID: JIRA
DTG-SrcID: P4V
DTG-LogLevel: 3
2020/04/17 16:28:12 UTC: Referenced fields are: Comments, Description, Summary, Assignee, Reporter, Sprint, Status/Resolution, Priority, Updated, Due Date, Fix
2020/04/17 16:28:18 UTC: Start date at SCM: 2020/04/17 16:28:18
2020/04/17 16:28:18 UTC: Start date at DTS: 2020/04/17 18:28:18
2020/04/17 16:28:18 UTC: List DTS Defects since: 2020/04/16 13:00:00 Force
2020/04/17 16:28:18 UTC: Error: Retrieving DTS defect list: Unable to process list defects request: Error occurred while retrieving defects from project: null, query = 'updated > "2020/04/16 13:00" ORDER BY key ASC': RestClientException{statusCode=Optional.absent(), errorCollections=[]}
2020/04/17 16:28:24 UTC: Sleeping for:  1 seconds.
2020/04/17 16:28:25 UTC: Start date at SCM: 2020/04/17 16:28:25
2020/04/17 16:28:25 UTC: Start date at DTS: 2020/04/17 18:28:25
2020/04/17 16:28:25 UTC: List DTS Defects since: 2020/04/16 13:00:00 Force
2020/04/17 16:28:25 UTC: Error: Retrieving DTS defect list: Unable to process list defects request: Error occurred while retrieving defects from project: null, query = 'updated > "2020/04/16 13:00" ORDER BY key ASC': RestClientException{statusCode=Optional.absent(), errorCollections=[]}
2020/04/17 16:28:31 UTC: Sleeping for:  1 seconds.
2020/04/17 16:28:32 UTC: Start date at SCM: 2020/04/17 16:28:32
2020/04/17 16:28:32 UTC: Start date at DTS: 2020/04/17 18:28:32
2020/04/17 16:28:32 UTC: List DTS Defects since: 2020/04/16 13:00:00 Force
2020/04/17 16:28:33 UTC: Error: Retrieving DTS defect list: Unable to process list defects request: Error occurred while retrieving defects from project: null, query = 'updated > "2020/04/16 13:00" ORDER BY key ASC': RestClientException{statusCode=Optional.absent(), errorCollections=[]}
2020/04/17 16:28:39 UTC: Sleeping for:  1 seconds.
2020/04/17 16:28:40 UTC: Start date at SCM: 2020/04/17 16:28:40
2020/04/17 16:28:40 UTC: Start date at DTS: 2020/04/17 18:28:40
2020/04/17 16:28:40 UTC: List DTS Defects since: 2020/04/16 13:00:00 Force
2020/04/17 16:28:40 UTC: Error: Retrieving DTS defect list: Unable to process list defects request: Error occurred while retrieving defects from project: null, query = 'updated > "2020/04/16 13:00" ORDER BY key ASC': RestClientException{statusCode=Optional.absent(), errorCollections=[]}
2020/04/17 16:28:46 UTC: Sleeping for:  1 seconds.
2020/04/17 16:28:47 UTC: Start date at SCM: 2020/04/17 16:28:47
....................................


Output of p4dtg-test (test is incorrect project key, TEST is correct key, *all* just postpones same error to requesting defects)
Connecting: [https://xxxxx.atlassian.net:xxxxxx@gmail.com:xxxxxxxxxxx]
Connected.
> sp test
Loading project: [test]
Error(1): Unable to connect to project: Error occurred while retrieving projec: test :RestClientException{statusCode=Optional.of(404), errorCollections=[ErrorCollection{status=404, errors={}, errorMessages=[No project could be found with key 'test'.]}]}
> sp TEST
Loading project: [TEST]
Error(1): Unable to connect to project: Error occurred while retrieving projec: TEST :RestClientException{statusCode=Optional.absent(), errorCollections=[]}
> sp *all*
Loading project: [*all*]
Project loaded.
> PL 0 2012/09/24/00/00/00 Updated Assignee p4dtg
Since Date: 2012/9/24 0:0:0
Error(1): Unable to process list defects request: Error occurred while retrieving defects from project: null, query = 'updated > "2012/09/24 00:00" ORDER BY key ASC': RestClientException{statusCode=Optional.absent(), errorCollections=[]}

Googling "statusCode=Optional.absent()" (including quotes) gives some interesting threads.

#2 Skylonxe

Skylonxe

    Member

  • Members
  • PipPip
  • 13 posts

Posted 17 April 2020 - 05:36 PM

Okay, I am not only one with this problem.

https://swarm.worksh...tion/Readme.txt
.

If you use Jira Cloud plese read all of this note.

The files in this location are a development build patch to P4DTG 2018.1 for job101543.

This bug may affect Jira Cloud and on-premise Jira installations. This bug stops all replication.

When 2018.1 is patched you should install use that.

Sample errors in the logs (log-MAPNAME.log or jira-rest-NNNNNN.log.N):

Feb 24, 2020 11:08:45 AM com.perforce.p4dtg.plugin.jira.tcp.internal.request.RequestHandler queryDefects
SEVERE: RestClientException{statusCode=Optional.absent(), errorCollections=[]}

or

Caused by: org.codehaus.jettison.json.JSONException: JSONObject["name"] not found.

or

INFO: RestClientException in hasProjectAccess("CDS"): org.codehaus.jettison.json.JSONException: JSONObject["names"] not found.
RestClientException{statusCode=Optional.absent(), errorCollections=[]}


#3 Skylonxe

Skylonxe

    Member

  • Members
  • PipPip
  • 13 posts

Posted 17 April 2020 - 06:56 PM

Be careful with that solution because it causes Swarm Job page to throw 500.

It is because its default priority order of assembla names prefers emails with @ as User and @ can not be used in job username in swarm.

I added

<JiraHandling>
	 <UserStyle>name,emailshort,displayname,email</UserStyle>
</JiraHandling>

to my jira-rest-config.xml and swarm is not throwing 500 error anymore.

#4 Skylonxe

Skylonxe

    Member

  • Members
  • PipPip
  • 13 posts

Posted 17 April 2020 - 07:16 PM

I am experiencing another problem. I am not sure whether it is caused by patch in previous post or by the original assembla plugin. Done status is not replicated, it gives error

2020/04/17 19:14:49 UTC: Error: DTS(TEST-4) SCM(new)
2020/04/17 19:14:49 UTC: Error: Field: DTS(Status/Resolution) SCM(Status)
2020/04/17 19:14:49 UTC: Error: Unknown map value: Done/Done
2020/04/17 19:14:49 UTC: Error: saving scm defect(new): dts:TEST-4
2020/04/17 19:14:49 UTC: [[UsageError]Error in job specification.
Missing required field 'Status'.
]

Using Status DTS field instead of Status/Resolution works fine, however this solution does not support mirroring.

Here is my jobspec (tabs are ok in the actual doc):


Quote

# A Perforce Spec Specification.
#
#  Updating this form can be dangerous!
#  To update the job spec, see 'p4 help jobspec' for proper directions.
#  Otherwise, see 'p4 help spec'.

Fields:
101 Job word 32 required
102 Status select 10 required
103 User word 32 required
104 Date date 20 always
105 Description text 0 required
106 ModDate date 20 always
107 ModBy word 32 always
108 LongDescription text 0 optional
109 Assignee word 0 optional
110 Comments text 0 optional
111 DueDate date 20 optional
112 Sprint line 0 optional
113 Priority select 10 optional
114 UpdatedDate date 20 optional
115 DTG_FIXES text 0 optional
116 DTG_DTISSUE word 32 optional
117 DTG_ERROR text 0 optional

Values:
Status in-progress/todo/in-review/done
Priority highest/high/medium/low/lowest

Presets:
Status open
User $user
Date $now
Description $blank
ModDate $now
ModBy $user

Comments:
# A Perforce Job Specification.
#
#  Job: The job name.  'new' generates a sequenced job number.
#  Status:   Either 'open', 'closed', or 'suspended'. Can be changed.
#  User: The user who created the job. Can be changed.
#  Date: The date this specification was last modified.
#  Description: Comments about the job.  Required.



#5 Skylonxe

Skylonxe

    Member

  • Members
  • PipPip
  • 13 posts

Posted 20 April 2020 - 10:02 AM

One more issue. P4Fix -> Seems to be applied twice what causes fixes to be duplicated in comments. I created changelist in P4V, attached job to it, shelved it for Swarm and approved and commited in Swarm. Result:
https://imgur.com/a/vQrOSE5

My mapping:
https://imgur.com/ne3ulIg

EDIT: I enabled JIRA in config.php of swarm and now it is not happening anymore. I am not sure whether it is what helped.

#6 Skylonxe

Skylonxe

    Member

  • Members
  • PipPip
  • 13 posts

Posted 27 April 2020 - 01:06 PM

View PostSkylonxe, on 17 April 2020 - 06:56 PM, said:

Be careful with that solution because it causes Swarm Job page to throw 500.

It is because its default priority order of assembla names prefers emails with @ as User and @ can not be used in job username in swarm.

I added

<JiraHandling>
	 <UserStyle>name,emailshort,displayname,email</UserStyle>
</JiraHandling>

to my jira-rest-config.xml and swarm is not throwing 500 error anymore.

If displayname/name contains space, then only first part is replicated.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users