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

pac pcf push doesn't work if the publisher prefix was already used to upload with an older "pac cli" #780

Closed
brasov2de opened this issue Nov 27, 2023 · 12 comments
Assignees

Comments

@brasov2de
Copy link

With the latest version of "pac cli" , "pac pcf push" cannot import the pcf anymore. My PCF was already uploaded with older "pac cli" versions.

Latest version where it works for me "Version: 1.28.3"
The latest versions: VSCode extension "Version: 1.28.3" or the standalone "Version: 1.29.6" doesn't work.

Inside the "obj" folder, it generates a folder "PowerAppsToolsTemp_" (and cdsproj). With older "pac cli" version, the folder is called "PowerAppsTools_" and the "pac pcf push" works.

Error Message
"2023-11-27 15:29:23.4043 | ERR | Microsoft.PowerPlatform.Dataverse.Client.ServiceClient :: ************ FaultException`1 - Delete : Delete Request to Dataverse via IOrganizationService |=> The object you tried to delete is associated with another object and cannot be deleted. Deleting records from Publisher (ObjectTypeCode: 7101)
for Id(s) : 2fd65450-2887-4b5d-8b90-14820074774a
Exception : Cascade Delete failed due to cascade restrict relation. Details below :
Restricting entity Solution (ObjectTypeCode: 7100) has Id: adc713e9-6684-437f-a4b6-4411c50466fd and is collected by Relationship with name: publisher_solution.

Source: mscorlib
Method: HandleReturnMessage
DateUTC: 11/27/2023
TimeUTC: 3:29:23 PM
Error: Message: The object you tried to delete is associated with another object and cannot be deleted. Deleting records from Publisher (ObjectTypeCode: 7101)
for Id(s) : 2fd65450-2887-4b5d-8b90-14820074774a
Exception : Cascade Delete failed due to cascade restrict relation. Details below :
Restricting entity Solution (ObjectTypeCode: 7100) has Id: adc713e9-6684-437f-a4b6-4411c50466fd and is collected by Relationship with name: publisher_solution.
"

@aboodh95
Copy link

I'm also facing the same error, and in case I tried to publish from the UI, the operation is taking an enormous amount of time, so if you were able to fix it please share it here

@aboodh95
Copy link

Hi @brasov2de ,
I was able to resolve this issue, I had to delete the existing solution along with the publisher, and after that I was able to use pac pcf push --publisher-prefix

@brasov2de
Copy link
Author

Thanks @aboodh95 ! That's a solution for the beginning... when the PCF was already deployed to other environments, it's not that easy anymore.

@brasov2de
Copy link
Author

brasov2de commented Jan 16, 2024

@aboodh95
Figured out a workaround. Maybe you've meant the same: deleting the solution, but moving first the PCFs to another one. That way, we don't need to delete the PCF from the form /page.
Maybe it helps somebody else too
https://dianabirkelbach.wordpress.com/2024/01/16/how-to-fix-pac-pcf-push-issues-with-pac-cli-newer-than-1-28-3-publisher-error-or-solution-deleted/

@Hisol-mlund
Copy link

Also experiencing this issue in release 1.30. Colleague with 1.25.5 was able to import it.

@snizar007
Copy link
Contributor

@brasov2de et all - We are investigating into this. Thank you for addressing.

@joem-msft
Copy link
Contributor

Hello, thank you for reporting this issue. The latest version of the Pac CLI (1.30.4) should have fixed the issue when trying to delete the temporary publisher used only for debug scenarios. It's true that we had code that missed catching the exception from the service when that publisher is being used elsewhere. The code should ignore these errors, as it's intended only as a cleanup to prevent creating publishers that are not owned by the customer.

@Hisol-mlund, Can you please verify the error you're seeing with the latest version of the pac CLI? This may be pointing to a different issue. Getting the sessionId would be helpful here too.

@joem-msft
Copy link
Contributor

@brasov2de, can you retry your scenario with the new Pac CLI v1.30.4 to see if it still happens? thanks.

@brasov2de
Copy link
Author

Thanks @snizar007 :-)

