Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[E2E 24.08] App provider autosetup | App not activated in marketplace #856

Closed
ciprianherciu opened this issue Jul 22, 2024 · 11 comments · Fixed by #861, #865 or #870
Closed

[E2E 24.08] App provider autosetup | App not activated in marketplace #856

ciprianherciu opened this issue Jul 22, 2024 · 11 comments · Fixed by #861, #865 or #870
Assignees
Labels
bug Something isn't working

Comments

@ciprianherciu
Copy link

Current Behavior

After a subscription and a successful run of the MSO we try to open the application from the Portal.
First problem is that the Application does not appear as active in the App Marketplace
Screenshot 2024-07-22 at 1 16 59 PM

While trying still to open the client disabled
<img width="975" alt="Screenshot 2024-07-22 at 12 46 06 PM" src="https://github.com/user-attachments/assets/1fa6829d-5936-46c1-a594-
Screenshot 2024-07-22 at 1 14 45 PM
c838b69a772b">

Application is not activated in the App Marketplace

Expected Behavior

Application should be activated in the App Marketplace

Steps To Reproduce

  1. Subscribe to Managed SDE
  2. After the successful deployment try to open the application
  3. Application appears as inactive in App Marketplace
  4. While trying to access the client it appears as Client Disabled
@ciprianherciu ciprianherciu added the bug Something isn't working label Jul 22, 2024
@ciprianherciu ciprianherciu added this to the Release 2.1.0 (24.08) milestone Jul 22, 2024
@github-project-automation github-project-automation bot moved this to NEW USER REQUEST in Portal Jul 22, 2024
@evegufy
Copy link
Contributor

evegufy commented Jul 22, 2024

@ciprianherciu If you requested a technical user for Identity Wallet Management, the technical user creation takes a couple of minutes, and the app subscription is shown as pending for that time.
Could you check if the app subscription is now in state “Configure”?

@evegufy evegufy self-assigned this Jul 22, 2024
@evegufy evegufy moved this from NEW USER REQUEST to IN PROGRESS in Portal Jul 22, 2024
@evegufy
Copy link
Contributor

evegufy commented Jul 22, 2024

Issue is still under validation it's already clear that it's restricted to app provider autosetup usage initiated via the POST /api/apps/autoSetup endpoint

@evegufy evegufy changed the title [E2E 24.08] App not activated in marketplace [E2E 24.08] App provider autosetup | App not activated in marketplace Jul 23, 2024
@evegufy
Copy link
Contributor

evegufy commented Jul 23, 2024

The app subscriptions are currently in pending state, current state of process_steps table for the process:
image

It appears that their is some issue in the context of the app provider call back to activate the subscription
https://github.com/eclipse-tractusx/portal-assets/blob/v2.0.0/docs/user/04.%20App(s)/07.%20App%20Provider%20Management/01.%20Open%20API.md

@sachinargade123 also stated the following: "About callback request from app provider side was done and also we received the technical credentials and app id. we configured the same information for mentioned instances.", not certain how that fits into the picture.

Call for clarification happening in couple of hours.

@ntruchsess
Copy link
Contributor

Issues identified:

  • endpoint PUT /api/apps/subscription/{subscriptionId}/activate is expected be called by the app-provider-management serviceaccount that has 'activate_subscription' permission.
  • the endpoint PUT /api/apps/subscription/{subscriptionId}/activate is incorrectly mapped to * endpoint PUT /subscription/{subscriptionId}/activate and therefore not accessible due to the ingress not being able to route without /api/apps prefix

@evegufy
Copy link
Contributor

evegufy commented Jul 23, 2024

@sachinargade123 @ciprianherciu the activation is ready for retest

@evegufy
Copy link
Contributor

evegufy commented Jul 23, 2024

#861 was tested successfully
but once the endpoint could be called the following was observed by @sachinargade123

After hit activate API when I checked the portal -> App subscription managed tab. The subscription status get changed from ‘TRIGGER_ACTIVATE_SUBSCRIPTION’ to ‘ACTIVATE_SUBSCRIPTION’ and, there activate button get enable PFA.
I just checked open the actual subscription URL and it work as expected(showing key cloak login page) but the actual subscription is not enabled/displaced in user management section for role and user assignment for subscription.

