WebGISDR Backup fails with "Failed to generate token for Portal for ArcGIS. Verify that the credentials you entered are correct"

17852
42
Jump to solution
02-26-2021 04:09 AM
MHahn
by
New Contributor II

The Portal Installation has been updated from 10.7.1 to 10.8.1. 
I am not sure if webgisdr worked after update. But now I got the following error in the webgisdr log: 

2021-02-26 12:53:32 ERROR [main] com.esri.arcgis.webgis.client.WebGISDR - Failed to generate token for Portal for ArcGIS. Verify that the credentials you entered are correct. Check the WebGIS DR utility logs and the Portal for ArcGIS logs for more information.

 I double checked the password 🙂 

In the logback.xml in the webgis directory I set the loglevel to DEBUG. After that I saw the following exception.

Caused by: java.lang.RuntimeException: The response returned HTTP status code 404. Requested URL: https://[fqdn of internal portal url]:7443/arcgis/portaladmin/sharing/rest/generateToken

I got the same response in a browser.
The url to the generateToken endpoint is: 

https://[fqdn of internal portal url]:7443/arcgis/sharing/rest/generateToken 

without the portaladmin directory 

Did I miss something?

 

Thanks!

 

42 Replies
JonathanQuinn
Esri Notable Contributor

There may be some incorrect logic to determine when the hostname changes, so we're looking into that. What you can do though is:

1) Install the patch
2) Determine the IP address of the portal machine
3) In the etc\hosts file, resolve the short name of the machine to the IP address. This ensures that the Web Adaptor and everything else continues to work, because the short name will resolve to the same machine
    10.0.0.1 portal #FQDN is portal.domain.com
4) Restart the portal service
5) Verify that the Machines API within the Portaladmin API returns the correct information, albeit with the short name
6) Remove the etc\hosts entry
7) Restart the portal service
8 ) Verify that the Machines API within the Portaladmin API returns the correct information, using the FQDN.

You may need to unregister the standby first, as hostname changes should be blocked if the portal is HA.

EricAnderson_DHS
Occasional Contributor

Thanks @JonathanQuinn !

 

We tried your suggestion, however, after adding a line in the etc\hosts file with the IP of the Portal machine and the Portal shortname, it does not update the machine name from the Portaladmin end-point (Still shows FQDN, not shortname). And of course this means the Admin URL of the machine still points to https://fqdn:7443/arcgis/portaladmin.

 

We noticed when pinging the machine via shortname, it was resolving to IPv6, but we updated this using the steps below so it prefered IPv4 instead, but this still did not work for us.

 

https://docs.microsoft.com/en-us/troubleshoot/windows-server/networking/configure-ipv6-in-windows

 

Let me know if you have any other suggestions to fix that Admin URL and thanks a bunch for all your help so far!

0 Kudos
DanMcCoy1
New Contributor III

Jonathon,

Which patch is supposed to fix this?

Thanks,

Dan

 

EricAnderson_DHS
Occasional Contributor

Dan,

 

I'm working with Esri Support on this and they said the Home Application patch was intended to fix this, but it didn't. The fix was looped into the Enterprise Sites 3 patch, but wasn't indicated in the patch details. Unfortunately, the Enterprise Sites 3 patch did not resolve the issue for us, so we're continuing to troubleshoot with Esri. I'll hopefully close the loop on this thread once resolved. 

JonathanQuinn
Esri Notable Contributor

Unfortunately, the patch prevents it from occurring, rather than fixing a currently incorrect URL. The behavior if the hostname changes with the patch installed is that the URL is updated correctly. There may be some incorrect logic that detects that your hostname changed when it didn't, which we need to investigate.

However, with the patch installed, you should be able to take advantage of what the software should be doing already; updating the URL to be the correct one:

1) Add an entry to the etc\hosts file on the portal machine to resolve the local IP address to the short name of the machine

2) Restart portal

3) Sign into the Portaladmin API and check the Machines API to ensure that the URL is correctly referencing the short name without portaladmin at the end

4) Remove the etc\hosts entry

5) Restart Portal

6) Make sure that the URL is referencing the FQDN.

 

I tested this on my end and was able to fix the issue with the patch installed. Have you gone through this with Support?

EricAnderson_DHS
Occasional Contributor

Hey @JonathanQuinn ,

 

Tested further this morning with Esri Support, and after installing the Home Application + Enterprise Sites 3 patch, simply updating the C:\System32\drivers\etc\hosts file to include an entry with Portal machine IP + machine shortname was not enough - this did not change the machine name in the Portaladmin Machines API page to the shortname (thus admin url was still incorrect).

 

What we had to do instead was change the hostname in the C:\Program Files\ArcGIS\Portal\framework\etc\hostname.properties file to the short name which did successfully update the machine name to the shortname in the Machines API page (removed entry in etc\hosts prior). 

 

Esri Support mentioned if this hostname.properties file exists, it supersedes the etc\hosts entry, is that correct? This hostname.properties file already existed with the FQDN. 

JonathanQuinn
Esri Notable Contributor

Ah, good find. Yes, the hostname.properties file does supercede the etc\hosts entry. Did you see the value change when you updated the hostname.properties file?

0 Kudos
KrystalPhaneuf2
Occasional Contributor

@JonathanQuinn 

We are attempting this in our development environment today.  Just want to clarify the name should change in the Portal Admin > Machines > Machine name.   We have installed the Enterprise Sites 3 patch that was supposed to correct the behavior. We plan to:

Update the C:\Program Files\ArcGIS\Portal\framework\etc\hostname.properties file to the shortname

Restart the Portal

check the admin page for shortname

Change the short name back to the FQDN in the hostname.properties file

Restart Portal

Check admin name again for FQDN

Retry webgisdr

JonathanQuinn
Esri Notable Contributor

Yes, those steps look correct. 

0 Kudos
KrystalPhaneuf2
Occasional Contributor

We completed the steps I listed and our webgisdr is currently running successfully.  Thank you!!!