Failed to Create Replica in Collector

9850
25
08-11-2014 05:04 PM
KarenFolger
Occasional Contributor II

I have finally gotten Collector to work "connected" but the disconnected editing seems to be the holy grail.  A lot of things had to be fixed 1st.  Upgrade geodb to 10.2.2, unregister as versioned, enable archiving, oh, but 1st migrate the storage type to geometry.  Oh, and that little hint about adding the tag line of "offline-ready" to the Portal map before the Download button would show up on Collector on my Android device.  And then I have to figure out how to get my tile package on there.  So if I click download and use the tile package I get the Failed to Create Replica error.  If I try to use ESRI basemaps I get a different message - something about Unable to generate token, Invalid Username or Password.  For what?  I'm the db admin on the map services and db and I had to login with my credentials to view the feature service.  So what is this?  What other hoop do we have to jump through?  How do we actually get this stuff to work.  I wish it worked as easily as ArcGIS for Windows Mobile, which had syncing with usb.  Server 10.2.2, SQL 2008 R2, Windows Server 2008 R2.

Tags (2)
25 Replies
RussRoberts
Esri Notable Contributor

Here are the fields you will need to change/enter:

Replica Name: can be anything

Layers: This would be the layers you are downloading so 0,1,2,3...

Geometry: The extent you are using, coma separate the values. Extent Helper for Web Mercator maps

Input SR: spatial ref of service: 102100

Output SR: the SR the basemap is in: 102100

Create Rep Async: True

Sync Model: Per Replica

Cheers

Russ

0 Kudos
KarenFolger
Occasional Contributor II

So there was no dropdown in the Sync Model for "Per Replica" - there was only perLayer.  Not sure of the order of xy on the extent but did both mins 1st, then maxes.  Had to lookup the coordinate system for UTM NAD Zone 11 which I came up with as 2153.  The basemap is a Tile Package in the same coordinate system. 

I ran the request and received the following errors in the Manager log.  The service is published with a GlobalID so not sure what the problem is.sync_error.JPGreplica_parms.JPG

0 Kudos
HeatherMcCracken
Esri Contributor

Hi Karen,

I'll try to clarify a couple of things to see if we can help sort this out.

Firstly - the server log is indicating that there is not a GlobalID field on the "Facility_UtilHydrants_Pt".  I'm assuming this is the table that is referenced by Layer 0 in your service?

Can you confirm in the back end geodatabase that this table has a field of Type "GlobalID" (not GUID). 

Secondly...some clarification with the REST inputs.

The perReplica sync model is applicable for Versioned data.

The perLayer sync model is applicable for Non-versioned archived data.

So it makes sense that only the "perLayer" model is available to you based on how you prepared your data.

The format for the geometry looks something like this:

"xmin": -117.1756306304369,

  "ymin": 32.70997289655956,

  "xmax": -117.1568780005883,

  "ymax": 32.73084570678091

I've included an easy way to make sure you are getting  the formatting below.

The input and output SR parameters will default to the SR of the input data which is defined in the Service.  So if you want to be consistent with this, then you do not need to supply Input Spatial Reference or Replica Spatial Reference. You can leave them blank.

Steps for easy way to get the proper formatting for the Geometry

1) Go to your Feature Service endpoint (i.e http://<yourServer>:6080/arcgis/rest/services/<yourFeatService>/FeatureServer

2) Click the JSON button at the top of the page... this will add "?f=pjson" to the end of the URL.

3) look for one of the extent items (i.e shown below) - and copy xmin - ymax portion

"initialExtent": {

  "xmin": -117.1756306304369,

  "ymin": 32.70997289655956,

  "xmax": -117.1568780005883,

  "ymax": 32.73084570678091,

  "spatialReference": {

  "wkid": 4326,

  "latestWkid": 4326

  }

4) Fill in your own extents

5) Copy paste this to your Geometry value

Here's an example of inputs to a service I have

CreateReplica.jpg

KarenFolger
Occasional Contributor II

Table has GlobalID - there is only one feature class in the service.  Data is in UTM NAD83, zone 11 as per my previous post, so I put in parameters for that. Still same error.  I can edit in connected mode - just not disconnected. It's a non-versioned Feature class with Archiving on as per specs.  Wish that were not the case but oh well.

global.JPG

replica_parms2.JPG

sync_error2.JPG

0 Kudos
HeatherMcCracken
Esri Contributor

Hmmmm

Does the layer have attachments or participate in relationships?  Attachments and RC need to be based on GlobalID fields. They cannot be based on the ObjectIDs.

http://resources.arcgis.com/en/help/main/10.2/index.html#//0154000006m1000000

If you do have attachments or Rcs, can you check the properties. You will want to Properties to specify that the GlobalID is the primary key field

Attach_GlobalID.jpg

If they are based on OBJECTID you can use the Migrate Relationship Class GP tool to migrate these from ObjectID to GlobalID.

http://resources.arcgis.com/en/help/main/10.2/index.html#//001700000193000000

You will need to republish the FS after this schema change .

KarenFolger
Occasional Contributor II

There are no relationship classes or attachments.  There are a few domains.  For what it's worth, this originated as a 10.0 geodb.  We had to jump through some hoops to get it up to what I thought was going to be disconnected editing.  Upgrade DB, Upgrade storage type, blah, blah, blah.  I know it's all new technology but it's very frustrating.

0 Kudos
HeatherMcCracken
Esri Contributor

I understand.

Are you able to submit a support incident. From the logs above it appears it should be in the Feature Service team queue (as opposed to being an issue with the Collector App.)

Ideally include a backup of your data (a subset would be all thats needed) - just enough so that we can repro it in house and see what's up.

You can mention to the support analyst you were conversing with me on the forums so that they can alert me when the issues comes in and we can look at it.

Thanks,

Heather

0 Kudos
KarenFolger
Occasional Contributor II

I will try and do that - have to go through our national or regional office, but worth it.  Stay tuned.

0 Kudos
GISSupport3
Occasional Contributor III

G'day Karen

Can you (quickly) create a new 10.2.2 geodatabase, create a new feature class, prep the feature class for offline editing, add a few points, and try creating the feature service again?

0 Kudos
KarenFolger
Occasional Contributor II

Surprise! It worked this way.  Now it's not really feasible to recreate all our SQL databases from scratch.  We had updated according to specs but there's something weird.  One clue is that I cannot check the box on the service that will not sync on the Feature Access to Enable ownership-based access control on features.  It's just greyed out along with the Query, update and delete options.  I don't want to use that at this point, but I cannot use this service anyway.  Any hints?

0 Kudos