Jump to content
yuko

Moving Passwordstate and has error occurred.

Recommended Posts

I have question about how to migration complete.
 
Following blow procedure,moving operation was done.
But when i connect to New URL "https://<Server name>:9119/"
i got error 
Like attachement. 
 
and DB error is blow , of cause before migration add Authorized Web Servers.

USE Passwordstate

SELECT * From DebugInfo

------------------------------------------------------------------ ------------------------------------------------------------------
General Error Error Code = Index was outside the bounds of the array., StackTrace =    at Passwordstate.WebServer.ValidateWebServerHostName() Error
------------------------------------------------------------------ ------------------------------------------------------------------

how to resolve this issue??

 

■Procudure
Moving Passwordstate Web Site to a New Server
Moving Passwordstate Database to a New Server
 
■Enviroment
Current server
Web and db in same saver.
OS windows server 2012 std
SQL:Microsoft SQL Server 2012 (SP1) - 11.0.3156.0 (X64)   May  4 2015 18:48:09   Copyright (c) Microsoft Corporation  Standard Edition (64-bit) on Windows NT 6.2 <X64> (Build 9200: ) (Hypervisor) 
 
ToBe server 
Web and db in same saver.
OS windows server 2016 DC
SQL:Microsoft SQL Server 2017 (RTM) - 14.0.1000.169 (X64)   Aug 22 2017 17:04:49   Copyright (C) 2017 Microsoft Corporation  Express Edition (64-bit) on Windows Server 2016 Datacenter 10.0 <X64> (Build 14393: ) (Hypervisor) 
 
i will wait for replay.

524.png

Share this post


Link to post
Share on other sites

Hi Yuko,

 

As mentioned in our email, we can assist with this issue as long as your company is willing to purchase maintenance with their software, If this is not a possibility, and we certainly understand if it's not, then hopefully someone from the community can assist you.

 

Regards

Click Studios

Share this post


Link to post
Share on other sites

I didn't want to open a new thread because it seems like I'm seeing the same error.  I'm just practicing a full disaster recovery scenario.  So for my test, I spun up a single server with IIS10 on Windows 2016 and also installed MS SQL Server 2016 std and installed PasswordState.  Just doing the forms based setup, added some users, imported a fairly large KeePass file to simulate some passwords.  Everything looks good.

 

Recovery Procedure:

Following the documentation, I restored the database to a new MS SQL box, create the passwordstate_user as described and made it the owner of the passwordstate database.  I can use SQL manager to view the build number, all looks fine.

 

I spin up a new IIS Server, install passwordstate.  Before opening the webpage, I modify the web.config as specified in the documentation.  I entered the two keys I had exported and set the SetupStage to "Setup Complete".  Then I updated my connection string, recycled the IIS site, and everything seems good when hitting the "https://mysite/emergency".  I need to add my new IIS server to the "authorized server" list so I can log in normally...but that's when I get the same error.  The error sort of implies I need to have the host name already in the list but from the documentation, I thought the emergency url link will allow you to add a server while in this emergency mode.

 

Setting up web.config from scratch as specified in 6.14.3 in the current user manual is what I followed.

 

Error Code = Object reference not set to an instance of an object., StackTrace =    at Passwordstate.WebServer.ValidateWebServerHostName()

 

I did notice there is one more line in the web.config on the original server being generate.  I'm guessing I'll see that in the new IIS server once the host is added...or is this what is keeping me from adding the host to the DB?  I just need to know if this is not the correct way to recover from a disaster or if I need to insure I recreate the IIS server with the same name.  However, I did that test as well, with the same name server I got the same issue.  It wasn't until I added this GUID1 into the config, did it work for me but that was breaking my scenario of where I lost completely my IIS server and only have a DB backup and the exported keys from the when I installed. 

<add key="GUID1" value="e007ddba-1717-4fc6-b5cf-ead7a07a4fcd" />

 

