drive.files.insert failed with error: Not Being Used

33 views
Skip to first unread message

Alan Wells

unread,
Jul 26, 2019, 2:59:23 PM7/26/19
to Google Apps Script Community
I'm getting an error:

API call to drive.files.insert failed with error: File not found: Not Being Used

What does that mean?

The code is trying to create a new file, so it's not looking for a file.  And if it's not looking for a file, then why would there be an error "File not found"  Unless, it's looking for a folder to put the file into, and the folder was not picked by the Google file picker?

Michele Pisani

unread,
Jul 27, 2019, 10:11:29 AM7/27/19
to Google Apps Script Community
Usually in this case the error message "404" (file does not exist) means that the user does not have read access to a file.
M

Alan Wells

unread,
Aug 1, 2019, 9:22:51 AM8/1/19
to Google Apps Script Community
I'm still not sure the exact cause of that error, but I'm having the code first search for the folder that the created file is supposed to go into, within it's own try/catch, and if there is an error, then I'm assuming that the drive.file scope can't access that folder, so it creates a folder and uses that newly created folder.  It's not a great solution, but it's better than a total failure.
Reply all
Reply to author
Forward
0 new messages