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

18543
42
Jump to solution
02-26-2021 04:09 AM
Labels (1)
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
WarrenMedernach
Occasional Contributor III

I'm having the same issue right now and want to clarify something.  I don't have a hostname.properties and from what I can find this file simply looks like:

hostname=<some host name>

My Admin URL in the Portal Machine Properties is:
https://<FQDN>:7443/arcgis/portaladmin

So when I create this hostname.properties file with the 'shortname', is the shortname:
hostname=<FQDN>/arcgis?

0 Kudos
EricAnderson_DHS
Occasional Contributor

@WarrenMedernach if you don’t have a hostname.properties file, no need to create one. Just update the c:/Windows/system32/drivers/etc/host file and create a new (Uncommented) line with IP and short name of the machine. Then restart Portal.

 

The shortname is just the name of the machine without the domain. (If Portal FQDN is machine.domain:7443/arcgis, short name is just “machine”)

WarrenMedernach
Occasional Contributor III

Thanks so much @EricAnderson_DHS for the quick response!

We have the Home Application & Enterprise Sites 3 patches installed, and unfortunately, jut editing the sys32 host file isn't working for our implementation.  I'm wondering if I need to go the hostname.properties route?

0 Kudos
DanMcCoy1
New Contributor III

@WarrenMedernach wrote:

 

jut editing the sys32 host file isn't working for our implementation.  I'm wondering if I need to go the hostname.properties route?


Warren, 

Are you *only* changing the host file or are you also following the rest of the instructions here?

https://community.esri.com/t5/arcgis-enterprise-portal/webgisdr-backup-fails-with-quot-failed-to-gen...

0 Kudos
WarrenMedernach
Occasional Contributor III

Sorry @DanMcCoy1 , I should have been more explicit in my responses.

Yes, I made the change to the /Windows/system32/drivers/etc/host file, and I've been re-booting the server in between these changes.  When the machine comes back up, I check the Portal machine properties and the Admin URL still contains the /portaladmin

Just to confirm, since this is an Azure VM, should the 'local ip address' referenced in the instructions be the:

  • private ip
  • public ip
  • locahost address (127.0.0.1)
0 Kudos
DanMcCoy1
New Contributor III

I'm guessing the private ip since it has to do with the server communicating with itself...?  Maybe, @JonathanQuinn  can confirm....?

Also, you might try this other patch....
https://community.esri.com/t5/arcgis-enterprise-portal/webgisdr-backup-fails-with-quot-failed-to-gen...

0 Kudos
Sander
by
New Contributor III

Not only restart portal but reboot server. You are on the right way if you notice a new sub folder in your Portal log folder location ..\arcgisportal\logs\<SHORTNAME> instead of ..\arcgisportal\logs\<FQDN>

WarrenMedernach
Occasional Contributor III

Thanks @Sander that got me onto the correct path...

So it turns out there already WAS a folder in the logs folder with the shortname.  Once I renamed this and rebooted with the shortname in the hosts file, it created a new folder, and the machine name and Admin URL is now updated to the correct name.  This seems to have resolved it and I'm running the backup now.  We'll see if it is successful, but it seems to be progressing along nicely.

StefaniaLovins
New Contributor

Thank you, this helped tremendously!  I ran into the same issue on v10.9.1.  Two things I had to do differently:

  1. For steps 1 and 4, I didn't have a hostname.properties file.  Instead I went into my server's host file and added the entry there.
  2. After both "Restart the Portal" steps, I had to reboot my entire server.

With those minor tweaks to your steps I was able to get webgisdr running.

0 Kudos
DianaBenedict1
New Contributor III

I wanted to post how I was able to fix this obscure issue. In our case we DID NOT change the host name but rather did an upgrade from 10.6.1 to 10.8.1

After looking at all the various solutions I decided to do the following:

  1. Confirmed I ran the patch upgrade since one of our users noticed the issue with Sites not using the correct URL
  2. My DEV environment worked fine where as my UAT and PROD did not
  3. I compared the servers and how they were configured and verified that the hostname.properties file was missing from the <install-folder>\ArcGIS\Portal\framework\etc on our UAT and PROD but not on the DEV Server
  4. I copied the hostname.properties file into the same install directory in UAT and  PROD Portal servers and changed the hostname value ( hostname=<my-server-name>.<my-domain-name.org> )
  5. I restarted the Portal for ArcGIS service and waited for about 20 mins until my portal was back up and running again
  6. re-ran the webgisdr export utility and it worked

Hope this works for someone else. It was a little tricky to get figured out.

Thanks,

Diana

0 Kudos