Hi @joem-msft ,
It's a little hard to say.
This update didn't land in my VSCode (in VSCode I have pac cli v1.29..11), but I could use the pac cli v 1.30.4 in the standalone version, and that way I've compared the two versions.

With the VSCode- v1.29.11 (old one) I get an error after "Importing temporary solution wrapper..." step. I've just realized that I need to make a "publish all" in order to see the updated PCF inside my environment.

With v1.30.4 I still get some error messages, but only after the "Publish All Customizations" step, and I can see the updated version of my PCF inside my environment without any other "manually" publish.
So it actually works, probably by catching the error (not sure), but it's confusing because we still get an error.

Maybe I should say, that in the environment where I'm pushing the component, the component was already pushed with a previous pac cli.

Here is the last part of the logs using the v1.30.4:

`Processing Component: Entities
Processing Component: Roles
Processing Component: Workflows
Processing Component: FieldSecurityProfiles
Processing Component: Templates
Processing Component: EntityMaps
Processing Component: EntityRelationships
Processing Component: OrganizationSettings
Processing Component: optionsets
Processing Component: CustomControls

  • Dianamics.Happynator
    Processing Component: SolutionPluginAssemblies
    Processing Component: EntityDataProviders
    Processing Sharded Component Files

Unmanaged Pack complete.

Solution: bin\Debug\PowerAppsToolsTemp_diana.zip generated.
Solution Package Type: Unmanaged generated.
Completed intermiediate files clean up.
Building temporary solution wrapper: done.
Importing the temporary solution wrapper into the current org.

Solution Importing...

Solution Imported successfully.
Importing the temporary solution wrapper into the current org: done.

Publishing All Customizations...
Microsoft PowerPlatform CLI
Version: 1.30.4+gc285477
Online documentation: https://aka.ms/PowerPlatformCLI
Feedback, Suggestions, Issues: https://github.com/microsoft/powerplatform-build-tools/discussions

Error: The object you tried to delete is associated with another object and cannot be deleted. Deleting records from Publisher (ObjectTypeCode: 7101)
for Id(s) : 564f694d-9168-436a-bfc9-71e49418047d
Exception : Cascade Delete failed due to cascade restrict relation. Details below :
Restricting entity Solution (ObjectTypeCode: 7100) has Id: 2b4a0a7d-8214-408a-991e-8f6d6009abf3 and is collected by Relationship with name: publisher_solution.

The object you tried to delete is associated with another object and cannot be deleted. Deleting records from Publisher (ObjectTypeCode: 7101)

for Id(s) : 564f694d-9168-436a-bfc9-71e49418047d
Exception : Cascade Delete failed due to cascade restrict relation. Details below :
Restricting entity Solution (ObjectTypeCode: 7100) has Id: 2b4a0a7d-8214-408a-991e-8f6d6009abf3 and is collected by Relationship with name: publisher_solution.`

And for direct comparison, that is the terminal output with the older pac cli (1.29.11)
image

@joem-msft
Copy link
Contributor

Hello all! I want to extend a thank you all for your help as we fix this issue.

We have just released v1.30.6 which has a workaround for the new issue that @brasov2de has explained.

Indeed, the publish all customizations request was returning successfully, but there is a bug in the Dataverse ServiceClient which was not resetting the LastException property.
We've filed a bug fix for this, but in the mean time we updated the logic for pac pcf push to perform all the cleanup steps at the end. These cleanup steps MAY encounter the original cascade delete error on the publisher, but this is expected and we safely ignore them.

NOTE: The Power Platform Tools extension for VS Code has not yet been updated with the latest version of the Pac CLI, but is expected to be released in the next couple days.

@brasov2de
Copy link
Author

Thank you @joem-msft 🙏
I've successfully tested the the standalone pac cli v1.30.6.
"pac pcf push -pp " worked now.
Even the new "pac pcf push --solution-unique-name " worked like a charm.
Thanks a lot 😍

@joem-msft
Copy link
Contributor

The Power Platform Extension for VS Code v2.0.28 has been released and contains the fixes above.

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

6 participants