pnp / powershell

PnP PowerShell
https://pnp.github.io/powershell
MIT License
683 stars 348 forks source link

[BUG] Set-PnPWebTheme returns "Unknwon Error" since yesterday #4528

Closed zapftho closed 1 week ago

zapftho commented 1 week ago

Reporting an Issue or Missing Feature

Since about yesterday evening we are getting errors when using Set-PnPWebTheme command in our Teams Provisioning. The issue started without any changes from our end and I cannot find a reason for it so far. Is anyone facing the same issue? I have also checked if the Theme is still there using Get-PnPTenantTheme and can confirm that this is the case.

EDIT: After additional tests I found out that the same error occurs when using the "Microsoft.Online.SharePoint.PowerShell" module from Microsoft. So this is probably not related to PnP Powershell. I will create a Ticket at Microsoft as well just to be sure.

Expected behavior

Set-PnPWebTheme completes without error and updates the Web Theme.

Actual behavior

image

Result of Get-PnPException:

image

Steps to reproduce behavior

Connect-PnPOnline -Url "" -ClientId "" -Interactive Set-PnPWebTheme -Theme ""

What is the version of the Cmdlet module you are running?

2.12.0

Which operating system/environment are you running PnP PowerShell on?

veronicageek commented 1 week ago

Closing for now. When MSFT fixes it, it will work for PnP as well.

zapftho commented 1 hour ago

The Microsoft issue is still not fixed but I have been able to find a workaround. So far it turned out that the issue caused by using RGBA values in the color palette. We can also confirm that this started at some point in both of our Tenants. Not at the same time but with some days difference. It even started earlier in our Standard Release tenant than in our Targeted Release Tenant...

This will no longer work and cause the error described in this issue:

$themepalette = @{
   ...
    "whiteTranslucent40" = "rgba(173, 173, 173, 0.7)";
   ...
}

As this is officially used also in Microsoft Docs I assume this is a bug by them. However, I found a workaround which does solve it for us. INstead of using the RGBA value we have now set an 8-digits HEX value which does contain opacity as well. I got this idea after finding this in the documentation about the classic theming: https://learn.microsoft.com/en-us/sharepoint/dev/general-development/color-palettes-and-fonts-in-sharepoint

image

So this is what we replaced it with in our case to get it back working again:

$themepalette = @{
   ...
    "whiteTranslucent40" = "#b3adadad";
   ...
}