# Problems after migrating ContinuaCI to another Server (and PostgreSQL-Server)

**URL:** https://www.finalbuilder.com/forums/t/problems-after-migrating-continuaci-to-another-server-and-postgresql-server/6476
**Category:** Bugs
**Created:** [April 19, 2019, 2:02am UTC](https://www.finalbuilder.com/forums/t/problems-after-migrating-continuaci-to-another-server-and-postgresql-server/6476 "2019-04-19T02:02:37Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![chrisfor](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/c/71e660/32.png) [@chrisfor](https://www.finalbuilder.com/forums/u/chrisfor)
#### Post date: [April 19, 2019, 2:02am UTC](https://www.finalbuilder.com/forums/t/problems-after-migrating-continuaci-to-another-server-and-postgresql-server/6476/1 "2019-04-19T02:02:37Z")

</div>

Hi there,

my old CI-server was running on Windows 10 with a local postgres db. I am in the process of migrating it to a new Windows 10 machine and have it connected to a dedicated postgres instance.

I stumbled over two problems:

**User Logins do not work anymore**. I could circumvent that by letting CI-Server settup another empty postgres instance, created the same user with the same password and copied the password hash over with a postgres-db tool. After that I could login again and the dashboard shows the project to compile. But …

**When I click a project I get 'An unexpected error occured: Padding is invalid and cannot be removed.'**

I checked the windows events and found the following exception:

```
An error occurred while resolving project with name '<projectname>'. Details: Exception: CryptographicException

Message: Padding is invalid and cannot be removed.

Stack Trace: at System.Security.Cryptography.RijndaelManagedTransform.DecryptData(Byte[] inputBuffer, Int32 inputOffset, Int32 inputCount, Byte[]& outputBuffer, Int32 outputOffset, PaddingMode paddingMode, Boolean fLast)
   at System.Security.Cryptography.RijndaelManagedTransform.TransformFinalBlock(Byte[] inputBuffer, Int32 inputOffset, Int32 inputCount)
   at Continua.Shared.Extensions.StringExtensionsUtils.Decrypt(String value)
   at Continua.Shared.Variables.VariableDTOMappings.<>c.<ConfigureVariables>b__0_0(Variable v, VariableDTO dto)
   at Continua.Shared.Mapping`2.Map(TSource source, TDestination destination)
   at Continua.Shared.Mapping`2.Map(TSource source)
   at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at Continua.Shared.Mapping`2.Map(IEnumerable`1 sources)
   at Continua.Services.DataTransferObjects.CoreDTOMappings.<>c.<Configure>b__0_0(Project p, ProjectDTO dto)
   at Continua.Shared.Mapping`2.Map(TSource source, TDestination destination)
   at Continua.Shared.Mapping`2.Map(TSource source)
   at Continua.Shared.Mapping`2.Map(TSource source, Action`2 modifier)
   at Continua.Services.CoreService.ResolveProject(String name)

```

I googled and found this:  
[https://stackoverflow.com/questions/8583112/padding-is-invalid-and-cannot-be-removed](https://stackoverflow.com/questions/8583112/padding-is-invalid-and-cannot-be-removed)  
Could it be that there is simply a Trim missing before decryption?

This cryptographic exception seems related to the one I got in the old buildserver after installing all windows updates. CI-Server refused to start with a Cryptographic Exception complaining about a temporary user not having enough priviliges.

Some more info: My postgres server is now running under debian. The only thing I adjusted in the dumpfile in order to import it was LC\_Collate and LC\_CTYPE:

From:

`CREATE DATABASE "ContinuaCI" WITH TEMPLATE = template0 ENCODING = 'UTF8' LC_COLLATE = 'English_United States.1252' LC_CTYPE = 'English_United States.1252';`

To:

`> CREATE DATABASE "ContinuaCI" WITH TEMPLATE = template0 ENCODING = 'UTF8' LC_COLLATE = 'en_US.UTF-8' LC_CTYPE = 'en_US.UTF-8';`

---

<div class="post-metadata">

### Author: ![Sparky](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/sparky/32/10_2.png) [@Sparky](https://www.finalbuilder.com/forums/u/Sparky)
#### Post date: [April 19, 2019, 11:03pm UTC](https://www.finalbuilder.com/forums/t/problems-after-migrating-continuaci-to-another-server-and-postgresql-server/6476/2 "2019-04-19T23:03:02Z")

</div>

Hi Christian,

This error occurs when attempting to decrypt an encrypted string using the wrong encryption key. The encryption keys are stored in the `<appSettings>` section of server configuration file:

```auto
 <add key="Continua.HashSalt" value="***"/> 
 <add key="Continua.SymmetricEncryptionKey" value="***"/>
 <add key="Continua.SymmetricEncryptionVector" value="***"/>

```

When migrating ensure that these keys are copied from the old server to the new server.

The sever configuration file is located at \<continua\_install\_path\>\Server\Continua.Server.Service.config. By default, this is at %ProgramFiles%\VSoft Technologies\ContinuaCI\Server

Note that this file also contains the connection string for the database.

---

<div class="post-metadata">

### Author: ![chrisfor](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/c/71e660/32.png) [@chrisfor](https://www.finalbuilder.com/forums/u/chrisfor)
#### Post date: [June 5, 2019, 10:05pm UTC](https://www.finalbuilder.com/forums/t/problems-after-migrating-continuaci-to-another-server-and-postgresql-server/6476/3 "2019-06-05T22:05:20Z")

</div>

Thank you very much!
