PnP-PowerShell icon indicating copy to clipboard operation
PnP-PowerShell copied to clipboard

Install-SPOSolution returns error "Invalid Field Name"

Open hanielc opened this issue 11 years ago • 5 comments

Hi,

I'm trying to deploy a WSP to my Office 365 tenant. The manifest.xml file looks as follows:

<?xml version="1.0" encoding="utf-8"?>
<Solution xmlns="http://schemas.microsoft.com/sharepoint/" SolutionId="7da4b965-0514-4e14-ae87-a75618ab3e56" SharePointProductVersion="15.0">
  <Assemblies>
    <Assembly Location="Intranet.dll" DeploymentTarget="GlobalAssemblyCache" />
  </Assemblies>
  <FeatureManifests>
    <FeatureManifest Location="Intranet_.Intranet.Core\Feature.xml" />
    <FeatureManifest Location="Intranet_.Intranet.NewsSlider\Feature.xml" />
  </FeatureManifests>
</Solution>

When I enter the command Install-SPOSolution -PackageId 7da4b965-0514-4e14-ae87-a75618ab3e56 -SourceFilePath 'Intranet.wsp' it returns the following error:

Install-SPOSolution : Invalid field name. {33e33eca-7712-4f3d-ab83-6848789fc9b6}  /sites/deptest/_catalogs/design
At line:1 char:1
+ Install-SPOSolution -PackageId 7da4b965-0514-4e14-ae87-a75618ab3e56 -SourceFileP ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : WriteError: (:) [Install-SPOSolution], ServerException
    + FullyQualifiedErrorId : EXCEPTION,OfficeDevPnP.PowerShell.Commands.InstallSolution

Where does the 33e33eca-7712-4f3d-ab83-6848789fc9b6 come from? I'm able to deploy the WSP successfully via the UI.

hanielc avatar Aug 17 '15 18:08 hanielc

I will close this issue as the issue as such is not related to the cmdlet functionality. The cmdlet merely uploads the solution using the core library. Effectively the cmdlet is one line of code:

ClientContext.Site.InstallSolution(PackageId.Id, SourceFilePath, MajorVersion, MinorVersion);

However, the Guid is most likely the ID of the field in question.

If you use the cmdlets to connect to the target site, you can retrieve the field in question with:

Get-SPOField -Identity 33e33eca-7712-4f3d-ab83-6848789fc9b6 

In the core library we use the DesignPackage classes to upload and activate the solution. While this most of the time works, it's not a given that it works in every environment or with every solution package, as the DesignPackage classes are specifically targeted toward, as the name says, Design Packages. As those are sandboxed solution packages as such, we found that in our test cases the functionality also works with other sandboxed solution packages.

I recommend you to create an issue in the officedev/pnp-sites-core repository if your issue remains.

erwinvanhunen avatar Aug 17 '15 18:08 erwinvanhunen

@hanielc did you figure out what was the issue? I'm getting an exact same error message when trying to install a sandbox solution.

valtynikov avatar Jan 06 '16 19:01 valtynikov

@valtynikov, no I was not able to figure it out. I ended up using native CSOM code to get it to work.

hanielc avatar Jan 18 '16 00:01 hanielc

This seems to be an issue with many users, is there a place for support as to why this will not work. From the manifest you can pull out the solution id but it reverts to saying that it has an invalid field name and seems to be the same for the two already on this thread.

MavJutras avatar Apr 19 '16 20:04 MavJutras

I was getting this issue when the WSP was already in the Solution Gallery and I was running the PnP function for the first time.

Deleting the WSP so it is uploaded fresh via PnP-PowerShell resolved it.

MartinHatch avatar Jul 07 '17 12:07 MartinHatch