Error on server startup

#1

Trying to get to the bottom of this error on server startup:

    ERROR - 18083:MainThread - gunicorn.main:182 - Exception in worker process:
Traceback (most recent call last):
  File "/opt/zato/3.0/code/local/lib/python2.7/site-packages/gunicorn/arbiter.py", line 495, in spawn_worker
    self.cfg.post_fork(self, worker)
  File "/opt/zato/3.0/code/zato-server/src/zato/server/base/parallel/__init__.py", line 838, in post_fork
    ParallelServer.start_server(worker.app.zato_wsgi_app, arbiter.zato_deployment_key)
  File "/opt/zato/3.0/code/zato-server/src/zato/server/base/parallel/__init__.py", line 455, in start_server
    self.set_up_config(server)
  File "/opt/zato/3.0/code/zato-server/src/zato/server/base/parallel/config.py", line 308, in set_up_config
    self._migrate_30_encrypt_secrets()
  File "/opt/zato/3.0/code/zato-server/src/zato/server/base/parallel/config.py", line 417, in _migrate_30_encrypt_secrets
    encrypted = self.encrypt(config[secret_param])
  File "/opt/zato/3.0/code/zato-server/src/zato/server/base/parallel/__init__.py", line 804, in encrypt
    return '{}{}'.format(_prefix, self.crypto_manager.encrypt(data.encode('utf8')))
AttributeError: 'NoneType' object has no attribute 'encode'
Traceback (most recent call last):
  File "/opt/zato/3.0/code/local/lib/python2.7/site-packages/gunicorn/arbiter.py", line 495, in spawn_worker
    self.cfg.post_fork(self, worker)
  File "/opt/zato/3.0/code/zato-server/src/zato/server/base/parallel/__init__.py", line 838, in post_fork
    ParallelServer.start_server(worker.app.zato_wsgi_app, arbiter.zato_deployment_key)
  File "/opt/zato/3.0/code/zato-server/src/zato/server/base/parallel/__init__.py", line 455, in start_server
    self.set_up_config(server)
  File "/opt/zato/3.0/code/zato-server/src/zato/server/base/parallel/config.py", line 308, in set_up_config
    self._migrate_30_encrypt_secrets()
  File "/opt/zato/3.0/code/zato-server/src/zato/server/base/parallel/config.py", line 417, in _migrate_30_encrypt_secrets
    encrypted = self.encrypt(config[secret_param])
  File "/opt/zato/3.0/code/zato-server/src/zato/server/base/parallel/__init__.py", line 804, in encrypt
    return '{}{}'.format(_prefix, self.crypto_manager.encrypt(data.encode('utf8')))
AttributeError: 'NoneType' object has no attribute 'encode'
2019-05-16 18:50:17,225 - INFO - 18083:MainThread - gunicorn.main:176 - Worker exiting (pid: 18083)
2019-05-16 18:50:17,527 - INFO - 18074:MainThread - gunicorn.main:176 - Shutting down: Master
2019-05-16 18:50:17,528 - INFO - 18074:MainThread - gunicorn.main:176 - Reason: Worker failed to boot.
0 Likes

#2

Hello Sam,

is that a new thing? When did it start to happen? Have you git pulled recently? Can you say what git commit ID you are on?

0 Likes

#3

It is a new thing

I did git pull

working on

zato --version
Zato 3.0.0+rev.f5dbf26b

0 Likes

#4

Can you also say what this returns?

$ cd /opt/zato/current
$ git log -1

In Zato 3.1+ the latest git commit ID is part of zato --version but in earlier vesions it is not.

$
Zato 3.1pre1+rev.15ebb281b-py3.6.7
$

0 Likes

#5
git log -1
commit f5471b499d030c3c934c912a6ff9f01f71814812 (HEAD -> support/3.0, origin/support/3.0)
Merge: 8f1efde8 2fb10486
Author: Dariusz Suchojad <dsuch-github@m.zato.io>
Date:   Thu May 16 12:08:37 2019 +0200

    Merge pull request #957 from jjmurre/sap-fixes
    
    SAP updates by @jjmurre PR #957
