opendevstack / ods-provisioning-app

Provisioning app, which triggers project and component provisions (including Jira / Confluence / BitBucket and OCP resource creation)
Apache License 2.0
15 stars 20 forks source link

Provisioning app tries to create the project again just after successfully creating the project #715

Open braisvq1996 opened 2 years ago

braisvq1996 commented 2 years ago

Describe the bug Once we create the project with the Prov-app successfully, we can see in the logs that it tries to create it again and the preconditions fail as it has already been created.

To Reproduce Steps to reproduce the behavior:

  1. Deploy prov-app from 4.x tag in Dockerhub
  2. Create a project with specialPermissionSet=true (with groups for read, write, admin and cdUser)
  3. Check the logs

Expected behavior After the project creation, the prov-app sholuld not try to create the project again

Affected version:

Log Output

2022-01-18 16:24:59 loggerFileName=DUMS2 [http-nio-8080-exec-6] DEBUG o.o.p.c.ProjectApiController - Project DUMS2 successfully stored: /opt/provision/history/20220118162459-DUMS2.txt
2022-01-18 16:24:59 loggerFileName=DUMS2 [http-nio-8080-exec-6] DEBUG o.o.provision.services.MailAdapter - Mail for project: DUMS2 sent
2022-01-18 16:24:59 loggerFileName=DUMS2 [http-nio-8080-exec-10] DEBUG o.o.p.s.CrowdProjectIdentityMgmtAdapter - existsGroupWithName by Name took (ms): 513
2022-01-18 16:24:59 loggerFileName=DUMS2 [http-nio-8080-exec-10] DEBUG o.o.p.s.CrowdProjectIdentityMgmtAdapter - findPrincipal by Name took (ms): 494
2022-01-18 16:24:59 loggerFileName=DUMS2 [http-nio-8080-exec-10] DEBUG o.o.p.s.CrowdProjectIdentityMgmtAdapter - identityCheck Name took (ms): 2006
2022-01-18 16:24:59 loggerFileName=DUMS2 [http-nio-8080-exec-10] INFO o.o.provision.services.JiraAdapter - checking create project preconditions for project 'DUMS2'!
2022-01-18 16:25:02 loggerFileName=DUMS2 [http-nio-8080-exec-10] INFO o.o.p.c.ProjectApiController - Done with all create project preconditions checks for project but some checks failed! [project=DUMS2, failures=[CheckPreconditionFailure{error-code='PROJECT_EXISTS', detail='ProjectKey 'DUMS2' already exists in 'jira'!'}, CheckPreconditionFailure{error-code='PROJECT_EXISTS', detail='Project/Space 'DUMS2' already exists in 'confluence'!'}, CheckPreconditionFailure{error-code='PROJECT_EXISTS', detail='project 'DUMS2' already exists in bitbucket!'}]]!
clemensutschig commented 2 years ago

Can you put the entire log of a project Provision call here.. this is a major regression @stitakis

Also what's the usecase? Do you use the UI (which one?) the API or?

braisvq1996 commented 2 years ago

@clemensutschig @stitakis Here the log for a project we created yesterday in our DEV environment

We test it with the UI (the old one, with frontend.spa.enabled=false).

The problem is that it is running the preflight checks after the project was created successfully and this trace Done with all create project preconditions checks for project but some checks failed! appears in the logs. This does not appear as an error in the UI, but if we create the project with API calls we capture this trace and breaks the current workflow.

clemensutschig commented 2 years ago

@braisvq1996 - there must be more (the second request) ... check the overall log (and not the component specific one) ...

clemensutschig commented 2 years ago

and you get the error back just via API? ... this is super weird, because the same API is used for the UI and the CURL interface

Can you check if you see something on the CALLER side

braisvq1996 commented 2 years ago

Now It I got the error also from the UI when creating a project.... I will prepare the overall log and put it here

Captura

This is the situation we are facing as the project is created successfully but we get an error in the preflight checks (it seems that it is trying to create the project twice from the logs)

braisvq1996 commented 2 years ago

We have created some projects with the UI, the script in ods-core and our provisioner client .

The project creation only gives us the error if we create it with the UI or the provisioner client (same as the last log provided), if we use the script in ods-core it works without problems

stitakis commented 2 years ago

@braisvq1996 I'm not aware of any change that could cause a regression issue in the project provisioning flow. I'll take a look at the log file.

stitakis commented 2 years ago

@braisvq1996 can you please verify in Jira when the project DUMS2 was created? The ProvApp pre flight condition checked this at 2022-01-18 16:24:59. At this point the project already existed.

braisvq1996 commented 2 years ago

@stitakis and me are taking a look into this issue

stitakis commented 2 years ago

@braisvq1996 was you able to make any progress on this?