Esri / arcgis-python-api

Documentation and samples for ArcGIS API for Python
https://developers.arcgis.com/python/
Apache License 2.0
1.91k stars 1.11k forks source link

Property "manager" of VectorTileLayer not available with webadaptor with "Administrative access disabled" #1470

Open Biboba opened 1 year ago

Biboba commented 1 year ago

Describe the bug

Property "manager" of VectorTileLayer is broken for a VectorTileLayer hosted on ArcGIS Enterprise 11.0 with wed adaptor configured with "Administrative access disabled".

To Reproduce Steps to reproduce the behavior:

 vector_tile_layer = VectorTileLayer.fromitem(vtpk_layer)
 dir(vector_tile_layer.manager)

error:

Traceback (most recent call last):
  File "C:\Users\myusername\Miniconda3\envs\aeadm\lib\site-packages\requests\models.py", line 971, in json
    return complexjson.loads(self.text, **kwargs)
  File "C:\Users\myusername\Miniconda3\envs\aeadm\lib\json\__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "C:\Users\myusername\Miniconda3\envs\aeadm\lib\json\decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "C:\Users\myusername\Miniconda3\envs\aeadm\lib\json\decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 3 column 1 (char 4)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\myusername\Miniconda3\envs\aeadm\lib\site-packages\arcgis\gis\_impl\_con\_connection.py", line 993, in _handle_response
    data = resp.json()
  File "C:\Users\myusername\Miniconda3\envs\aeadm\lib\site-packages\requests\models.py", line 975, in json
    raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Expecting value: line 3 column 1 (char 4)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Users\myusername\Miniconda3\envs\aeadm\lib\site-packages\arcgis\mapping\_types.py", line 4941, in manager
    self._admin = EnterpriseVectorTileLayerManager(adminURL, self._gis, self)
  File "C:\Users\myusername\Miniconda3\envs\aeadm\lib\site-packages\arcgis\mapping\_types.py", line 4237, in __init__
    self._is_hosted = self.properties["portalProperties"]["isHosted"]
  File "C:\Users\myusername\Miniconda3\envs\aeadm\lib\site-packages\arcgis\gis\__init__.py", line 16917, in properties
    self._hydrate()
  File "C:\Users\myusername\Miniconda3\envs\aeadm\lib\site-packages\arcgis\gis\__init__.py", line 16954, in _hydrate
    self._refresh()
  File "C:\Users\myusername\Miniconda3\envs\aeadm\lib\site-packages\arcgis\gis\__init__.py", line 16905, in _refresh
    raise e
  File "C:\Users\myusername\Miniconda3\envs\aeadm\lib\site-packages\arcgis\gis\__init__.py", line 16894, in _refresh
    dictdata = self._con.post(
  File "C:\Users\myusername\Miniconda3\envs\aeadm\lib\site-packages\arcgis\gis\_impl\_con\_connection.py", line 1528, in post
    return self._handle_response(
  File "C:\Users\myusername\Miniconda3\envs\aeadm\lib\site-packages\arcgis\gis\_impl\_con\_connection.py", line 996, in _handle_response
    raise Exception(resp.text)
Exception: 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1">
<style> body {
      font-family: Avenir-Light, Verdana, Geneva, sans-serif;
      font-weight: 0;
      font-size: 13px;
      margin: 0;
      padding: 0;
    }

    h1 {
      font-size: 16px;
      color: #38698c;
      float: left;
      margin: 13px 0 0;
    }

    a {
      text-decoration: underline;
      color: #38698c;
    }

    #waConfig {
      margin-top: 36px;
    }

    .logoImg {
      float: left;
      margin: 0 15px 0 0;
    }

    .helpHolder {
      width: 670px;
      margin: 0 auto;
    }

    .pane {
      -moz-border-radius: 8px;
      -webkit-border-radius: 8px;
      border-radius: 8px 8px 8px 8px;
      -moz-box-shadow: 0 0 3px #000;
      -webkit-box-shadow: 0 0 3px #000;
      box-shadow: 0 0 3px #000;
      border: none;
      background-color: #fff;
    }

    .paneTitleBar {
      background-color: #38698c;
      background: -moz-linear-gradient(center top, #64a7ce 0%, #38698c 100%);
      background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#64a7ce), to(#38698c));
      filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#64a7ce', endColorstr='#38698c');
      color: #fff;
      border: none;
      height:20px;
    }

    .paneContent {
      border-top: none;
      background-color: transparent;
      padding: 4px 38px 20px;
    }

    .radioHolder{
      padding:0 0 16px 48px;
    }

    .configDialog {
      width: 728px;
      font-size: 1em
      z-index: 1001 !important;
      margin: 0 auto;
    }

    .ErrorText {
      width: 550px;
    }

    .logoHolder {
      background-color: #f7f7f3;
      -moz-border-radius: 10px 10px 0 0;
      -webkit-border-radius: 10px 10px 0 0;
      border-radius: 10px 10px 0 0;
      background-image: -moz-linear-gradient(center top, #f7f7f3, #e1e1dd);
      background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#f7f7f3), to(#e1e1dd));
      filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#e7e7e7');
      height: 42px;
      overflow: hidden;
      padding: 0 10px;
    }

     input[type=submit] {
      border: 1px solid #759dc0;
      padding: 2px 4px 4px 4px;
      color: #000000;
      -moz-border-radius: 4px;
      border-radius: 4px;
      -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.15);
      -moz-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.15);
      box-shadow: 0 1px 1px rgba(0, 0, 0, 0.15);
      background-color: #bcd8f4;
      background-repeat: repeat-x;
      background-image: -moz-linear-gradient(#ffffff 0px, rgba(255, 255, 255, 0) 3px, rgba(255, 255, 255, 0.75) 100%);
      background-image: -webkit-linear-gradient(#ffffff 0px, rgba(255, 255, 255, 0) 3px, rgba(255, 255, 255, 0.75) 100%);
      background-image: -o-linear-gradient(#ffffff 0px, rgba(255, 255, 255, 0) 3px, rgba(255, 255, 255, 0.75) 100%);
      background-image: linear-gradient(#ffffff 0px, rgba(255, 255, 255, 0) 3px, rgba(255, 255, 255, 0.75) 100%);
      filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#bcd8f4', endColorstr='#ffffff');
      cursor: pointer;
      _background-image: none;
      float:right;
    }

    input[type=submit]:hover {
      background-color: #86bdf2;
      color: #000000;
      -webkit-transition-duration: 0.2s;
      -moz-transition-duration: 0.2s;
      transition-duration: 0.2s;
      filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#86bdf2', endColorstr='#ffffff');
    }

    input[type=radio] {
      cursor: pointer;
      margin:0 30px 0 0 ;
    }  

    input[type=checkbox] {
      cursor: pointer;
      margin:0 20px 0 0 ;
    }

    a.helptip span {
        display: none;
        padding: 2px 3px;
        margin-left: 8px;
        width: 300px;
    }

    a.helptip.about:hover span {
        margin-left: -320px;
        width: 200px
    }

    a.helptip.about:focus span {
        margin-left: -320px;
        width: 200px
    }

    a.helptip:hover span {
        display: inline-block;
        position: absolute;
        top: 40px;
        text-decoration: none;
        -moz-border-radius: 8px;
        -webkit-border-radius: 8px;
        border-radius: 8px 8px 8px 8px;
        -moz-box-shadow: 0 0 3px #000;
        -webkit-box-shadow: 0 0 3px #000;
        box-shadow: 0 0 3px #888;
        border: none;
        padding: 15px;
        background: #d6ffbd;
        color: #444444;
        margin: 0 0 30px;
    }

    a.helptip:focus span {
        display: inline;
        position: absolute;
        text-decoration: none;
        -moz-border-radius: 8px;
        -webkit-border-radius: 8px;
        border-radius: 8px 8px 8px 8px;
        -moz-box-shadow: 0 0 3px #000;
        -webkit-box-shadow: 0 0 3px #000;
        box-shadow: 0 0 3px #888;
        border: none;
        padding: 15px;
        background: #d6ffbd;
        color: #444444;
        margin: 0 0 30px;
    }
    a.tooltip span {
      display:none; 
      padding:2px 3px; 
      margin-left:8px; 
      width:300px;
    }
    a.tooltip.about:hover span{
    margin-left:-320px;
    width:200px
    }
    a.tooltip.about:focus span{
    margin-left:-320px;
    width:200px
    }
    a.tooltip:hover span {
      display:inline; 
      position:absolute; 
      text-decoration:  none;
       -moz-border-radius: 8px;
      -webkit-border-radius: 8px;
      border-radius: 8px 8px 8px 8px;
      -moz-box-shadow: 0 0 3px #000;
      -webkit-box-shadow: 0 0 3px #000;
      box-shadow: 0 0 3px #888;
      border: none;
      padding: 15px;
      background:#d6ffbd;
      color: #444444;
      margin: 0 0 30px;
    }

     a.tooltip:focus span {
      display:inline; 
      position:absolute; 
      text-decoration:  none;
       -moz-border-radius: 8px;
      -webkit-border-radius: 8px;
      border-radius: 8px 8px 8px 8px;
      -moz-box-shadow: 0 0 3px #000;
      -webkit-box-shadow: 0 0 3px #000;
      box-shadow: 0 0 3px #888;
      border: none;
      padding: 15px;
      background:#d6ffbd;
      color: #444444;
      margin: 0 0 30px;
    }

    .statusTable {
      -moz-border-radius: 8px;
      -webkit-border-radius: 8px;
      border-radius: 8px 8px 8px 8px;
      -moz-box-shadow: 0 0 3px #000;
      -webkit-box-shadow: 0 0 3px #000;
      box-shadow: 0 0 3px #888;
      border: none;
      padding: 15px;
      background:#d6ffbd;
      margin: 0 0 30px;
    color: #444444;
      width: 625px;
    }

    .configTable {
      width: 640px;
    }

    .runAtExample {
      font-size: 12px;
      margin: 5px 0;
      display: block;
      color: #4B4B4B;
    }

    .enableAdminAccessHolder {
     height: 70px;
    }

    .ExampleLabel {
      font-size: 12px;
      padding-left: 0;
      display: block;
      margin: 5px 0;
      color: #4B4B4B;
    }

    .errorTitle {
      color:#FF0000; 
      font-size:large; 
      font-family: Arial,Verdana,arial,sans-serif;
      font-weight:bold;
    }

    .errorLabel {
      font-family: Arial,Verdana,arial,sans-serif;
      font-size: 15px;
    }</style>

  <title>
    Application Error
</title></head>
<body>
    <div class="helpHolder">
      <p id="helpLinkElement" class="help">
      </p>
    </div>
    <div class="configDialog pane">
       <div class="logoHolder">
         <img alt="Esri Logo" class="logoImg" src="/arcgis/webadaptor/images/logo.png" />
         <h1>ArcGIS Web Adaptor</h1>
       </div>
       <div class="paneTitleBar"></div>
    <div id="contentHolder" class="paneContent">

<div id="Div2" class="statusTable" style="background: #FFCDCD; padding-top: 5px; margin-top: 14px">
                      <table>
                        <tr>
                          <td width="50">
                            <img alt="" src="/arcgis/webadaptor/images/error.png" />
                          </td>
                          <td>
                            <p class="errorLabel">
                                Administrative access is disabled. Please contact your system administrator to enable it.

                            </p> 
                          </td>
                        </tr>
                      </table>
                    </div>

    </div>
      </div>
</body>
</html>

Expected behavior Property "manager" should work even if webadaptor has administrative access diabled.

Platform (please complete the following information):

Thanks !

nanaeaubry commented 1 year ago

Hello, we are looking into this as it may be a common framework problem.

I will update here once we have made progress on the issue.

nanaeaubry commented 2 months ago

@Biboba Do you have a service we can test with?