Hi all,
I’m trying to create a space in forge within a normal UI kit macro.
I’m following exactly the syntax in the reference but I keep on getting a 500 Internal server error. Still, it seems that the space is correctly created!
Any idea?
snippet below:
var bodyData = `{
"key": "TCS",
"name": "test create space",
"description": {
"plain": {
"value": "test space",
"representation": "plain"
}
}
}`;
const response = await api
.asApp()
.requestConfluence(route`/wiki/rest/api/space`, {
method: "POST",
headers: {
Accept: "application/json",
"Content-Type": "application/json",
},
body: bodyData,
});
Manifest:
permissions:
scopes:
- search:confluence
- read:confluence-content.summary
- read:confluence-space.summary
- write:confluence-content
- write:confluence-space
Thanks
Matteo
Hi @MatteoGubelliniSoftC,
Thank you for reaching out. I tried the same your are trying but couldn’t reproduce the issue. Please note that key
in the bodyData should be unique. If it is already created once second try will give you status 400
. Could you please retry with a different key and let us know if the issue still persists ? If you are getting the same error again could you please share the below details which will help us to trace the issue ?
Forge CLI version, new space key you used, ~time when you tried to execute this
Hi,
name: z123name
key: z123
time: 10:27 GMT
CLI: 2.0.6
Yes, it is the same with any key. The space is created correctly but I still get the error. Could it be because the app needs global create space permissions but I’m on a free instance?
Error:
org.springframework.transaction.unexpectedrollbackexception: Transaction rolled back because it has been marked as rollback-only
Thanks
Matteo
Hi @MatteoGubelliniSoftC ,
I’ve tested this same scenario on a Free Confluence site and I was also able to create the space.
Would you be able to share with us the site URL on which you tested this and your app ID and Title?
If you’re don’t feel like sharing this information here, please feel free to raise a Developer Support ticket here.
Best,
Gabriel
Sure,
The app is “Create DHF space”.
ari:cloud:ecosystem::app/01d14d61-a7de-4ada-84de-5c18f99d4795
Thansk
Matteo
Thanks for sharing. I don’t see any missing permissions for your app user.
Did you try running the same app on another instance?
Or also isolating this logic to a new sample app?
That could help us determining whether this is something with permissions, or an issue with a given site.
Best,
Gabriel
Hi Gabriel,
I installed it on Confluence and in this case I get 200 OK. In this instance I can set permissions (although I did not do anything I just installed it through forge).
Any idea?
Thanks
Matteo
@MatteoGubelliniSoftC I can’t confirm it without analyzing it further, but it looks like the group that your app user is in doesn’t have the permission to create the space in Confluence.
Did you change any permissions for any groups on the instance your having issues?
If you can’t see any changes, maybe the Cloud Support Team can help you better.
Cheers,
Gabriel
Gabriel,
As the first instance is free I’m not sure what permissions are set.
I’ll check if I can test it on another free instance.
Thanks
Matteo
1 Like