title: rpc error: code = DeadlineExceeded desc = context deadline
body: <p>I have written a simple gRPC server and client applications which will encrypt and decrypt a text. I tried running the client continuously one by one. It works great. No issue up to this point.</p>
  <p>I tried running those server and client applications as docker containers. I ran this server as a container in a machine and then tried running the client containers one by one continuously by running a simple bash script.</p>
  <pre><code>#!/bin/bash
  
  #Basic while loop
  counter=1
  while [ $counter -le 10 ]
  do
  echo client-$counter
  docker run client:latest
  ((counter++))
  done
  </code></pre>
  <p>it could run only 3 to 4 instances of client. After it resulting in the below error.
  rpc error: code = DeadlineExceeded desc = context deadline</p>
  <p>Find the below client and server code :</p>
  <p>server sample code :</p>
  <pre><code>func main(){
  lis, err := net.Listen(&quot;tcp&quot;, port)
  if err != nil {
  log.Fatalf(&quot;failed to listen: %v&quot;, err)
  }
  s := grpc.NewServer()
  pb.RegisterGolangServer(s, &amp;server{})
  log.Printf(&quot;server/main:main() server listening at %v&quot;, lis.Addr())
  if err := s.Serve(lis); err != nil {
  log.Fatalf(&quot;server/main:main() failed to serve: %v&quot;, err)
  }
  return
  }
  </code></pre>
  <p>Sample client code :</p>
  <pre><code>func init(){
  conn, err := grpc.Dial(addr, grpc.WithInsecure(), grpc.WithBlock())
  if err != nil {
  log.Fatalf(&quot;did not connect: %v&quot;, err)
  }
  defer conn.Close()
  log.Println(&quot;Establishing connection from Init in session package&quot;)
  _, err = EstablishSession(conn)
  }
  
  func EstablishSession(conn *grpc.ClientConn) (*SessionDetailsStore, error) {
  
  c := pb.NewGolangClient(conn)
  nonce := make([]byte, nonceLength)
  if _, err := io.ReadFull(rand.Reader, nonce); err != nil {
  log.Printf(&quot;sessionlib/session:EstablishSession() Error in nonce creation: &quot;, err)
  return nil, errors.New(&quot;error in nonce creation&quot;)
  }
  
  skcserver_token := []byte(aas_token)
  
  ctx, cancel := context.WithTimeout(context.Background(), time.Second)
  defer cancel()
  r, err := c.Session(ctx, &amp;pb.SessionRequest{SkcserverToken: skcserver_token, Nonce: nonce})
  if err != nil {
  log.Printf(&quot;sessionlib/session:EstablishSession() Could not create session: %v&quot;, err)
  return nil, errors.New(&quot;could not create session&quot;)
  }
  return nil, nil
  }
  </code></pre>
  <p>In client side, I use this establishsession() function to get the session ID and using it for the encryption and decryption process of my text.</p>
  <p>(Point to note : Both encryption and decryption processes have to reach the server for 4 times each during the client runtime.)</p>
  <p>Find the below server and client logs :</p>
  <p>Client :</p>
  <pre><code>client-4
  2022/01/05 14:57:45 Establishing connection from Init in session package
  2022/01/05 14:57:45 sessionlib/session:EstablishSession() Entering
  2022/01/05 14:57:45 sessionlib/session:EstablishSession() Success in establishing session
  2022/01/05 14:57:45 sessionlib/session:EstablishSession() Session ID : [33 241 217 25 54 129 29 39 152 119 168 157 2 8 91 32]
  2022/01/05 14:57:45 sessionlib/session:EstablishSession() Attestation Evidence : [116 101 115 116 113 117 111 116 101]
  2022/01/05 14:57:45 sessionlib/session:EstablishSession() Leaving
  2022/01/05 14:57:45 client/main:main() Entering
  2022/01/05 14:57:45 client/main:main() Calling skc-crypto-application which in turn call crypto functions
  2022/01/05 14:57:45 crypto_app/crypto_app:cryptoFunctions() Entering
  time=&quot;2022-01-05T14:57:45Z&quot; level=info msg=&quot;config/config:validateConfiguration() Entering&quot;
  time=&quot;2022-01-05T14:57:45Z&quot; level=info msg=&quot;config/config:validateUserPermissions() Entering&quot;
  time=&quot;2022-01-05T14:57:45Z&quot; level=info msg=&quot;config/config:validateUserPermissions() User global_admin_user has required permission(s)&quot;
  time=&quot;2022-01-05T14:57:45Z&quot; level=info msg=&quot;config/config:validateUserPermissions() Leaving&quot;
  time=&quot;2022-01-05T14:57:45Z&quot; level=info msg=&quot;config/config:validateConfiguration() Leaving&quot;
  2022/01/05 14:57:45 crypto/aes/cipher:NewCipher() Entering
  2022/01/05 14:57:45 crypto/aes/cipher:NewCipher() get session ID for NewCipher
  2022/01/05 14:57:45 crypto/aes/cipher:GetSessionId() Entering
  crypto_app/crypto_app:cryptoFunctions() we are going to encrypt:
  Mandalorian is currently the best DisneyPlus show
  2022/01/05 14:57:45 crypto/aes/cipher:GetSessionId() try getting session details - aes
  2022/01/05 14:57:45 sessionlib/session:EstablishSession() Entering
  2022/01/05 14:57:45 sessionlib/session:EstablishSession() Session has been established already. So returning the details
  2022/01/05 14:57:45 sessionlib/session:EstablishSession() Leaving
  2022/01/05 14:57:45 crypto/aes/cipher:GetSessionId() Leaving
  time=&quot;2022-01-05T14:57:45Z&quot; level=info msg=&quot;config/config:validateConfiguration() Entering&quot;
  time=&quot;2022-01-05T14:57:45Z&quot; level=info msg=&quot;config/config:validateUserPermissions() Entering&quot;
  time=&quot;2022-01-05T14:57:45Z&quot; level=info msg=&quot;config/config:validateUserPermissions() User global_admin_user has required permission(s)&quot;
  time=&quot;2022-01-05T14:57:45Z&quot; level=info msg=&quot;config/config:validateUserPermissions() Leaving&quot;
  time=&quot;2022-01-05T14:57:45Z&quot; level=info msg=&quot;config/config:validateConfiguration() Leaving&quot;
  2022/01/05 14:57:45 crypto/aes/cipher:NewCipher() get new cipher from NewCipher skc server
  crypto_app/crypto_app:cryptoFunctions() cipher id in crypto app = [66 56 51 52 67 51 66 48]
  2022/01/05 14:57:45 crypto/aes/cipher:NewCipher() NewCipher Attestation ID attestation_id:&quot;\xef\x0b\x0c=\xe1\xb2l\xd2t\x8a\xc1\xe8-\x0c\x9a\x83\x19\x05\x81\xf3\xe8\xe5\x89O\xbf\xc54_ݗ\xda\xfd0A\xa9Q\x03u1ã\x84X\xe5\xe3\x8c\x04e\xa6Aܨ\x9df\xab\xf9z,\x1b\x1c\xa6`x\x8a&quot;
  2022/01/05 14:57:45 crypto/aes/cipher:NewCipher() Leaving
  2022/01/05 14:57:45 crypto/cipher/gcm:NewGCM() Entering
  2022/01/05 14:57:45 crypto/cipher/gcm:GetSessionId() Entering
  2022/01/05 14:57:45 crypto/cipher/gcm:GetSessionId() try getting session details - cipher
  2022/01/05 14:57:45 sessionlib/session:EstablishSession() Entering
  2022/01/05 14:57:45 sessionlib/session:EstablishSession() Session has been established already. So returning the details
  2022/01/05 14:57:45 sessionlib/session:EstablishSession() Leaving
  2022/01/05 14:57:45 crypto/cipher/gcm:GetSessionId() Leaving
  2022/01/05 14:57:45 crypto/cipher/gcm:NewGCM() session id : [33 241 217 25 54 129 29 39 152 119 168 157 2 8 91 32]
  2022/01/05 14:57:45 crypto/cipher/gcm:GetSessionId() Entering
  2022/01/05 14:57:45 crypto/cipher/gcm:GetSessionId() try getting session details - cipher
  2022/01/05 14:57:45 sessionlib/session:EstablishSession() Entering
  2022/01/05 14:57:45 sessionlib/session:EstablishSession() Session has been established already. So returning the details
  2022/01/05 14:57:45 sessionlib/session:EstablishSession() Leaving
  2022/01/05 14:57:45 crypto/cipher/gcm:GetSessionId() Leaving
  2022/01/05 14:57:45 crypto/cipher/gcm:NewGCM() get new cipher from NewGCM skc server
  2022/01/05 14:57:45 crypto/cipher/gcm:NewGCM() Get session ID for NewCipher cphr value -&gt; QjgzNEMzQjA=
  crypto_app/crypto_app:cryptoFunctions() gcm_id = [66 56 53 49 50 52 51 48]
  2022/01/05 14:57:45 crypto/cipher/gcm:NewGCM() New gcm id in gcm.go = [66 56 53 49 50 52 51 48]
  2022/01/05 14:57:45 crypto/cipher/gcm:NewGCM() Leaving
  2022/01/05 14:57:45 crypto/cipher/gcm:NonceSize() Entering
  2022/01/05 14:57:45 crypto/cipher/gcm:GetSessionId() Leaving
  2022/01/05 14:57:45 crypto/cipher/gcm:Seal() session id: [33 241 217 25 54 129 29 39 152 119 168 157 2 8 91 32]
  2022/01/05 14:57:45 crypto/cipher/gcm:GetSessionId() Entering
  2022/01/05 14:57:45 crypto/cipher/gcm:GetSessionId() try getting session details - cipher
  2022/01/05 14:57:45 sessionlib/session:EstablishSession() Entering
  2022/01/05 14:57:45 sessionlib/session:EstablishSession() Session has been established already. So returning the details
  2022/01/05 14:57:45 sessionlib/session:EstablishSession() Leaving
  2022/01/05 14:57:45 crypto/cipher/gcm:GetSessionId() Leaving
  2022/01/05 14:57:46 crypto/cipher/gcm:Seal() get the cipher text from server
  2022/01/05 14:57:46 crypto/cipher/gcm:Seal() Leaving
  2022/01/05 14:57:46 crypto/aes/cipher:NewCipher() Entering
  2022/01/05 14:57:46 crypto/aes/cipher:NewCipher() get session ID for NewCipher
  2022/01/05 14:57:46 crypto/aes/cipher:GetSessionId() Entering
  crypto_app/crypto_app:cryptoFunctions() cipherText = [175 74 224 81 86 167 69 186 18 125 213 235 155 199 211 134 173 31 217 183 58 81 182 108 123 24 125 40 166 216 43 3 3 118 9 16 95 39 250 33 194 131 230 6 169 131 49 228 74 223 161 220 67 35 151 110 65 14 46 123 184 179 4 159 86 191 188 151 180 38 251 198 175 101 184 89 182]
  2022/01/05 14:59:46 crypto/aes/cipher:GetSessionId() try getting session details - aes
  2022/01/05 14:59:46 sessionlib/session:EstablishSession() Entering
  2022/01/05 14:59:46 sessionlib/session:EstablishSession() Session has been established already. So returning the details
  2022/01/05 14:59:46 sessionlib/session:EstablishSession() Leaving
  2022/01/05 14:59:46 crypto/aes/cipher:GetSessionId() Leaving
  
  time=&quot;2022-01-05T15:05:46Z&quot; level=info msg=&quot;config/config:validateConfiguration() Entering&quot;
  time=&quot;2022-01-05T15:05:46Z&quot; level=info msg=&quot;config/config:validateUserPermissions() Entering&quot;
  time=&quot;2022-01-05T15:05:46Z&quot; level=info msg=&quot;config/config:validateUserPermissions() User global_admin_user has required permission(s)&quot;
  time=&quot;2022-01-05T15:05:46Z&quot; level=info msg=&quot;config/config:validateUserPermissions() Leaving&quot;
  time=&quot;2022-01-05T15:05:46Z&quot; level=info msg=&quot;config/config:validateConfiguration() Leaving&quot;
  2022/01/05 15:05:46 crypto/aes/cipher:NewCipher() get new cipher from NewCipher skc server
  2022/01/05 15:05:56 crypto/aes/cipher:NewCipher() NewCipher failed with: rpc error: code = DeadlineExceeded desc = context deadline exceeded
  2022/01/05 15:05:56 crypto/aes/cipher:NewCipher() Leaving
  2022/01/05 15:05:56 crypto/cipher/gcm:NewGCM() Entering
  2022/01/05 15:05:56 crypto/cipher/gcm:GetSessionId() Entering
  crypto_app/crypto_app:cryptoFunctions() Failed to create cphr_id using aes.NewCipher rpc error: code = DeadlineExceeded desc = context deadline exceededcrypto_app/crypto_app:cryptoFunctions() cipher id in decryption process = []
  
  2022/01/05 15:14:46 crypto/cipher/gcm:GetSessionId() try getting session details - cipher
  2022/01/05 15:14:46 sessionlib/session:EstablishSession() Entering
  2022/01/05 15:14:46 sessionlib/session:EstablishSession() Session has been established already. So returning the details
  2022/01/05 15:14:46 sessionlib/session:EstablishSession() Leaving
  2022/01/05 15:14:46 crypto/cipher/gcm:GetSessionId() Leaving
  2022/01/05 15:14:46 crypto/cipher/gcm:NewGCM() session id : [33 241 217 25 54 129 29 39 152 119 168 157 2 8 91 32]
  2022/01/05 15:14:46 crypto/cipher/gcm:GetSessionId() Entering
  
  2022/01/05 15:16:46 crypto/cipher/gcm:GetSessionId() try getting session details - cipher
  2022/01/05 15:16:46 sessionlib/session:EstablishSession() Entering
  2022/01/05 15:16:46 sessionlib/session:EstablishSession() Session has been established already. So returning the details
  2022/01/05 15:16:46 sessionlib/session:EstablishSession() Leaving
  2022/01/05 15:16:46 crypto/cipher/gcm:GetSessionId() Leaving
  
  2022/01/05 15:18:46 crypto/cipher/gcm:NewGCM() get new cipher from NewGCM skc server
  2022/01/05 15:18:46 crypto/cipher/gcm:NewGCM() Get session ID for NewCipher cphr value -&gt;
  2022/01/05 15:18:47 crypto/cipher/gcm:NewGCM() Unable to create NewGCM failed with error rpc error: code = DeadlineExceeded desc = context deadline exceeded
  2022/01/05 15:18:47 crypto/cipher/gcm:NewGCM() Leaving
  2022/01/05 15:18:47 crypto/cipher/gcm:NonceSize() Entering
  2022/01/05 15:18:47 crypto/cipher/gcm:GetSessionId() Entering
  crypto_app/crypto_app:cryptoFunctions() Failed to create gcm_id using NewGCM rpc error: code = DeadlineExceeded desc = context deadline exceededcrypto_app/crypto_app:cryptoFunctions() gcm_id in decryption process = []
  
  2022/01/05 15:20:46 crypto/cipher/gcm:GetSessionId() try getting session details - cipher
  2022/01/05 15:20:46 sessionlib/session:EstablishSession() Entering
  2022/01/05 15:20:46 sessionlib/session:EstablishSession() Session has been established already. So returning the details
  2022/01/05 15:20:46 sessionlib/session:EstablishSession() Leaving
  2022/01/05 15:20:46 crypto/cipher/gcm:GetSessionId() Leaving
  2022/01/05 15:20:46 crypto/cipher/gcm:NonceSize() session id: [33 241 217 25 54 129 29 39 152 119 168 157 2 8 91 32]
  2022/01/05 15:20:46 crypto/cipher/gcm:GetSessionId() Entering
  
  2022/01/05 15:22:46 crypto/cipher/gcm:GetSessionId() try getting session details - cipher
  2022/01/05 15:22:46 sessionlib/session:EstablishSession() Entering
  2022/01/05 15:22:46 sessionlib/session:EstablishSession() Session has been established already. So returning the details
  2022/01/05 15:22:46 sessionlib/session:EstablishSession() Leaving
  2022/01/05 15:22:46 crypto/cipher/gcm:GetSessionId() Leaving
  
  2022/01/05 15:24:47 crypto/cipher/gcm:NonceSize() get nonce from the server
  2022/01/05 15:24:48 crypto/cipher/gcm:NonceSize() Failed to perform NonceSize request rpc error: code = DeadlineExceeded desc = context deadline exceeded
  2022/01/05 15:24:48 crypto/cipher/gcm:NonceSize() Leaving
  2022/01/05 15:24:48 crypto/cipher/gcm:Open() Entering
  2022/01/05 15:24:48 crypto/cipher/gcm:GetSessionId() Entering
  crypto_app/crypto_app:cryptoFunctions() Failed to create nonce using Nonce rpc error: code = DeadlineExceeded desc = context deadline exceededcrypto_app/crypto_app:cryptoFunctions() nonceSize in decryption process = 0
  
  2022/01/05 15:33:47 crypto/cipher/gcm:GetSessionId() try getting session details - cipher
  2022/01/05 15:33:47 sessionlib/session:EstablishSession() Entering
  2022/01/05 15:33:47 sessionlib/session:EstablishSession() Session has been established already. So returning the details
  2022/01/05 15:33:47 sessionlib/session:EstablishSession() Leaving
  2022/01/05 15:33:47 crypto/cipher/gcm:GetSessionId() Leaving
  2022/01/05 15:33:47 crypto/cipher/gcm:Open() session id: [33 241 217 25 54 129 29 39 152 119 168 157 2 8 91 32]
  2022/01/05 15:33:47 crypto/cipher/gcm:GetSessionId() Entering
  
  2022/01/05 15:35:47 crypto/cipher/gcm:GetSessionId() try getting session details - cipher
  2022/01/05 15:35:47 sessionlib/session:EstablishSession() Entering
  2022/01/05 15:35:47 sessionlib/session:EstablishSession() Session has been established already. So returning the details
  2022/01/05 15:35:47 sessionlib/session:EstablishSession() Leaving
  2022/01/05 15:35:47 crypto/cipher/gcm:GetSessionId() Leaving
  
  2022/01/05 15:37:47 crypto/cipher/gcm:Open() get decrypted text from the server
  2022/01/05 15:37:48 crypto/cipher/gcm:Open() Failed to perform Open request rpc error: code = DeadlineExceeded desc = context deadline exceeded
  2022/01/05 15:37:48 crypto/cipher/gcm:Open() Leaving
  2022/01/05 15:37:48 crypto_app/crypto_app:cryptoFunctions() Leaving
  2022/01/05 15:37:48 client/main:main() Leaving
  crypto_app/crypto_app:cryptoFunctions() Failed to get plainText using Open rpc error: code = DeadlineExceeded desc = context deadline exceededcrypto_app/crypto_app:cryptoFunctions() after decryption:
  
  Server :
  
  2022/01/05 14:57:27 server/main:main() Entering
  2022/01/05 14:57:27 clients/kbs/kbs:Run() Entering
  2022/01/05 14:57:27 clients/kbs/kbs:Run() Creating envelope key
  2022/01/05 14:57:27 clients/kbs/kbs:Run() Leaving
  [P1:T1:skcserver] error: bind: invalid handle returned
  2022/01/05 14:57:27 server/main:main() server listening at [::]:50051
  2022/01/05 14:57:27 server/main:validateAllSession() Entering
  2022/01/05 14:57:27 server/main:validateAllSession() Leaving
  2022/01/05 14:57:35 server/main:Session() Entering
  2022/01/05 14:57:35 server/main:Session() Leaving
  2022/01/05 14:57:35 server/main:NewCipher() Entering
  2022/01/05 14:57:35 server/main:NewCipher() SessionID D2byzSx5vTMXIQBJyhtsVQ==
  2022/01/05 14:57:35 server/main:validateThisSession() Entering
  2022/01/05 14:57:35 server/main:validateThisSession() Leaving
  2022/01/05 14:57:35 server/main:NewCipher() Session id received: [15 102 242 205 44 121 189 51 23 33 0 73 202 27 108 85]
  2022/01/05 14:57:35 server/main:NewCipher() Received key ID = [55 102 50 49 57 49 97 100 45 54 102 101 102 45 52 50 102 99 45 56 98 98 102 45 54 52 98 48 49 50 50 97 51 48 100 53]
  2022/01/05 14:57:35 server/main:verifyKeyData() Entering
  2022/01/05 14:57:35 clients/kbs/kbs:FetchKey() Entering
  2022/01/05 14:57:35 clients/kbs/kbs:FetchKey() keyUrl: https://10.80.243.86:9443/kbs/v1/keys/7f2191ad-6fef-42fc-8bbf-64b0122a30d5/transfer
  2022/01/05 14:57:36 pkg/wpm/util/fetch_key.go:FetchKey() Successfully retrieved key
  2022/01/05 14:57:36 clients/kbs/kbs:FetchKey() https://10.80.243.86:9443/kbs/v1/keys/7f2191ad-6fef-42fc-8bbf-64b0122a30d5/transfer
  2022/01/05 14:57:36 clients/kbs/kbs:FetchKey() Leaving
  2022/01/05 14:57:36 server/main:verifyKeyData() New Key returned from KBS
  2022/01/05 14:57:36 server/main:verifyKeyData() Leaving
  time=&quot;2022-01-05T14:57:36Z&quot; level=info msg=&quot;pkg/wpm/util/encrypt.go:Encrypt() Successfully unwrapped key&quot; name=default pid=1
  2022/01/05 14:57:36 server/main:NewCipher() Received key ID onWKpZ4J0dODMmBdLHboTQ==
  2022/01/05 14:57:36 server/main:NewCipher() Cipher address:= 0xb8218c80
  2022/01/05 14:57:36 server/main:NewCipher() Cipher address in string:= B8218C80
  2022/01/05 14:57:36 server/main:NewCipher() Cipher address in byte:= [66 56 50 49 56 67 56 48]
  2022/01/05 14:57:36 server/main:NewCipher() Cipher again address in string:= B8218C80
  2022/01/05 14:57:36 server/main:NewCipher() Leaving
  2022/01/05 14:57:37 server/main:NewGCM() Entering
  2022/01/05 14:57:37 server/main:validateThisSession() Entering
  2022/01/05 14:57:37 server/main:validateThisSession() Leaving
  2022/01/05 14:57:37 server/main:NewGCM() Session ID received: [15 102 242 205 44 121 189 51 23 33 0 73 202 27 108 85]
  2022/01/05 14:57:37 server/main:NewGCM() Received cipher ID = [66 56 50 49 56 67 56 48]
  2022/01/05 14:57:37 server/main:NewGCM() Valid cipher address received
  2022/01/05 14:57:37 server/main:NewGCM() Cipher pointer = 0xb8218c80
  2022/01/05 14:57:37 server/main:NewGCM() Created gcm object = 0xb826e270
  2022/01/05 14:57:37 server/main:NewGCM() Cipher address in string:= B826E270
  2022/01/05 14:57:37 server/main:NewGCM() Address in bytes:= [66 56 50 54 69 50 55 48]
  2022/01/05 14:57:37 server/main:NewGCM() Leaving
  2022/01/05 14:57:37 server/main:NonceSize() Entering
  2022/01/05 14:57:37 server/main:validateThisSession() Entering
  2022/01/05 14:57:37 server/main:validateThisSession() Leaving
  2022/01/05 14:57:37 server/main:NonceSize() Valid gcm address received
  2022/01/05 14:57:37 server/main:NonceSize() Leaving
  2022/01/05 14:57:37 server/main:Seal() Entering
  2022/01/05 14:57:37 server/main:validateThisSession() Entering
  2022/01/05 14:57:37 server/main:validateThisSession() Leaving
  2022/01/05 14:57:37 server/main:Seal() Session ID received: [15 102 242 205 44 121 189 51 23 33 0 73 202 27 108 85]
  2022/01/05 14:57:37 server/main:Seal() Received gcm Object ID = [66 56 50 54 69 50 55 48]
  2022/01/05 14:57:37 server/main:Seal() Valid gcm address received
  2022/01/05 14:57:37 server/main:Seal() Leaving
  2022/01/05 14:57:37 server/main:NewCipher() Entering
  2022/01/05 14:57:37 server/main:NewCipher() SessionID D2byzSx5vTMXIQBJyhtsVQ==
  2022/01/05 14:57:37 server/main:validateThisSession() Entering
  2022/01/05 14:57:37 server/main:validateThisSession() Leaving
  2022/01/05 14:57:37 server/main:NewCipher() Session id received: [15 102 242 205 44 121 189 51 23 33 0 73 202 27 108 85]
  2022/01/05 14:57:37 server/main:NewCipher() Received key ID = [55 102 50 49 57 49 97 100 45 54 102 101 102 45 52 50 102 99 45 56 98 98 102 45 54 52 98 48 49 50 50 97 51 48 100 53]
  2022/01/05 14:57:37 server/main:verifyKeyData() Entering
  2022/01/05 14:57:37 server/main:verifyKeyData() Cached Key returned from SKC
  2022/01/05 14:57:37 server/main:verifyKeyData() Leaving
  time=&quot;2022-01-05T14:57:37Z&quot; level=info msg=&quot;pkg/wpm/util/encrypt.go:Encrypt() Successfully unwrapped key&quot; name=default pid=1
  2022/01/05 14:57:37 server/main:NewCipher() Received key ID onWKpZ4J0dODMmBdLHboTQ==
  2022/01/05 14:57:37 server/main:NewCipher() Cipher address:= 0xb834c3d0
  2022/01/05 14:57:37 server/main:NewCipher() Cipher address in string:= B834C3D0
  2022/01/05 14:57:37 server/main:NewCipher() Cipher address in byte:= [66 56 51 52 67 51 68 48]
  2022/01/05 14:57:37 server/main:NewCipher() Cipher again address in string:= B834C3D0
  2022/01/05 14:57:37 server/main:NewCipher() Leaving
  2022/01/05 14:57:37 server/main:NewGCM() Entering
  2022/01/05 14:57:37 server/main:validateThisSession() Entering
  2022/01/05 14:57:37 server/main:validateThisSession() Leaving
  2022/01/05 14:57:37 server/main:NewGCM() Session ID received: [15 102 242 205 44 121 189 51 23 33 0 73 202 27 108 85]
  2022/01/05 14:57:37 server/main:NewGCM() Received cipher ID = [66 56 51 52 67 51 68 48]
  2022/01/05 14:57:37 server/main:NewGCM() Valid cipher address received
  2022/01/05 14:57:37 server/main:NewGCM() Cipher pointer = 0xb834c3d0
  2022/01/05 14:57:37 server/main:NewGCM() Created gcm object = 0xb834c6f0
  2022/01/05 14:57:37 server/main:NewGCM() Cipher address in string:= B834C6F0
  2022/01/05 14:57:37 server/main:NewGCM() Address in bytes:= [66 56 51 52 67 54 70 48]
  2022/01/05 14:57:37 server/main:NewGCM() Leaving
  2022/01/05 14:57:38 server/main:NonceSize() Entering
  2022/01/05 14:57:38 server/main:validateThisSession() Entering
  2022/01/05 14:57:38 server/main:validateThisSession() Leaving
  2022/01/05 14:57:38 server/main:NonceSize() Valid gcm address received
  2022/01/05 14:57:38 server/main:NonceSize() Leaving
  2022/01/05 14:57:38 server/main:Open() Entering
  2022/01/05 14:57:38 server/main:validateThisSession() Entering
  2022/01/05 14:57:38 server/main:validateThisSession() Leaving
  2022/01/05 14:57:38 server/main:Open() session id received: [15 102 242 205 44 121 189 51 23 33 0 73 202 27 108 85]
  2022/01/05 14:57:38 server/main:Open() received gcm Object ID = [66 56 50 54 69 50 55 48]
  2022/01/05 14:57:38 server/main:Open() Valid gcm address received
  2022/01/05 14:57:38 server/main:Open() Leaving
  2022/01/05 14:57:39 server/main:Session() Entering
  2022/01/05 14:57:39 server/main:Session() Leaving
  2022/01/05 14:57:39 server/main:NewCipher() Entering
  2022/01/05 14:57:39 server/main:NewCipher() SessionID jp/ONz6jT9nahKbfqNIQJg==
  2022/01/05 14:57:39 server/main:validateThisSession() Entering
  2022/01/05 14:57:39 server/main:validateThisSession() Leaving
  2022/01/05 14:57:39 server/main:NewCipher() Session id received: [142 159 206 55 62 163 79 217 218 132 166 223 168 210 16 38]
  2022/01/05 14:57:39 server/main:NewCipher() Received key ID = [55 102 50 49 57 49 97 100 45 54 102 101 102 45 52 50 102 99 45 56 98 98 102 45 54 52 98 48 49 50 50 97 51 48 100 53]
  2022/01/05 14:57:39 server/main:verifyKeyData() Entering
  2022/01/05 14:57:39 server/main:NewGCM() Session ID received: [142 159 206 55 62 163 79 217 218 132 166 223 168 210 16 38]
  2022/01/05 14:57:40 server/main:NewCipher() SessionID jp/ONz6jT9nahKbfqNIQJg==
  2022/01/05 14:57:40 server/main:validateThisSession() Entering
  2022/01/05 14:57:40 server/main:validateThisSession() Leaving
  2022/01/05 14:57:40 server/main:NewCipher() Session id received: [142 159 206 55 62 163 79 217 218 132 166 223 168 210 16 38]
  2022/01/05 14:57:40 server/main:NewCipher() Received key ID = [55 102 50 49 57 49 97 100 45 54 102 101 102 45 52 50 102 99 45 56 98 98 102 45 54 52 98 48 49 50 50 97 51 48 100 53]
  
  time=&quot;2022-01-05T14:57:45Z&quot; level=info msg=&quot;pkg/wpm/util/encrypt.go:Encrypt() Successfully unwrapped key&quot; name=default pid=1
  2022/01/05 14:57:45 server/main:NewCipher() Received key ID onWKpZ4J0dODMmBdLHboTQ==
  2022/01/05 14:57:45 server/main:NewCipher() Cipher address:= 0xb834c3b0
  2022/01/05 14:57:45 server/main:NewCipher() Cipher address in string:= B834C3B0
  2022/01/05 14:57:45 server/main:NewCipher() Cipher address in byte:= [66 56 51 52 67 51 66 48]
  2022/01/05 14:57:45 server/main:NewCipher() Cipher again address in string:= B834C3B0
  2022/01/05 14:57:45 server/main:validateThisSession() Leaving
  2022/01/05 14:57:45 server/main:NonceSize() Valid gcm address received
  2022/01/05 14:57:45 server/main:NonceSize() Leaving
  2022/01/05 14:57:45 server/main:Seal() Entering
  2022/01/05 14:57:45 server/main:validateThisSession() Entering
  2022/01/05 14:57:45 server/main:validateThisSession() Leaving
  2022/01/05 14:57:45 server/main:Seal() Session ID received: [33 241 217 25 54 129 29 39 152 119 168 157 2 8 91 32]
  2022/01/05 14:57:45 server/main:Seal() Received gcm Object ID = [66 56 53 49 50 52 51 48]
  2022/01/05 14:57:45 server/main:Seal() Valid gcm address received
  2022/01/05 14:57:45 server/main:Seal() Leaving
  
  2022/01/05 15:27:47 server/main:NonceSize() Entering
  2022/01/05 15:27:47 server/main:validateThisSession() Entering
  2022/01/05 15:27:47 server/main:validateThisSession() Leaving
  2022/01/05 15:27:47 server/main:NonceSize() Invalid gcm address received
  2022/01/05 15:27:47 server/main:NonceSize() Leaving
  
  2022/01/05 15:39:47 server/main:Open() Entering
  2022/01/05 15:39:47 server/main:validateThisSession() Entering
  2022/01/05 15:39:47 server/main:validateThisSession() Leaving
  2022/01/05 15:39:47 server/main:Open() session id received: [33 241 217 25 54 129 29 39 152 119 168 157 2 8 91 32]
  2022/01/05 15:39:47 server/main:Open() received gcm Object ID = [66 56 53 49 50 52 51 48]
  2022/01/05 15:39:47 server/main:Open() Valid gcm address received
  2022/01/05 15:39:47 server/main:Open() Leaving
  panic: crypto/cipher: incorrect nonce length given to GCM
  
  goroutine 972 [running]:
  crypto/aes.(*gcmAsm).Open(0xb8452280, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xb83da0a0, 0x4d, 0x50, ...)
  /usr/local/go/src/crypto/aes/aes_gcm.go:140 +0x654
  main.(*server).Open(0xfdd698, 0xc0b040, 0xb8326000, 0xb8239340, 0x0, 0x0, 0x0)
  /root/g_test2/session_management/golang/server/main.go:335 +0x768
  session_management/golang/_golang.Golang_Open_Handler(0xae3a60, 0xfdd698, 0xc0b040, 0xb8326000, 0xb81c4240, 0x0, 0xc0b040, 0xb8326000, 0xb8310540, 0x6d)
  /root/g_test2/session_management/_golang/_golang/_golang_grpc.pb.go:267 +0x214
  google.golang.org/grpc.(*Server).processUnaryRPC(0xb824b180, 0xc10d00, 0xb8800a80, 0xb847c000, 0xb821f8f0, 0xf9f410, 0x0, 0x0, 0x0)
  /usr/local/pkg/mod/google.golang.org/grpc@v1.42.0/server.go:1282 +0x522
  google.golang.org/grpc.(*Server).handleStream(0xb824b180, 0xc10d00, 0xb8800a80, 0xb847c000, 0x0)
  /usr/local/pkg/mod/google.golang.org/grpc@v1.42.0/server.go:1616 +0xd05
  google.golang.org/grpc.(*Server).serveStreams.func1.2(0xb858a0d0, 0xb824b180, 0xc10d00, 0xb8800a80, 0xb847c000)
  /usr/local/pkg/mod/google.golang.org/grpc@v1.42.0/server.go:921 +0xa5
  created by google.golang.org/grpc.(*Server).serveStreams.func1
  /usr/local/pkg/mod/google.golang.org/grpc@v1.42.0/server.go:919 +0x1fd
  
  Thanks in advance 
  
  -Vijay
  </code></pre>