# Error creating OPC server

**URL:** <https://forum.inductiveautomation.com/t/error-creating-opc-server/25435>\
**Category:** Ignition Early Access\
**Created:** [May 30, 2019, 3:23pm UTC](https://forum.inductiveautomation.com/t/error-creating-opc-server/25435 "2019-05-30T15:23:57Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![ecujak](https://avatars.discourse-cdn.com/v4/letter/e/839c29/32.png) [@ecujak](https://forum.inductiveautomation.com/u/ecujak)\
**Post date:** [May 30, 2019, 3:23pm UTC](https://forum.inductiveautomation.com/t/error-creating-opc-server/25435/1 "2019-05-30T15:23:57Z")

</div>

Ubuntu 18.04  
Ignition version: 8.0.0 (b2019040718)  
Java version: Azul Systems, Inc. 11.0.2

java.lang.Exception: Error creating OPC server “Ignition OPC UA Server” of type “com.inductiveautomation.OpcUaServerType”  
at com.inductiveautomation.ignition.gateway.opc.OpcConnectionManagerImpl.newOpcConnection(OpcConnectionManagerImpl.java:166)  
at com.inductiveautomation.ignition.gateway.opc.OpcConnectionManagerImpl.registerConnectionType(OpcConnectionManagerImpl.java:243)  
at com.inductiveautomation.ignition.gateway.opcua.OpcUaModule.startup(OpcUaModule.kt:295)  
at com.inductiveautomation.ignition.gateway.opcua.OpcUaModuleHook.startup(OpcUaModuleHook.kt)  
at com.inductiveautomation.ignition.gateway.modules.ModuleManagerImpl$LoadedModule.startup(ModuleManagerImpl.java:2349)  
at com.inductiveautomation.ignition.gateway.modules.ModuleManagerImpl.startup(ModuleManagerImpl.java:396)  
at com.inductiveautomation.ignition.gateway.IgnitionGateway.startupInternal(IgnitionGateway.java:1116)  
at com.inductiveautomation.ignition.gateway.redundancy.RedundancyManagerImpl.startup(RedundancyManagerImpl.java:275)  
at com.inductiveautomation.ignition.gateway.IgnitionGateway.initRedundancy(IgnitionGateway.java:664)  
at com.inductiveautomation.ignition.gateway.IgnitionGateway.lambda$initInternal$0(IgnitionGateway.java:602)  
at com.inductiveautomation.ignition.common.execution.impl.BasicExecutionEngine$ThrowableCatchingRunnable.run(BasicExecutionEngine.java:518)  
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)  
at java.base/java.util.concurrent.FutureTask.run(Unknown Source)  
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)  
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)  
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)  
at java.base/java.lang.Thread.run(Unknown Source)  
Caused by: java.security.UnrecoverableKeyException: Get Key failed: Given final block not properly padded. Such issues can arise if a bad key is used during decryption.  
at java.base/sun.security.pkcs12.PKCS12KeyStore.engineGetKey(Unknown Source)  
at java.base/sun.security.util.KeyStoreDelegator.engineGetKey(Unknown Source)  
at java.base/java.security.KeyStore.getKey(Unknown Source)  
at com.inductiveautomation.ignition.gateway.opcua.KeyStoreManager.getKeyPair(KeyStoreManager.kt:57)  
at com.inductiveautomation.ignition.gateway.opcua.client.connection.OpcUaConnectionType.createNewOpcConnection(OpcUaConnectionType.kt:48)  
at com.inductiveautomation.ignition.gateway.opc.OpcConnectionManagerImpl.newOpcConnection(OpcConnectionManagerImpl.java:161)  
… 16 more  
Caused by: javax.crypto.BadPaddingException: Given final block not properly padded. Such issues can arise if a bad key is used during decryption.  
at java.base/com.sun.crypto.provider.CipherCore.unpad(Unknown Source)  
at java.base/com.sun.crypto.provider.CipherCore.fillOutputBuffer(Unknown Source)  
at java.base/com.sun.crypto.provider.CipherCore.doFinal(Unknown Source)  
at java.base/com.sun.crypto.provider.PKCS12PBECipherCore.implDoFinal(Unknown Source)  
at java.base/com.sun.crypto.provider.PKCS12PBECipherCore$PBEWithSHA1AndDESede.engineDoFinal(Unknown Source)  
at java.base/javax.crypto.Cipher.doFinal(Unknown Source)  
at java.base/sun.security.pkcs12.PKCS12KeyStore.lambda$engineGetKey$0(Unknown Source)  
at java.base/sun.security.pkcs12.PKCS12KeyStore$RetryWithZero.run(Unknown Source)  
… 22 more

