Open braveadmin opened 5 years ago
Please update the "Your Environment" in the template.
Please run the command with -Debug
enabled:
Set-ConfluencePage -PageId 616493147 -Body 'test' -debug
enter suspend mode on the 2nd time this message shows up:
DEBUG: [Invoke-Method] Executed WebRequest. Access $webResponse to see details
(the first is for Get-Page
and the 2nd for Set-Page
)
Once in suspend, please post here the output of
$iwParameters
$body
This is the output:
PS C:\Windows\system32>> Set-ConfluencePage -PageID $PageID -Body $Body -Debug
DEBUG: [Set-ConfluencePage] ParameterSetName: byParameters
DEBUG: [Set-ConfluencePage] PSBoundParameters:
Key Value
--- -----
PageID 616493147
Body Test
Debug True
apiURi https://confluence.ntt.eu/rest/api
Credential System.Management.Automation.PSCredential
DEBUG: [Get-Page] ParameterSetName: byId
DEBUG: [Get-Page] PSBoundParameters:
Key Value
--- -----
PageID {616493147}
ApiURi https://confluence.ntt.eu/rest/api
Credential System.Management.Automation.PSCredential
DEBUG: [Invoke-Method] ParameterSetName: __AllParameterSets
DEBUG: [Invoke-Method] PSBoundParameters:
Key Value
--- -----
First 18446744073709551615
GetParameters {expand, limit}
Method Get
Skip 0
URi https://confluence.ntt.eu/rest/api/content/616493147
IncludeTotalCount False
Credential System.Management.Automation.PSCredential
OutputType ConfluencePS.Page
DEBUG: [Invoke-Method] Using $GetParameters:
Name Value
---- -----
expand space,version,body.storage,ancestors
limit 25
DEBUG: [Invoke-Method] Executed WebRequest. Access $webResponse to see details
PS C:\Windows\system32>>> $iwParameters
$body
Name Value
---- -----
First 18446744073709551615
GetParameters {expand, limit}
Method Get
Skip 0
Uri https://confluence.ntt.eu/rest/api/content/61...
IncludeTotalCount False
Credential System.Management.Automation.PSCredential
OutputType ConfluencePS.Page
you stopped at the first message
DEBUG: [Invoke-Method] Executed WebRequest. Access $webResponse to see details
I need the $body
and $iwParameters
of the 2nd time that message is shown
sorry, this is the result:
DEBUG: [Set-ConfluencePage] ParameterSetName: byParameters
DEBUG: [Set-ConfluencePage] PSBoundParameters:
Key Value
--- -----
PageID 616493147
Body Test
Debug True
apiURi https://confluence.ntt.eu/rest/api
Credential System.Management.Automation.PSCredential
DEBUG: [Get-Page] ParameterSetName: byId
DEBUG: [Get-Page] PSBoundParameters:
Key Value
--- -----
PageID {616493147}
ApiURi https://confluence.ntt.eu/rest/api
Credential System.Management.Automation.PSCredential
DEBUG: [Invoke-Method] ParameterSetName: __AllParameterSets
DEBUG: [Invoke-Method] PSBoundParameters:
Key Value
--- -----
First 18446744073709551615
GetParameters {expand, limit}
Method Get
Skip 0
URi https://confluence.ntt.eu/rest/api/content/616493147
IncludeTotalCount False
Credential System.Management.Automation.PSCredential
OutputType ConfluencePS.Page
DEBUG: [Invoke-Method] Using $GetParameters:
Name Value
---- -----
expand space,version,body.storage,ancestors
limit 25
DEBUG: [Invoke-Method] Executed WebRequest. Access $webResponse to see details
DEBUG: [Set-ConfluencePage] Content to be sent:
Name Value
---- -----
type page
version {number}
ancestors {}
body {storage}
title Llistat IP - Cloud Nexica - Test
DEBUG: [Invoke-Method] ParameterSetName: __AllParameterSets
DEBUG: [Invoke-Method] PSBoundParameters:
Key Value
--- -----
Method Put
Credential System.Management.Automation.PSCredential
URi https://confluence.ntt.eu/rest/api/content/616493147
Body {...
OutputType ConfluencePS.Page
DEBUG: [Invoke-Method] Executed WebRequest. Access $webResponse to see details
PS C:\Windows\system32>>>> $Body
{
"type": "page",
"version": {
"number": 4
},
"ancestors": [
],
"body": {
"storage": {
"representation": "storage",
"value": "Test"
}
},
"title": "Llistat IP - Cloud Nexica - Test"
}
PS C:\Windows\system32>>>> $iwParameters
Name Value
---- -----
Method Put
Credential System.Management.Automation.PSCredential
Uri https://confluence.ntt.eu/rest/api/content/61...
Body {...
OutputType ConfluencePS.Page
I can't figure out what is going on. What does this return?
get-confluencepage -PageID 616493147 | select -exclude body
PS C:\Users\braveadmin> get-confluencepage -PageID 616493147 | select -exclude body
ID Status Title SpaceKey Version
-- ------ ----- -------- -----
616493147 Llistat IP - Cloud Nexica - Test AOC 3
does this happen to every page on that wiki server? or in that same space?
I tried with other pages, even with test pages created exclusively to test this. In every case I got the same error. I can do a Get-ConfluencePage but Set-ConfluencePage doesn't work.
@braveadmin : can you confirm that this still happens on the latest version? (2.4.0)
@brianbunke : can you reproduce this?
Hi @lipkau do you mean ConfluencePS version?
yes
I got the same error. "Edit content id mismatch".
I cannot reproduce. Set-ConfluencePage -PageId 616493147 -Body 'test test'
works as expected for me on ConfluencePS 2.4.0 and Confluence Server 6.10.0. My $Body
and $iwParameters
debug output looks identical.
Any suggestion on what could be going wrong? @brianbunke @lipkau
which version of powershell did you use to test it?
I can run it successfully on PSv5.1 and v6.1 against a Cloud server and an On-Premise Server v6.2.4
Which minimum version of Confluence Server is compatible with ConfluencePS? @brianbunke
There is no way to really know this. I can be wrong, but would expect all version > 6 to work properly. I have tried finding old versions of the API documentation, but this is not trivial
What is the version of the confluence server?
You should be able to see it in the footer of pretty much every page
I'm also receiving a 400 bad request when attempting to retrieve a page by label. I've included the request and response below:
$response = Get-ConfluencePage -Label 'noarchive-single'
WARNING: Confluence returned HTTP error 400 - BadRequest Invoke-Method : Could not parse cql : type=page AND label=noarchive-single At C:\Program Files\WindowsPowerShell\Modules\ConfluencePS\2.5.0\ConfluencePS.psm1:772 char:17
+ CategoryInfo : InvalidResult: ({"statusCode":4...:"Bad Request"}:String) [Invoke-Method], ArgumentException
+ FullyQualifiedErrorId : InvalidResponse.Status400,Invoke-Method
I have the exact samme problem as the rest here. Did anyone manage to solve the problem?
@rjdlobik are you sure you are referring to the same problem here? Your issue looks more like the hyphen quoting problem described in #175
Description
I noticed that Set-ConfluencePage command doesn't work at all, maybe for a bug.
If I do a get of a certain PageID it works without problem, but when i do the following command it prompts me the following bellow
Steps To Reproduce
Expected behavior
Screenshots
Your Environment
Confluence Server:
Possible Solution