Select to view content in your preferred language

System.reindex

482
2
09-28-2017 04:04 PM
JoeHershman
MVP Regular Contributor

Trying to run the reindex on the API.  If I run passing default parameters or passing in mode=full 

sys.reindex(mode="FULL")
sys.reindex()

It fails with an error: 

No enum constant com.esri.arcgis.portal.admin.core.system.IndexOptions.FULL

---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
<ipython-input-34-50fad27eb260> in <module>()
----> 1 sys.reindex(mode="FULL")

D:\Anaconda3\lib\site-packages\arcgis\gis\admin\_system.py in reindex(self, mode, includes)
    240             params['includes'] = includes
    241         res = self._con.post(path=url,
--> 242                              postdata=params)
    243         if 'status' in res:
    244             return res['status'] == 'success'

D:\Anaconda3\lib\site-packages\arcgis\_impl\connection.py in post(self, path, postdata, files, ssl, compress, is_retry, use_ordered_dict, add_token, verify_cert, token, try_json, out_folder, file_name, force_bytes, add_headers)
   1127                 elif errorcode == 498:
   1128                     raise RuntimeError('Invalid token')
-> 1129                 self._handle_json_error(resp_json['error'], errorcode)
   1130                 return None
   1131         except AttributeError:

D:\Anaconda3\lib\site-packages\arcgis\_impl\connection.py in _handle_json_error(self, error, errorcode)
   1147 
   1148         errormessage = errormessage + "\n(Error Code: " + str(errorcode) +")"
-> 1149         raise RuntimeError(errormessage)
   1150 
   1151 class _StrictURLopener(request.FancyURLopener):

RuntimeError: No enum constant com.esri.arcgis.portal.admin.core.system.IndexOptions.FULL
(Error Code: 500)

It works fine if passing in the other enum values USER_MODE, GROUP_MODE, SEARCH_MODE.

Just for fun I ran:

sys.reindex('FULL_MODE')

This does complete successfully.  Seems like a little bug in the API which defaults to FULL not FULL_MODE 

Thanks,
-Joe
0 Kudos
2 Replies
AndrewChapkowski
Esri Regular Contributor

What version of portal are you doing the reindex on?

0 Kudos
JoeHershman
MVP Regular Contributor

I am running on 10.5

Thanks,
-Joe
0 Kudos