question

PhilippeNONORGUES-2110 avatar image
0 Votes"
PhilippeNONORGUES-2110 asked philippenonorgues-6376 commented

Cannot delete missingsetupfile with powershell

Hello,

I had a missingsetupfile error in SharePoint 2019.

I got Id, SiteId and Web Id from SQL and used PowerShell script to get the file url, but when I ran $file.delete() I got the message below :
89425-missingsetupfile-delete-error.jpg



I saw folder and xaml file in storman.aspx page, but not in site menu or site content.
Can you help me to resolve this error?

Thank you.

office-sharepoint-server-administration
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

I am currently looking into this issue and will give you an update as soon as possible.

Thank you for your understanding and support.

0 Votes 0 ·
JoyZ avatar image
0 Votes"
JoyZ answered PhilippeNONORGUES-2110 commented

Hi @PhilippeNONORGUES-2110,

Per my test, I could delete the workflow.xaml file successfully using following powershell:

 $web = get-spweb -Identity http://sp13:xxxxx
 $file = $web.getfile("wfsvc/3bcdc4256c604385b73fa92852a4aaa2/workflow.xaml")
 $file.delete()

From your error message, it seems that the file doesn't exist in the site collection.

Try to run sharepoint powershell as administrator to compare the result.
89776-image.png
Another question, why not delete the workflow directly in SharePoint Designer?


If an Answer is helpful, please click "Accept Answer" and upvote it.

Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.



image.png (20.9 KiB)
· 7
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @JulieWang-MSFT ,

Thank you for your message, as you can see I ran the script, but I got the same error.
We have not installed SharePoint Designer because the farm is SharePoint 2019.
The developer who did the job left the company. This job seems to have been improperly deleted.

89904-missingsetupfile-delete-error2.jpg


0 Votes 0 ·
JoyZ avatar image JoyZ PhilippeNONORGUES-2110 ·

Hi @PhilippeNONORGUES-2110,

Please download and install ShrePoint designer 2013 in SharePoint server 2019 to check if you could delete workflow in designer 2013.

(SharePoint designer 2013 is compatible with SharePoint server 2019.)

Please also switch to another sites with 2013 workflows to check if the same issue occurs.

0 Votes 0 ·

Hi @JulieWang-MSFT ,

I have installed SharePoint designer. I cannot see the wrong workflow or the folder with the xaml file
The team installed Nintex solution for workflow and forms so they did not use MS Workflow Manager.
I think I have to clean directly in database even if it is not recommended.
Can you help me for this?

Thank you.

0 Votes 0 ·
JoyZ avatar image JoyZ PhilippeNONORGUES-2110 ·

Hi @PhilippeNONORGUES-2110,

When you open the site in SharePoint designer, navigate to workflow option, if there are workflows under it, delete it, this will also delete the related folder with the xaml file.

90704-image.png

If there are no instances, we suggest you ask help for the third party workflow, since Nintex is not supported by Microsoft.



0 Votes 0 ·
image.png (22.2 KiB)

hI @JulieWang-MSFT ?

Thank you for your reply.

Unfortunately, it didn't work.
I deleted the worklow present in the list and refresh. Also wait the week-end with the hope that some jobs will clean the database.

For your information, the workflow error was present before we installed the Nintex solution. Developers preferring this product to WFM.

Thank you

0 Votes 0 ·
JoyZ avatar image JoyZ PhilippeNONORGUES-2110 ·

Hi @PhilippeNONORGUES-2110,

In order to get a better forum experience, we changed your answer to a comment.

Why did you want to clean the database?

If you cannot see the workflow in SharePoint Designer, the workflow has been deleted from the site, there is no need to delete the database.

0 Votes 0 ·

Hi @JulieWang-MSFT ,

My goal is to clean up the database, because the error "Missing Setup File" is present in SharePoint Health Monitor.
PowerShell script and SharePoint Designer failed to clear this error.
The team no longer wants to see this error.

91616-missingsetupfile-delete-error3jpg.png


0 Votes 0 ·
JoyZ avatar image
0 Votes"
JoyZ answered philippenonorgues-6376 commented

@PhilippeNONORGUES-2110,

Use a SQL query to find the location of the missing setup file and then a Window PowerShell script to remove the file reference from SharePoint Sever.

To reduce the risk of locking or other performance issues it is preferable to run these queries should be against backup copy or snapshot of the database.

SQL sample for listing setup file information:

 USE SP_ContentPortal(backup or snapshot)
 SELECT id, SiteID, DirName, LeafName, WebId, ListId
 FROM AllDocs (NOLOCK) where SetupPath = 'Features\BCEE.recettage....\Workflow.xaml'

PowerShell sample for removing setup files by ID:

 #File Information
 $setupFileID = "xxx"
 $siteID = "xxx"
 $WebID = "xxx"
 #Get file
 $site = Get-SPSite -Identity $siteID
 $web = Get-SPWeb -Identity $WebID -Site $siteID
 $file = $web.GetFile([GUID]$setupFileID)
 #Report on location
 $filelocation = "{0}{1}" -f ($site.WebApplication.Url).TrimEnd("/"), $file.ServerRelativeUrl
 Write-Host "Found file location:" $filelocation
 #Delete the file, the Delete() method bypasses the recycle bin
 $file.Delete()
 $web.dispose()
 $site.dispose()

More information for your reference:

https://sharepointhelpmm.wordpress.com/2018/05/08/post-upgrade-cleanup-missing-server-side-dependencies/

Note: Microsoft is providing this information as a convenience to you. The sites are not controlled by Microsoft. Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. Please make sure that you completely understand the risk before retrieving any suggestions from the above link.


If an Answer is helpful, please click "Accept Answer" and upvote it.

Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @JulieWang-MSFT ,

Thank you for your answer, but if you read my first post I did the exact same steps.
I used multiple scripts from different sites and I got the same error.

  1. https://docs.microsoft.com/fr-fr/archive/blogs/dawiese/post-upgrade-cleanup-missing-server-side-dependencies

  2. https://www.sharepointdiary.com/2016/01/fix-missingsetupfile-error-test-spcontentdatabase-in-sharepoint-migration.html

  3. http://etienne-sharepoint.blogspot.com/2011/10/solving-missingsetupfile-errors-from.html

Powershell scripts dont work in our case. This is why we need your help.

Thank you

0 Votes 0 ·
JoyZ avatar image JoyZ philippenonorgues-6376 ·

@PhilippeNONORGUES-2110,

If above steps not work for you, we suggest you to open a support ticket about it. It needs more detailed investigation with support team instead of simple troubleshooting via replies in forum. And we will appreciate it if you can update your findings here.

Please go to the website (https://support.microsoft.com/en-sg/help/4051701/global-customer-service-phone-numbers) to find related number and call it to create a new Phone Service Request to Microsoft Phone Support team.

0 Votes 0 ·

Thank you for your answer.
I will ask the customer to open a call.

0 Votes 0 ·