Jump to content


Unauthorized access to http://URL/api/version

swarm p4vs

  • Please log in to reply
3 replies to this topic

#1 Domenic

Domenic

    Advanced Member

  • Members
  • PipPipPip
  • 101 posts

Posted 27 February 2015 - 07:13 PM

We've recently had some people update to P4VS 2014.3.100.9144 but they are reporting issues when launching Visual Studio due to Swarm connectivity. The error from the P4VS log is:
[Error: P4API.NET] 24/02/2015 16:38:07.2089 : Perforce.SwarmApi.SwarmServer+SwarmException:{error:"Unauthorized"}
at Perforce.SwarmApi.SwarmServer.HttpGet(String RequestUrl)
at Perforce.SwarmApi.SwarmServer.get_GetVersion()
at Perforce.P4VS.P4ScmProvider.CheckForSwarm()
[Error: Inner Exception] 24/02/2015 16:38:07.2099 : System.Net.WebException:The remote server returned an error: (401) Unauthorized.
at System.Net.HttpWebRequest.GetResponse()
at Perforce.SwarmApi.SwarmServer.HttpGet(String RequestUrl)

and the user sees this:
swarm_401.png

Our Swarm version is 2014.4/988814. Looking at a Fiddler trace it seems P4VS is trying to access http://URL/api/version, and when the user tries to access the link in a web browser they also get the "unauthorized" message.

They've been able to workaround it by following these steps:
  • Open Tools > Options > Source Control > Perforce – Connections and set “Automatically log off when closing a connection” to checked

  • Click Ok

  • Restart Visual Studio

  • When prompted for a Perforce password, enter the one shown when running the “p4 login -ap” command

  • Open Tools > Options > Source Control > Perforce – Connections and set “Automatically log off when closing a connection” to unchecked
However, it doesn't seem that is a permanent fix and they need to follow the steps again within a few days (or perhaps it is whenever their ticket expires).

Are there additional permissions we need to setup in Swarm so users can access the versions page?

#2 P4Shimada

P4Shimada

    Advanced Member

  • Members
  • PipPipPip
  • 831 posts

Posted 17 March 2015 - 11:27 PM

Hi Domenic,

I see you also have an open case with Perforce Support on this. Here is the feedback one of our colleagues had for this issue:

"Okay, so I finally got rpl.forward.login to work by adding in a setting for cluster.id and it solves numerous problems with login issues in a complex installation.

Basically, when you are building out your infrastructure, pick a cluster.id that doesn't match anything in the confugure table to avoid any issues with it reading those because setting cluster.id will make the server look for settings that match.

Then, on each replica/edge you configure, add rpl.forward.login=1 to the replication settings.

After that, the tickets created will all look something like this:

servername:[url="http://cluster.id"]cluster.id[/url]=user:ticket

I was having considerable issues with tickets not working properly in an environment where the master has an edge in front of it and the edge server also has a broker in front of it. Users would login, and then it would say the password was invalid on the next command. It was quite frustrating. This seems to have solved the problem, and I definitely recommend we make use it of it when installing for our customers from now on to avoid these issues. "

#3 Max Pavlov

Max Pavlov

    Advanced Member

  • Members
  • PipPipPip
  • 59 posts

Posted 14 November 2016 - 05:39 PM

@P4Shimanada, where do we set the cluster.id in case we have a single server setup and no cluster management tool installed. We are running a plain p4d on Windows and since updating to the latest version of p4d started to get this error every time we login to perforce via p4vs plugin.

#4 Domenic

Domenic

    Advanced Member

  • Members
  • PipPipPip
  • 101 posts

Posted 15 November 2016 - 02:41 AM

http://answers.perfo...ticles/KB/11958 has the info on setting cluster.id, or auth.id if you're running 2015.2+.



Also tagged with one or more of these keywords: swarm, p4vs

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users