8.0.0 (b2019040718)  
Azul Systems, Inc. 11.0.2

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [May 30, 2019, 4:46pm UTC](https://forum.inductiveautomation.com/t/error-creating-opc-server/25435/2 "2019-05-30T16:46:03Z")

</div>

Huh, never seen that one before. If you stop the service and delete the `data/opcua/client/security/certificates.pfx` and `data/opcua/server/security/certificates.pfx` files does it work?

Also might be worth upgrading to the latest version.

---

<div class="post-metadata">

**Author:** ![ecujak](https://avatars.discourse-cdn.com/v4/letter/e/839c29/32.png) [@ecujak](https://forum.inductiveautomation.com/u/ecujak)\
**Post date:** [May 30, 2019, 5:05pm UTC](https://forum.inductiveautomation.com/t/error-creating-opc-server/25435/3 "2019-05-30T17:05:03Z")

</div>

Stop, deletes, and Start, did not fix this issue. I will try the upgrade from Stable 8.0.0 to 8.0.1.

---

<div class="post-metadata">

**Author:** ![ecujak](https://avatars.discourse-cdn.com/v4/letter/e/839c29/32.png) [@ecujak](https://forum.inductiveautomation.com/u/ecujak)\
**Post date:** [May 30, 2019, 6:41pm UTC](https://forum.inductiveautomation.com/t/error-creating-opc-server/25435/4 "2019-05-30T18:41:55Z")

</div>

Ignition version: 8.0.2-rc1 (b2019052016)  
Java version: Azul Systems, Inc. 11.0.3  
Upgrade didn’t work. I deleted the connection and recreated and all seems to work now. Sorry. Thanks for taking the time to help.

---

<div class="post-metadata">

**Author:** ![ecujak](https://avatars.discourse-cdn.com/v4/letter/e/839c29/32.png) [@ecujak](https://forum.inductiveautomation.com/u/ecujak)\
**Post date:** [July 30, 2019, 4:41pm UTC](https://forum.inductiveautomation.com/t/error-creating-opc-server/25435/5 "2019-07-30T16:41:55Z")

</div>

Upgrade to latest version and this error is back.

Ignition version: **8.0.2 (b2019060511)**  
Java version: **Azul Systems, Inc. 11.0.3**

Caused by: java.security.UnrecoverableKeyException: Get Key failed: Given final block not properly padded. Such issues can arise if a bad key is used during decryption.

Caused by: javax.crypto.BadPaddingException: Given final block not properly padded. Such issues can arise if a bad key is used during decryption.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [July 30, 2019, 4:49pm UTC](https://forum.inductiveautomation.com/t/error-creating-opc-server/25435/6 "2019-07-30T16:49:07Z")

</div>

Can you try the previously mentioned fix of stopping, deleting the PFX files, and starting again?

If that doesn’t work please upload your entire wrapper.log file.

---

<div class="post-metadata">

**Author:** ![ecujak](https://avatars.discourse-cdn.com/v4/letter/e/839c29/32.png) [@ecujak](https://forum.inductiveautomation.com/u/ecujak)\
**Post date:** [July 30, 2019, 5:03pm UTC](https://forum.inductiveautomation.com/t/error-creating-opc-server/25435/7 "2019-07-30T17:03:35Z")

</div>

It did not. Please tell me where I can find the wrapper.log file.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [July 30, 2019, 5:15pm UTC](https://forum.inductiveautomation.com/t/error-creating-opc-server/25435/8 "2019-07-30T17:15:01Z")

</div>

They are in `$IGNITION_INSTALL_DIR/logs`.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [July 30, 2019, 5:20pm UTC](https://forum.inductiveautomation.com/t/error-creating-opc-server/25435/9 "2019-07-30T17:20:35Z")

</div>

After seeing that last time you “fixed” this by deleting/creating the UA connection, another possibility here is that you have (inadvertently, perhaps) changed one of Keystore Alias or Keystore Alias Password advanced settings on one of your OPC UA connections and this error is a result of that.

They should be “client” and “password” by default.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [July 30, 2019, 6:20pm UTC](https://forum.inductiveautomation.com/t/error-creating-opc-server/25435/10 "2019-07-30T18:20:52Z")

</div>

4 posts were split to a new topic: [Error connecting to 3rd party UA server: Exception: session inactive](https://forum.inductiveautomation.com/t/error-connecting-to-3rd-party-ua-server-exception-session-inactive/27009)

---

<div class="post-metadata">

**Author:** ![curtis.hargreaves](https://avatars.discourse-cdn.com/v4/letter/c/f07891/32.png) [@curtis.hargreaves](https://forum.inductiveautomation.com/u/curtis.hargreaves)\
**Post date:** [August 1, 2019, 6:55pm UTC](https://forum.inductiveautomation.com/t/error-creating-opc-server/25435/11 "2019-08-01T18:55:56Z")

</div>

Hey, I’m experiencing the same/similar issue. I get the original error message if I leave the password blank.  
If I use default credentials (client/password) I get the following message:

UaServiceFaultException: status=Bad\_UserAccessDenied, message=User does not have permission to perform the requested operation.  
at org.eclipse.milo.opcua.stack.client.UaStackClient.lambda$deliverResponse$5(UaStackClient.java:272)  
at org.eclipse.milo.opcua.stack.core.util.ExecutionQueue$Task.run(ExecutionQueue.java:119)  
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)  
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)  
at java.base/java.lang.Thread.run(Unknown Source)

8.0.2 (b2019060511)  
Azul Systems, Inc. 11.0.3

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [August 1, 2019, 7:19pm UTC](https://forum.inductiveautomation.com/t/error-creating-opc-server/25435/12 "2019-08-01T19:19:32Z")

</div>

@curtis.hargreaves your situation is different. You likely get the original error when you leave the username/password blank because the server is not offering an endpoint where anonymous access is allowed. You’ll need to know the correct username and password to connect to this server or modify its configuration to allow anonymous connections.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [November 11, 2020, 8:15pm UTC](https://forum.inductiveautomation.com/t/error-creating-opc-server/25435/13 "2020-11-11T20:15:32Z")

</div>

A post was split to a new topic: [OPC UA Connection Faulted After Upgrade](https://forum.inductiveautomation.com/t/opc-ua-connection-faulted-after-upgrade/40561)