we were able to trace it back to the following error during activation:

clientId somedimclientid not found in central keycloak

So, the processes worker attempted to find the external clientId (from the DIM) in centralidp Keycloak, that can not work and @ntruchsess is providing a fix to only consider internal clientids.

@ntruchsess
Copy link
Contributor

PR #864 is ready. It changes the relevant query to return only serviceAccounts that are CompanyServiceAccountKindId.INTERNAL

evegufy pushed a commit that referenced this issue Jul 24, 2024
@evegufy
Copy link
Contributor

evegufy commented Jul 24, 2024

After the fix from #864 the activation was now executed successfully.
We noticed still some issues in the process after the activation of the subscription, as the step “TRIGGER_PROVIDER_CALLBACK” is failing with the error “Callback Url should be set here” and @ntruchsess will take care of that.
But the information provided in this callback should be also available in the Portal interface, so you shouldn’t be blocked any longer from continuing with your tests.

@ntruchsess
Copy link
Contributor

ntruchsess commented Jul 24, 2024

A fix for the TRIGGER_PROVIDER_CALLBACK-related error is implemented in PR #865
As the provider-callback-url is optional this step is not scheduled resp. skipped if no callback-url is configured.

@evegufy
Copy link
Contributor

evegufy commented Jul 24, 2024

The change for completing the process with callback is now merged as well #865, thanks @ntruchsess Could you please also complete the appsettings.json for missing default values like the clientPrefix available in the apps service? And please also raise a pull request to portal-assets to update the documentation where needed:
https://github.com/search?q=repo%3Aeclipse-tractusx%2Fportal-assets%20autosetup&type=code

Could you please also check if the autosetup for services is aligned with the recent bugfixes?
Related topic: I noticed a documentation error for the analog endpoint for services, it should be service instead of app:
image

ntruchsess added a commit that referenced this issue Jul 29, 2024
ntruchsess added a commit that referenced this issue Jul 29, 2024
* fix(apps): remove leading '/' from the activate subscription endpoint (#861)
Refs: #856
* bug(offersubscription): suppress activation of external serviceaccounts in keycloak on subscription-activation (#864)
Refs: #856
* fix(dim): fix callback logic for dim requests (#863)
Refs: #862
chore(dependencies): bump efcore to 8.0.7 (#857)
* increase efcore version to latest 8.0.7 to resolve security-issue in transitive dependency in System.Text.Json
* fix(offersubscription): skip optional autosetupprovidercallback  if it is not configured (#865)
* add clientPrefix  to workers appsettings (#870)
* fix: enhance subscription/provider endpoint with external Service data (#867)
Refs: #841
* fix(sdDoc): set process step to skipped if ClearinghouseConnectDisabled is true (#874)
Refs: #792
* build(deps): bump MimeKit from 4.3.0 to 4.7.1 (#833)
eclipse-tractusx/portal#369
* build(deps): bump MimeKit from 4.3.0 to 4.7.1 in /tests/endtoend
Bumps MimeKit from 4.3.0 to 4.7.1.
---
updated-dependencies:
- dependency-name: MimeKit
  dependency-type: direct:production
...
* chore: upgrade mimekit in sendmail project
* chore: update dependencies file
---------
* upgrade implicit dependencies on System.Text.Json (#875)
* Serilog.Settings.Configuration to 8.0.2
* remove redundant dependencies on Microsoft.Extensions.Hosting
* bump framework version to 2.4.2 after merge of main
---------
Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: Norbert Truchsess <[email protected]>
Co-authored-by: Phil Schneider <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Evelyn Gurschler <[email protected]>
Reviewed-By: Evelyn Gurschler <[email protected]>
Reviewed-By: Norbert Truchsess <[email protected]>
Reviewed-By: Phil Schneider <[email protected]>
@evegufy
Copy link
Contributor

evegufy commented Jul 30, 2024

I got confirmation that the process worked also E2E with a new subscription from @sachinargade123 and @ciprianherciu
--> closing issue now.
I opened eclipse-tractusx/portal-assets#374 to follow up on the documentation

@evegufy evegufy closed this as completed Jul 30, 2024
@github-project-automation github-project-automation bot moved this from IN PROGRESS to USER READY in Portal Jul 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment