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

Deleting all objects results halfway (6.000) in a paging error #15

Open
Ruffio opened this issue Jun 28, 2018 · 8 comments
Open

Deleting all objects results halfway (6.000) in a paging error #15

Ruffio opened this issue Jun 28, 2018 · 8 comments
Assignees

Comments

@Ruffio
Copy link

Ruffio commented Jun 28, 2018

Hi.

I'm using Powershell to remove all objects as per: https://github.com/lithnet/resourcemanagement-powershell/wiki/Remove-Resource

I got about 6.000 objects removed, then I got the error about paging. It is not really an issue for me as I just started the script again and then I will get the rest of the objects removed, but I just wanted to let you guys know.

If this is working as expected, then maybe a note on the above page would be a good idea? Just a suggestion. I have searched the Wiki for paging but didn't get any results.

lithnet remove fails

@FredrikMelby
Copy link

Have you tried to use the "Search-ResourcesPaged" command? By using this, you can bulk delete objects instead of deleting one object at a time:

image

@Ruffio
Copy link
Author

Ruffio commented Jun 28, 2018

No, I didn't think of that. I just followed the wiki and used what was described there. Maybe it should be updated with a note about the above? I mean, when there is an example about deleting all the objects in one/two line, I expect what is described there to be the most optimal way.

Btw. my script just failed again after 3.000 entries. Can I expect to get the paging error for every time, I'm half way?

@Ruffio
Copy link
Author

Ruffio commented Jun 28, 2018

Hmmm, and it failed again at 1.500 :-( So I was right about it is failing every time I get halfway.

I will use the above bulk method, but I really think, that there is an issue here...

@Ruffio
Copy link
Author

Ruffio commented Jun 28, 2018

And failed again when having 600 left out of 1.500. If there is a limit when removing objects, it should be noted in the wiki

@Ruffio
Copy link
Author

Ruffio commented Jun 28, 2018

And failed again when getting to 200 out of 600

@FredrikMelby
Copy link

I have seen this behaviour in rare cases using the paged search cmdlet (against several thousand objects), but never as consistent as you describe here. Them I have also ended up running my scripts again when this has occured - but it's usually finishes ok the second time.

@Ruffio
Copy link
Author

Ruffio commented Jun 28, 2018

The last 200 objects has now been removed by the last attempt. If this is expected behavior I'm willing to close this issue. However I think there should be a note about it or at least that one should consider to use the paged search approach, if that is better, but reading the above comment suggests that approach also can fail.

@ryannewington ryannewington self-assigned this Jun 28, 2018
@ryannewington
Copy link
Member

That's a bug.

I'll also update the guidance for deleting large numbers of objects. The examples shown aren't the most efficient for very large datasets, @FredrikMelby example is the correct way.

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

3 participants