I created two custom webparts using react and the pnpjs library:
- A Forms Webpart that allows me to consult, add or edit items in lists
of my sharepoint site.
- A Migration Webpart that allows to migrate list items from my
previous sharepoint site to my new one. It takes all the list items
in a previous site of mine and adds them in a new site, with a
slightly different structure.
Migration goes without any issue, all my previous site items are pasted to my new one.
Once migration done, my other webpart allows me to consult and edit my items, as planned.
However, impossible to add new items in certain lists !
I get this error :
Error making HttpClient request in queryable [500] Internal Server Error ::> {"odata.error":{"code":"-2146232060, Microsoft.SharePoint.SPException","message":{"lang":"fr-FR","value":"Exception from HRESULT: 0x80131904"}}}
However, the method I use to add items to these lists is stricly identical to the one I used during migration (using pnpjs).
I then tried to add items in these lists directly via sharepoint online forms, and get a similar error :
Erreur : Exception from HRESULT: 0x80131904
After reading some forums, I could see that it could be due to a lack of space in the site, however my storage metrics shows that I use less than 0.1%. I also read some possible issues with a temp DB, but sharepoint online has none.
Notes :
- It sometimes happens that I can add items to these lists. It happens
randomly and rarely more than once in a row. I could not find any
correlation of this with anything, it seems completely random to me.
- I noticed that this problem occured with the lists that were the more
populated (more than 100 items). However, all of my lists contain
less than 4000 items, which should not be a problem.
- In lists that contain few items, I can add some with my webpart or
sharepoint online forms with no issue.
- I also noticed that when I delete items from these lists, I could
then add a few. But this is not a solution since the problem
eventualy comes back, and I don't want to delete any items from these
lists anyway.
- when I just create the new lists without populating them, my forms
webpart works fine as well.
- The problem occurs when I create the lists and then populate them
with the migration webpart.
- I read about some throttling issue that could be happening. If I
understand it correctly, an account could be blocked from adding
items after too many requests in a period of time. However in my case
this problem persists after days, and with different accounts as
well.
- I also read that it could be a permission issue, but even trying to
add with the account that created the lists and did the migration,
the error persists.
What I really don't get is how adding a large amount of items (using pnpjs) works just fine and then fails when using another webpart or sp online forms.
I sincerly hope that I will be able to solve this issue, thanks a lot to everyone !