0 Likes

#6

(I am on zato 3.0 currently)

0 Likes

#7

Can you temporarily switch to this commit and check again? I am trying to isolate the one that caused it.

$ git checkout 8f1efde80db52b77d93aa68e9691ea60b2b554a6

0 Likes

#8

I am still seeing same error on that commit it appears:

2019-05-16 19:12:44,749 - ERROR - 19843:MainThread - gunicorn.main:182 - Exception in worker process:
Traceback (most recent call last):
  File "/opt/zato/3.0/code/local/lib/python2.7/site-packages/gunicorn/arbiter.py", line 495, in spawn_worker
    self.cfg.post_fork(self, worker)
  File "/opt/zato/3.0/code/zato-server/src/zato/server/base/parallel/__init__.py", line 838, in post_fork
    ParallelServer.start_server(worker.app.zato_wsgi_app, arbiter.zato_deployment_key)
  File "/opt/zato/3.0/code/zato-server/src/zato/server/base/parallel/__init__.py", line 455, in start_server
    self.set_up_config(server)
  File "/opt/zato/3.0/code/zato-server/src/zato/server/base/parallel/config.py", line 308, in set_up_config
    self._migrate_30_encrypt_secrets()
  File "/opt/zato/3.0/code/zato-server/src/zato/server/base/parallel/config.py", line 417, in _migrate_30_encrypt_secrets
    encrypted = self.encrypt(config[secret_param])
  File "/opt/zato/3.0/code/zato-server/src/zato/server/base/parallel/__init__.py", line 804, in encrypt
    return '{}{}'.format(_prefix, self.crypto_manager.encrypt(data.encode('utf8')))
AttributeError: 'NoneType' object has no attribute 'encode'
Traceback (most recent call last):
  File "/opt/zato/3.0/code/local/lib/python2.7/site-packages/gunicorn/arbiter.py", line 495, in spawn_worker
    self.cfg.post_fork(self, worker)
  File "/opt/zato/3.0/code/zato-server/src/zato/server/base/parallel/__init__.py", line 838, in post_fork
    ParallelServer.start_server(worker.app.zato_wsgi_app, arbiter.zato_deployment_key)
  File "/opt/zato/3.0/code/zato-server/src/zato/server/base/parallel/__init__.py", line 455, in start_server
    self.set_up_config(server)
  File "/opt/zato/3.0/code/zato-server/src/zato/server/base/parallel/config.py", line 308, in set_up_config
    self._migrate_30_encrypt_secrets()
  File "/opt/zato/3.0/code/zato-server/src/zato/server/base/parallel/config.py", line 417, in _migrate_30_encrypt_secrets
    encrypted = self.encrypt(config[secret_param])
  File "/opt/zato/3.0/code/zato-server/src/zato/server/base/parallel/__init__.py", line 804, in encrypt
    return '{}{}'.format(_prefix, self.crypto_manager.encrypt(data.encode('utf8')))
AttributeError: 'NoneType' object has no attribute 'encode'
2019-05-16 19:12:44,750 - INFO - 19843:MainThread - gunicorn.main:176 - Worker exiting (pid: 19843)
2019-05-16 19:12:45,065 - INFO - 19821:MainThread - gunicorn.main:176 - Shutting down: Master
2019-05-16 19:12:45,065 - INFO - 19821:MainThread - gunicorn.main:176 - Reason: Worker failed to boot
0 Likes

#9

Do you have any security definition without a password? Like a Basic Auth definition that has no password set or anything similar?

0 Likes

#10

Thanks for your help @dsuch

It was a bad security setting (missing information). But since it was early enough in usage of that instance, I just re-instantiated the whole thing.

0 Likes