rockcarver / frodo-cli

A CLI to manage ForgeRock platform deployments supporting Identity Cloud tenants, ForgeOps deployments, and classic deployments.
MIT License
17 stars 14 forks source link

Unable to export journey from on premise platform deployment #358

Closed rohithkk closed 5 months ago

rohithkk commented 5 months ago

Frodo CLI version

I tried with two different versions. Same issue on both versions.

Version 1:

Describe the issue

We have forgerock deployed on premise as a platform. We had version 7.1.x and in the process of upgrading to 7.3.x version. We have been able to successfully export journeys from 7.1.x. But when we tried to export the journey from 7.3.x version, frodo is complaining that it is unable to find themeand it is throwing error. I have copied the complete verbose output of the journey export command below.

**ForgeOps deployment** detected.
Using cached bearer token.
Using cached session token.
Connected to https://amid101:8443/auth [agents] as user xxxx

Exporting journey...
- AgentLogon
  - Flow
    - identityResource: managed/myperson
    - Done
  - Nodes:get https://amid101:8443/openidm/config/ui/themerealm

<!doctype html><html lang="en"><head><title>HTTP Status 404 – Not Found</title><style type="text/css">body {font-family:Tahoma,Arial,sans-serif;} h1, h2, h3, b {color:white;background-color:#525D76;} h1 {font-size:22px;} h2 {font-size:16px;} h3 {font-size:14px;} p {font-size:12px;} a {color:black;} .line {height:1px;background-color:#525D76;border:none;}</style></head><body><h1>HTTP Status 404 – Not Found</h1><hr class="line" /><p><b>Type</b> Status Report</p><p><b>Description</b> The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.</p><hr class="line" /><h3>Apache Tomcat/9.0.83</h3></body></html>

Please report this unhandled error here: https://github.com/rockcarver/frodo-cli/issues

    - debeb360-d8d5-4d9b-bbbc-48ee55c069f7 (PageNode)
    - 1b44a740-9886-4279-89ae-e83e2dc3dd0d (RetryLimitDecisionNode)
    - bc2e2aa5-f869-4987-a8c0-9c7a3683153b (PageNode)
    - more nodes

  - Inner nodes:

    - 3d6e6b4d-7f2d-4864-a77e-0a2f97184775 (UsernameCollectorNode)
    - c531bca1-6eab-469c-a828-58a148704ed1 (PasswordCollectorNode)
    - e623ebb5-ecfb-45b6-94ba-ad05024604f8 (MessageNode)
    - more nodes

  - Scripts:
     - 140471c5-f8f6-40b0-8fb2-6b7f5e6f0365 (Set Env Vars)
     -  more scripts

  - Themes:

- AgentLogon
× Error exporting journey AgentLogon: Error: Export error:
**Error reading themes: Request failed with status code 404**
(node:29956) PromiseRejectionHandledWarning: Promise rejection was handled asynchronously (rejection id: 4)
(Use `frodo --trace-warnings ...` to show where the warning was created)

From the error message, it appears frodo is trying to download the theme for journey by constructing the IDM URL with the same hostname that I passed for AM and changing the context path. But in our deployment, IDM is on a different server, let's say amid102 for example. How do I fix this issue in the profile?

I also tried to overwrite the profile type by setting the "-m" flag when adding the connection as shown here. frodo conn add -m classic -k https://amid101:8443/auth xxxx yyyy

But when I tried to export journey, output was still saying "ForgeOps deployment detected". It appears -m flag wasn't effective.

vscheuber commented 5 months ago

Hi @rohithkk , you are on the right track with using the -m option. However, frodo does not currently store the deployment type in the connection profile, so you have to supply the option every time you export.

Can you please try and run frodo journey export -i AgentLogon -m classic amid101 and report if that works as expected?

rohithkk commented 5 months ago

Oh wow.. that worked. I didn't see the -m/--type flag as an option for journey export and it didn't struck me that I should try. Silly me. Thank you very much @vscheuber.

vscheuber commented 5 months ago

Fantastic, @rohithkk , I'm glad to hear it worked out! If you think it would be valuable, please file an enhancement request to store the type in the connection profile. Closing this issue for now.