AddAttachments GP Tool Not Working for SDE Feature Classes

1001
10
07-19-2012 07:32 AM
JamesGustine
New Contributor III
I am having trouble getting the AddAttachments GP Tool to work with SDE feature classes. The tool works nicely with the same feature class in a file geodatabase.

Its not failing per se just returning messages like:

Cannot add file 'x'

Notes:
1) I am using the same Input dataset and Match table with the OBJECT ID as the key
2) the Path field is a UNC Path. I tried converting the UNC to a mapped drive....no dice.
3) These files exist on disk.
4) I have tried running the tool within an edit session via arcpy and the da module. Doesn't work either.
5) Its not a privilege issue, I can load the attachments manually in ArcMap  (1 @ a time).
6) The attachment table is registered as versioned.
7) Local 10.1 Desktop client with a direct connect to a 10.0 geodatabase (SS 2008 R2).

Any help on this would be greatly appreciated.

<James>
0 Kudos
10 Replies
RussellBrennan
Esri Contributor
Hi James,

If you reference the full path to the data (feature class with attachments enabled) when you run the tool rather than the layer name from the TOC do the attachments get added successfully?
0 Kudos
JamesGustine
New Contributor III
Thanks for looking into this.

No. the attachments fail to load in all scenarios, via ArcCatalog (with full paths) and ArcMap (with Layer name in the TOC and full path). Same result in VS2010 using python.
0 Kudos
RussellBrennan
Esri Contributor
I tried to repro this on a number of machines here and was unable to. I would suggest contacting Tech Support so that they can help determine where this is failing.
0 Kudos
MichaelDesroches
New Contributor
Hi James,

Did you ever get down to the cause of this? I'm discovery with tech support at the moment and would welcome any additional insight.
0 Kudos
TaraGallant
New Contributor
I am having similar issue; add attachments work fine in a local file gdb, but as soon as I try this within SDE I get results that show Cannot add file _____.

I am not sure if it is a privileges issue within SDE for that particular db, something to do with replication? I am using 10.1 SP1

Any help would be appreciated.
0 Kudos
JamesGustine
New Contributor III
I worked with tech support to "resolve this". Not sure of the root cause, but the work around is to create a copy of the feature class in SDE and run the tool on that.

Let me know if that works for you. Mabey someone else has a better idea. At this point my plan is to export the copy the gdb to a dev environment upate the attachments and move it back to production.
0 Kudos
MichaelDesroches
New Contributor
This is a known bug, and I have been told by esri tech support that the geoprocessing team is taking a look at it to be included in the sp2.
0 Kudos
TimothyMichael
Occasional Contributor II
This is the only thread that I have come across that addresses this issue, but I am experiencing the same behavior in ArcGIS 10.1.  Just like the original poster, I have tried:

1.  GP tool and python via python window in Desktop.
2.  Tried running GP tool in an edit session.
3.  File(s) exist on disk on the machine that I am running this tool from.
4.  Tried mapped drive and local paths.
5.  I can add an attachment manually, so that is working and I have the necessary rights to do so.
6.  Tried running GP tool from Catalog and Desktop
7.  Etc. 

The error is the same as well: "Cannot add file 'X' to feature with OID = 'X'"

The feature class participates in a replica, so making a copy is not an option.

The environment is ArcGIS for Desktop Standard 10.1, SP1.  Database in SDE; geodatabase version matches the ArcGIS release.

Thanks!
Tim
0 Kudos
TimothyMichael
Occasional Contributor II
I opened a case with Esri support and found that this behavior is a known bug - NIM073706 - that pertains to running the Add Attachments tool against data that is registered as versioned.  The work around that I used was to compress my database, unregister the feature dataset and attachment table as versioned, and then run the tool.  After the tool ran successfully I registered my data as versioned again.

--Tim
0 Kudos