Closed zeenmc closed 11 months ago
Hello @zeenmc, Are you sure of the project names in the cURL commands?
test-prod10
.user-management-mfe-10
with parent test-active10
(do not match project in first request).Hello @antoinbo, that is my mistake, but yes I am sure, in my visual code I have many examples what I tested, tried to fix issue. On the end I did manually and will check later on, in some another verision.
Behaviour is correct.
Create project via cURL, disable, enable, and after that will be possible to create child project.
Any progress on this? I am just now encountering a similar issue. I am creating a parent project via the API successfully and then immediately trying to create a child project via the API specifying the parent UUID. I am getting the same An inactive Parent cannot be selected as parent
error as indicated above. If I go to the UI and disable the parent project then enable the parent project DT will then allow me to specify it as a parent. I'm on DT v4.9.1 w/ MS SQL DB.
Here is a repro of the issue using PowerShell v7.3.9
> $Result = Invoke-RestMethod -Method PUT -Uri $Uri -Headers $Headers -Body (@{name='parent';'version'='1.0.0'} | ConvertTo-Json)
> $Result
name : parent
version : 1.0.0
classifier : APPLICATION
uuid : 34e1fd19-3fb7-4960-9be1-5f112bdbb901
properties : {}
tags : {}
active : True
> Invoke-RestMethod -Method PUT -Uri $Uri -Headers $Headers -Body (@{name='child';'version'='2.0.0';parent=@{uuid=$Result.uuid}} | ConvertTo-Json)
Invoke-RestMethod: An inactive Parent cannot be selected as parent
When using the API to create a project, specifically the PUT variant, you need to currently specify the "active" field in the payload otherwise it will be null and cause the error.
The method in question is here:
This can either be fixed by adding something similar to what was done for the application classifier:
if (jsonProject.isActive() == null) {
jsonProject.setActive(Boolean.TRUE);
}
Or by setting a default "active" value for all newly created projects on the persistence level.
When using the API to create a project, specifically the PUT variant, you need to currently specify the "active" field in the payload otherwise it will be null and cause the error.
The method in question is here:
This can either be fixed by adding something similar to what was done for the application classifier:
if (jsonProject.isActive() == null) { jsonProject.setActive(Boolean.TRUE); }
Or by setting a default "active" value for all newly created projects on the persistence level.
Confirmed explicitly setting the active value resolves the issue. Thanks!
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Current Behavior
Hello Team :)
I am having issues to create child project, as I am getting error from the tittle. I am feeling this is a bug as I am able to reproduce multiple times. Our DT is 4.8.2 ,and we are using MS SQL Server.
After I created project via curl command (idea is to have whole this proccess in CICD pipelines in Azure DevOps), In UI, I ass project is active
I will get error from title, as I said, but if I go to UI, in Project Details which I created, and disable project, save changes, again enable project, and wait for a few seconds, I will be able to create child project without any errors.
Where is log when I disable/enable just created project
Any ideas how to resolve this issue ? Ned.
Steps to Reproduce
1.Create project via cURL command
Expected Behavior
After we create parent project, without any issues we need to be able to create child project.
Dependency-Track Version
4.8.2
Dependency-Track Distribution
Container Image
Database Server
Microsoft SQL Server
Database Server Version
No response
Browser
Google Chrome
Checklist