I faced this issue in SharePoint online environment. When I try to add 20-30 items in SharePoint list using for loop and rest api I get below error after adding around 15 items in the list.
Exception from HRESULT: 0x80131904
The ajax calls are asynchronous. The scenario was working fine earlier and started failing now. My Site collection has 19 GB free space out of 20GB.