AtlassianPS / JiraPS

PowerShell module to interact with Atlassian JIRA
https://AtlassianPS.org/module/JiraPS
MIT License
324 stars 131 forks source link

JiraPS fails to upload attachments to cloud server #248

Closed lipkau closed 6 years ago

lipkau commented 6 years ago

Expected Behavior

Add-JiraIssueAttachment should just work

Current Behavior

Command fails on Cloud server with error

org.apache.commons.fileupload.FileUploadBase$IOFileUploadException: Processing of multipart/form-data request failed. Stream ended unexpectedly

Possible Solution

Your Environment

 I ♥ PS> Get-JiraServerInfo

ServerTitle    : JIRA
BuildNumber    : 100083
DeploymentType : Cloud
BuildDate      : 2018-05-09 02:00:00
BaseURL        : https://powershell.atlassian.net
Version        : 1001.0.0-SNAPSHOT
ScmInfo        : 62e6e97535da03ead836c827d2a0c3e114a33919
ServerTime     : 2018-05-10 15:35:00
RealWorldPowerShell commented 6 years ago

Tried to add a attachment.

Add-JiraIssueAttachment -Issue STS-11582 -FilePath "C:\temp\out.txt" -Verbose VERBOSE: [Add-JiraIssueAttachment] Function started VERBOSE: [Get-JiraIssue] Function started VERBOSE: [Get-JiraConfigServer] Function started VERBOSE: [Get-JiraConfigServer] Complete VERBOSE: [Get-JiraIssue] Processing [STS-11582] VERBOSE: [Invoke-JiraMethod] Function started VERBOSE: [Get-JiraSession] Function started VERBOSE: [Get-JiraSession] Using Session saved in PrivateData VERBOSE: [Get-JiraSession] Complete VERBOSE: [Invoke-JiraMethod] Get https://jira.someserver.se/rest/api/latest/issue/STS-11582?expand=transitions VERBOSE: [Test-ServerResponse] Checking response headers for authentication errors VERBOSE: [Invoke-JiraMethod] Status code: 200 VERBOSE: [Invoke-JiraMethod] Function ended VERBOSE: [Get-JiraIssue] Complete VERBOSE: Performing the operation "Adding attachment ''." on target "STS-11582". VERBOSE: [Invoke-JiraMethod] Function started VERBOSE: [Get-JiraSession] Function started VERBOSE: [Get-JiraSession] Using Session saved in PrivateData VERBOSE: [Get-JiraSession] Complete VERBOSE: [Invoke-JiraMethod] Post https://jira.someserver.se/rest/api/latest/issue/38154/attachments VERBOSE: [Invoke-JiraMethod] Failed to get an answer from the server VERBOSE: [Test-ServerResponse] Checking response headers for authentication errors VERBOSE: [Invoke-JiraMethod] Status code: InternalServerError WARNING: Jira returned HTTP error 500 - InternalServerError VERBOSE: [Invoke-JiraMethod] Retrieved body of HTTP response for more information about the error ($responseBody) VERBOSE: [Invoke-JiraMethod] Function ended VERBOSE: [Add-JiraIssueAttachment] Complete

RealWorldPowerShell commented 6 years ago

Hmm, seem to be working if i install 2.5.17.

Add-JiraIssueAttachment -Issue $issue -FilePath "C:\temp\out.txt" -Verbose VERBOSE: [Add-JiraIssueAttachment] Function started VERBOSE: Performing the operation "Adding attachment 'out.txt'." on target "STS-11582". VERBOSE: [Invoke-JiraMethod] Function started VERBOSE: [Get-JiraSession] Function started VERBOSE: [Get-JiraSession] Using Session saved in PrivateData VERBOSE: [Get-JiraSession] Complete VERBOSE: [Invoke-JiraMethod] Using WebSession (Username=[sUser1@someserver.se]) VERBOSE: [Invoke-JiraMethod] POST https://jira.someserver.se/rest/api/latest/issue/38154/attachments VERBOSE: [Invoke-JiraMethod] Function ended VERBOSE: [Add-JiraIssueAttachment] Complete

lipkau commented 6 years ago

Will be fixed with the next release