Error The content database on the server is temporarily unavailable.
Details: Deployment failed in host web https://tenant.sharepoint.com/sites/DEMOSITE2 for app document-editor-action-client-side-solution/ab2f96a4-f787-4199-9aaf-289bd46997ec. System.Exception: HandleProvisioningException rethrowing: The specified properties CommandUIExtension are not supported for client-side custom action. —> Microsoft.SharePoint.SPException: The specified properties CommandUIExtension are not supported for client-side custom action. at Microsoft.SharePoint.Utilities.SPUtility.ThrowSPExceptionWithTraceTag(UInt32 tagId, ULSCat traceCategory, String resourceId, Object[] resourceArgs) at Microsoft.SharePoint.SPUserCustomAction.ValidateClientSideAction() at Microsoft.SharePoint.SPUserCustomAction.Update() at Microsoft.SharePoint.SPWebUserCustomAction.Update() at Microsoft.SharePoint.SPCustomActionElement.AddCustomActionToDatabase(SPSite site, SPWeb webNull) at Microsoft.SharePoint.SPCustomActionElement.UpdateCustomActionsTable(SPFeature feature, SPSite site, SPWeb web, CultureInfo cultureInfo, Boolean fForce) — End of inner exception stack trace — at Microsoft.SharePoint.SPFeature.HandleProvisioningException(Exception e, Boolean force) at Microsoft.SharePoint.SPCustomActionElement.UpdateCustomActionsTable(SPFeature feature, SPSite site, SPWeb web, CultureInfo cultureInfo, Boolean fForce) at Microsoft.SharePoint.SPFeature.UpdateCachedFeatureDefinitionInformation(SPSite site, SPWeb web, Boolean fForce) at Microsoft.SharePoint.SPFeature.Activate(SPSite siteParent, SPWeb webParent, SPFeaturePropertyCollection props, SPFeatureActivateFlags activateFlags, Boolean fForce) at Microsoft.SharePoint.SPFeatureCollection.AddInternal(SPFeatureDefinition featdef, Version version, SPFeaturePropertyCollection properties, SPFeatureActivateFlags activateFlags, Boolean force, Boolean fMarkOnly) at Microsoft.SharePoint.Packaging.SPTargetWebDeploymentGroup.InstallOrUpgrade(SPSite site, Nullable`1& solutionId, Boolean& swapNeeded)
f5c55868-e56d-4c6a-a2fc-79b59b4977a9
The CommandsSet.ts code is –
import { override } from '@microsoft/decorators';
import { Log } from '@microsoft/sp-core-library';
import {
BaseListViewCommandSet,
Command,
IListViewCommandSetListViewUpdatedParameters,
IListViewCommandSetExecuteEventParameters
} from '@microsoft/sp-listview-extensibility';
import { Dialog } from '@microsoft/sp-dialog';
const LOG_SOURCE: string = 'DocumentEditorAction';
export interface IDocumentEditorActionCommandSetProperties {
// This is an example; you can define any properties you need
}
export default class DocumentEditorActionCommandSet extends BaseListViewCommandSet<IDocumentEditorActionCommandSetProperties> {
@override
public onInit(): Promise<void> {
Log.info(LOG_SOURCE, 'Initialized DocumentEditorActionCommandSet');
return Promise.resolve();
}
@override
public onListViewUpdated(event: IListViewCommandSetListViewUpdatedParameters): void {
const compareOneCommand: Command = this.tryGetCommand('COMMAND_1');
if (compareOneCommand) {
compareOneCommand.visible = event.selectedRows.length === 1;
}
}
@override
public onExecute(event: IListViewCommandSetExecuteEventParameters): void {
switch (event.itemId) {
case 'COMMAND_1':
this.openDocumentEditor(event);
break;
default:
throw new Error('Unknown command');
}
}
private openDocumentEditor(event: IListViewCommandSetExecuteEventParameters): void {
try {
const itemUrl = event.selectedRows[0].getValueByName('FileRef');
if (!itemUrl) {
throw new Error('Unable to get the document URL');
}
const encodedItemUrl = encodeURIComponent(itemUrl);
const editorUrl = ${this.context.pageContext.web.absoluteUrl}/_layouts/15/WopiFrame.aspx?sourcedoc=${encodedItemUrl}&action=edit;
Log.info(LOG_SOURCE, Opening editor URL: ${editorUrl});
// Create a modal dialog
const dialogContent = `
<div id="documentEditorModal" style="position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.5); display: flex; justify-content: center; align-items: center; z-index: 1000;">
<div style="background-color: white; width: 90%; height: 90%; display: flex; flex-direction: column; border-radius: 8px; box-shadow: 0 4px 6px rgba(0,0,0,0.1);">
<div style="padding: 10px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #e0e0e0;">
<h2 style="margin: 0;">Edit Document</h2>
<button onclick="closeDocumentEditor()" style="background: none; border: none; font-size: 18px; cursor: pointer;">×</button>
</div>
<iframe src="${editorUrl}" style="flex-grow: 1; border: none; width: 100%;"></iframe>
</div>
</div>
`;
// Create a script element for the close function
const scriptContent = `
function closeDocumentEditor() {
const modal = document.getElementById('documentEditorModal');
if (modal) {
modal.remove();
}
}
`;
// Insert the modal into the page
const modalContainer = document.createElement('div');
modalContainer.innerHTML = dialogContent;
const modalElement = modalContainer.firstElementChild;
if (modalElement) {
document.body.appendChild(modalElement);
} else {
throw new Error('Failed to create modal element');
}
// Insert the script into the page
const scriptElement = document.createElement('script');
scriptElement.textContent = scriptContent;
document.body.appendChild(scriptElement);
} catch (error) {
Log.error(LOG_SOURCE, error);
Dialog.alert(An error occurred while trying to open the document editor: ${error.message});
}
}
}
How I can fix it. Please tell me the ways.
I tried to rebuild packagae.
Install and Uninstall the package
Clear the cache
searchbefore shop is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1