Error 001156: Failed on input OID <value>; could not write value '<value>' to output field <value>. Script fails when run on scedule, no fail when run manually

07-13-2018 12:50 AM
New Contributor III

I have a script that reads a table with data from a CSV file and processes the information. This script is set to run on a server through the scheduler, after the updated csv files are made available. For each run, I recreate an empty inputtable from a template and append the data from the csv. I might add that the script has been working flawless for months, but this suddenly changed about two weeks ago. Recently, the script has started to fail every time, with the error message shown above:

001156: Failed on input OID <value>; could not write value '<value>' to output field <value>

It fails on the first line from the csv, the failing value is '601240.2' and the output field is a double field. 

The strange thing is that if I open the script in IDLE and run it from there, it will run perfectly. 

Does anyone have any suggestions as to why this fails in the sceduler and works perfectly when ran maually?

Tags (1)
5 Replies
MVP Esteemed Contributor

What changed two weeks ago?  Did the field names in the csv change?  Any blanks or special characters?  A google search of the error (001156: Failed on input OID ; could not write value '' to output field .—Help | ArcGIS Desktop ) suggests a field type mismatch.  Maybe change your target field to float?

That should just about do it....
New Contributor III

What changed two weeks ago? Good question. As far as I know nothing changed. The input CSV files are formatted in the same way, and that first line that fails now is not changed from before. The script or the target database is not changed. The error suggests a type mismatch, but the data is already set as a float (double) - and it works when I run it manually. 

The strange thing is just that: it runs fine in the shell, but fails when sceduled.

0 Kudos
Esteemed Contributor

Was there any kind of patch (Windows OS I assume) applied to the server in the past two weeks that you were not informed about?

0 Kudos
New Contributor III

It might have been, but not to my knowledge. The question is what kind of patch would that be to mess up a script only when run by the sceduler from a .bat-file and not when running the same script from console/IDLE...?

0 Kudos
New Contributor

Was there ever a resolution for this?

0 Kudos