So did I do something wrong or is the documentation off on this "6.14.3 Rebuilding the Web.config File" section of the manual?  If this GUID1 is needed could it be exported along with the rest of the keys?  Again, I'm just running a scenario where I lost my IIS server completely and trying to recover.

 

 

I'm not actually changing server OS or SQL versions as in the original user's post.  Going from same to same.

 

PasswordState BuildNo: 8519

OS: Windows 2016 Standard

SQL: SQL 2016  Std 

Share this post


Link to post
Share on other sites

Hi tburke,

 

It seems you've done everything correctly, but what we have not testing is actually logging into the web site using the /emergency URL. Normally all you should need to do is browse to the base URL, and you will be presented with a screen which says the "server is not authorized" to host Passwordstate. On this screen you can enter your Emergency Access Password, and it will write that GUID1 setting into the file.

 

Did you try browsing the the base URL? you can also delete that GUID1 key from the file again if you like to test the process.

Let us know how you go.

Regards

Click Studios

Share this post


Link to post
Share on other sites

Ok, wiped it all out again, same process, restore database, remove passwordstate_user on the database....read it in the security section making sure it's the owner of the passwordstate DB.  Query to DB looks fine.  Spun up a brand new IIS box, installed Passwordstate.  In the web.config before pointing the browser to the site:

 

  • Updated Connection string with IP of SQL server, passwordstate_user and password.
  • Turned "SetupStage" value to "Setup Complete"
  • Added values for Secret1 and Secret2
  • Restart entire IIS service just to be sure.

 

Quote

 

 An Error Has Occurred

Unfortunately an error has occurred within the Passwordstate web site, for which we apologize for the inconvenience. 

If Passwordstate is able to communicate with the database, then the error will be logged on the screen Administration -> Passwordstate Administration -> Error Console.
 
If you are unable to view the Error Console screen for any reason, you can ask your Database Administrator to run the following SQL Query, which will show the same data from the Error Console Screen: 

USE Passwordstate
SELECT * FROM DebugInfo
 
If you need some assistance from Click Studios in troubleshooting this error, please ask your Passwordstate Security Administrators to contact us for help.

 

 

Using the above query on the DB I got:

 

Quote

Error Code = Object reference not set to an instance of an object., StackTrace =    at Passwordstate.WebServer.ValidateWebServerHostName()

 

No Guid1 added in web.config at this point.

 

Back to using the "/emergency" Url.  Emergency password worked and I'm in the Administration tab. Can't add web server, same as before.

 

So the next thing I tried was inserting the GUID1 key back into the web.config.  Sure enough, this time when I went to the normal url (without the /emergency path) I get the "Web Server Not Registered".  I entered my emergency password and it looks like it adds the web server just fine and I'm good to go.  I'm a little worried about not being able to reconstruct the web.config by just using the exported keys.  I haven't tried it with the latest build, I'm still testing this at V8.5 (Build 8519). 

 

 

 

Share this post


Link to post
Share on other sites

Hi tburke,

 

Thanks for pointing this out, and we need to update our documentation here a little bit - what you will need to do is add the following line in your web.config file:

 

<add key="GUID1" value="" />

 

Once this is done, and browse to the site, you will be prompted to enter your Emergency Access password to register the web server properly. It seems to be adding a duplicate GUID1 setting when doing this, bit does work - we will look into why this is doing this.

Sorry for the oversight, and we will update our documentation now.

Regards

Click Studios

Share this post


Link to post
Share on other sites

Ah, this worked great, thank you!  So the only thing really missing here is setting that value under "Administration" and "System Settings" and "miscellaneous" at the same time.

 

Quote

Specify the Base URL for your site, which is used within the body of emails, permalinks, etc:

 

I would think if your replacing the webserver you would want this updated as well.  Maybe have it as an option when adding the server like this?  This seems like it's really close to being able to be containerized.  I'd love that to be the update path, just drop in a new container instead of pushing these files  around...plus it would be easier to test out new features before deploying them.  Since all the configuration is kept in the database, this would be really slick setup.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...