How can I debug an AJAX error in VBO? (PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '' for key 'uri' I have a view that lists all the user accounts on my site.  With VBO, I have a rules component, Resave user account (action set, action: save entity (user), no force saving immediately).

Recently, when I attempt to re-save all user accounts, I got an error on id=4037:


  An AJAX HTTP error occurred. HTTP Result Code: 500 Debugging
  information follows. Path: /en/batch?id=4037&amp;op=do StatusText: Service
  unavailable (with message) ResponseText: PDOException:
  SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry
  '' for key 'uri': INSERT INTO {file_managed} (filesize, status,
  timestamp) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1,
  :db_insert_placeholder_2); Array ( [:db_insert_placeholder_0] => 0
  [:db_insert_placeholder_1] => 1 [:db_insert_placeholder_2] =>
  1375690632 ) in drupal_write_record() (line 7153 of
  /Volumes/Bullfrog/om/includes/common.inc).


And when I attempted to save all accounts again, the error occurred on id=4039:


  An AJAX HTTP error occurred. HTTP Result Code: 500 Debugging
  information follows. Path: /en/batch?id=4039&amp;op=do StatusText: Service
  unavailable (with message) ResponseText: PDOException:
  SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry
  '' for key 'uri': INSERT INTO {file_managed} (filesize, status,
  timestamp) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1,
  :db_insert_placeholder_2); Array ( [:db_insert_placeholder_0] => 0
  [:db_insert_placeholder_1] => 1 [:db_insert_placeholder_2] =>
  1375691655 ) in drupal_write_record() (line 7153 of
  /Volumes/Bullfrog/om/includes/common.inc).


So, if I simply continue to re-save again and again, eventually all the accounts will get re-saved, but to execute this bulk operation takes about 20 minutes each time, so I will waste several hours this way.  How can I analyze what is the cause of this error?
Duplicate entry '' for key 'uri' actually says a little more than AlexK realizes, it says both that there's a file without a uri, hence the '', and that you have more than one of these, hence the Duplicate entry.

I'm guessing there's a filefield on your users, and some of these have lost part of their data for reasons I don't understand. (The same thing happened to me once during a faulty export-from-one-site-and-import-to-another).

Why the process can be "forced" by repetition I don't understand, but close inspection of the user entity and any fields that could have a 'uri' key, both through devel and the raw data in the DB, should reveal what the source of the problem is.