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

Share local portfolio to cross region is not working, showing ProductId parameter is missing - i can able to reproduce #723

Open
vasindran opened this issue Sep 27, 2024 · 5 comments

Comments

@vasindran
Copy link

vasindran commented Sep 27, 2024

          Hi Eamonn, yes i can able to reproduce it.
  1. This is my source account (puppet account) region Frankfurt
image
  1. you can see, there are 11 products in that portfolio
image
  1. This is our puppet manifest file for portfolio share and sharing the portfolio to Franfurt and Ohio (we are running hub mode since we are getting dependency error message when we run in spoke mode)

image

  1. Error message when we run spoke mode
image
  1. Error message reported before
image

its just creating empty portfolio, but no products shared

image

Originally posted by @vasindran in #722 (comment)

@vasindran vasindran changed the title Hi Eamonn, yes i can able to reproduce it. Share local portfolio to cross region is not working, showing ProductId parameter is missing - i can able to reproduce Sep 27, 2024
@peteawood
Copy link

@eamonnfaherty - This seems to occur if there are products in the hub portfolio which don't exist in the spoke portfolio and either have no versions or all versions are marked to be ignored.

If I'm following the logic correctly, then this line

marks the product to be copied and the 'True' value should later on be overwritten with the ProductId at
products_requiring_adding_to_portfolio[product_name] = (
response.get("TargetProductId")
)


However, if no versions are returned at this line

or EVERY version is marked to be ignored at this line

then the lines below

will never be true and the "ProductId" of 'True' stored in products_requiring_adding_to_portfolio will remain when the below line finally gets called:

servicecatalog.update_provisioning_artifact(
ProductId=product_id,
ProvisioningArtifactId=version_id,
**version_details,
)

Phew! Apologies for all the snippets, explaining logic flows over gh issues is never fun :) The snippets are from the current version but the same or similar logic existed in v246 (the version in use showing this issue) just on different lines. I'm not sure on the best approach to resolve within puppet but trying to ensure products have at least one relevant version to copy should help resolve when using puppet.

@eamonnfaherty
Copy link
Contributor

Are @vasindran and @peteawood from the same company? From @vasindran report it appears the portfolio has products and they are not marked as ignored but maybe @peteawood has more details?

@vasindran could you email me your log files please.

@peteawood thanks for diving deep into this. Are you affected by this issue also? It was a design decision made back when the project started as portfolios had to have a provisioning artifact.

@peteawood
Copy link

Sorry, should have added more context - yes same company.

And yes, the portfolio has products but most of them, in regions other than our primary, have only Version 1 with a name of "-" which I think is what's causing the issue as

indicates such products, whilst present in the Portfolio, essentially have no valid versions that execute the required logic to replace the 'True' value.

@eamonnfaherty
Copy link
Contributor

Just to clarify - you are unable to share a portfolio that has no valid/active products and you would like to?

@peteawood
Copy link

peteawood commented Nov 12, 2024

Not quite. Within our primary region, the portfolio's products are all active with valid versions. The portfolio has been copied to our secondary region but (currently) only a subset of the products have valid versions. The products which only have the placeholder version are causing the failure and preventing the active products from being copied to the spoke in the secondary region.

We would like for the portfolio to be shared with the active products even though inactive/invalid products are in the same portfolio. We would expect the invalid/inactive products would not be shared.

However, if that's not possible, or you see that as an undesirable implementation then we could also accept that we simply need to ensure that products should not exist in the portfolio until valid.

The only use case for this I could think of is when products are first created by Factory, I think they appear in a portfolio with just a placeholder version until they are developed further. With a scheduled run of puppet this could prevent sharing working until the first valid version is added.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants