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

Bug report: spo file copy sometimes failing #6422

Open
milanholemans opened this issue Oct 9, 2024 · 0 comments
Open

Bug report: spo file copy sometimes failing #6422

milanholemans opened this issue Oct 9, 2024 · 0 comments
Assignees

Comments

@milanholemans
Copy link
Contributor

Priority

(Medium) I'm annoyed but I'll live

Description

I'm currently migrating a lot of SharePoint pages to another site collection. While 95% of the files are working great, I noticed that about 5% (or less) of the files are failing with a vague error:

Error: Cannot read properties of undefined (reading 'TargetObjectSiteRelativeUrl')

This error is caused by this piece of code:

const copyJobResult = await spo.getCopyJobResult(args.options.webUrl, copyJobResponse);
if (this.verbose) {
await logger.logToStderr('Getting information about the destination file...');
}
// Get destination file data
const siteRelativeDestinationFolder = '/' + copyJobResult.TargetObjectSiteRelativeUrl.substring(0, copyJobResult.TargetObjectSiteRelativeUrl.lastIndexOf('/'));
const absoluteWebUrl = destinationPath.substring(0, destinationPath.toLowerCase().lastIndexOf(siteRelativeDestinationFolder.toLowerCase()));

I noticed that sometimes, for some files, the SharePoint copy job doesn't return a result object. I currently have no idea why/when this is happening. When this error occurs on a file and I try again, everything works just fine.

Steps to reproduce

Migrate a lot of files. It's hard to reproduce.

Expected results

100% success rate

Actual results

2-5% of the files throw an error:

Error: Cannot read properties of undefined (reading 'TargetObjectSiteRelativeUrl')

Diagnostics

No response

CLI for Microsoft 365 version

v10.0.0

nodejs version

v20.10.0

Operating system (environment)

Windows

Shell

PowerShell

cli doctor

No response

Additional Info

Let's put it on hold until the following issues are closed:

These issues have a higher importance and need to change stuff to the SharePoint copy job util as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant