zato.simpleio.SerialisationError: Required element `id` missing in `{}`

Hi Everyone,

I am a new beginner in Zato. I am using Zato with docker with the following files
docker-compose.yml

version: "3"

services:
  zato:
    image: ghcr.io/zatosource/zato-3.2-quickstart
    container_name: zato
    ports:
      - "8183:8183"
      - "8083:11223"
      - "17010:17010"
    environment:
      Zato_Dashboard_Password: "steve"
    volumes:
      - ./libs/requirements.txt:/opt/hot-deploy/python-reqs/requirements.txt
      - ./libs:/opt/libs

I have created a basic service using Hot-deploying your first service. The code is the following

from zato.server.service import Service

class GetUserDetails(Service):
    """ Returns details of a user by the person's ID.
    """
    name = 'api.user.get-details'

    def handle(self):

        # For now, return static data only
        self.response.payload = {
            'id': "111",
            'user_name': 'John Doe',
            'user_type': 'SRT'
        }

When I deploy my service via Web-admin interface, I have the following on my docker container logs

2022-04-11 09:41:22,878 - INFO - 3042:Dummy-109 - zato.hot-deploy.create:0 - Creating tar archive
zato    | 2022-04-11 09:41:22,881 - INFO - 3042:Dummy-109 - zato.hot-deploy.create:0 - Creating tar archive
zato    | 2022-04-11 09:41:23,050 - INFO - 3042:Dummy-109 - zato.hot-deploy.create:0 - Deployed 1 service from `/opt/zato/env/qs-1/server1/work/hot-deploy/current/FirstService.py` -> ['api.user.get-details']
zato    | 2022-04-11 09:41:24,856 - ERROR - 3042:Dummy-117 - zato.server.connection.http_soap.channel:0 - Caught an exception, cid:`aeb712c687fc09158374724b`, status_code:`HTTPStatus.INTERNAL_SERVER_ERROR`, `Traceback (most recent call last):
zato    |   File "/opt/zato/3.2.0/code/zato-server/src/zato/server/service/__init__.py", line 886, in update_handle
zato    |     response = set_response_func(service, data_format=data_format, transport=transport, **kwargs)
zato    |   File "/opt/zato/3.2.0/code/zato-server/src/zato/server/service/__init__.py", line 705, in set_response_data
zato    |     response = response.getvalue(serialize=kwargs.get('serialize'))
zato    |   File "src/zato/cy/reqresp/payload.py", line 201, in zato.cy.reqresp.payload.SimpleIOPayload.getvalue
zato    |   File "src/zato/cy/reqresp/payload.py", line 229, in zato.cy.reqresp.payload.SimpleIOPayload.getvalue
zato    |   File "src/zato/cy/simpleio.py", line 2156, in zato.simpleio.CySimpleIO.get_output
zato    |   File "src/zato/cy/simpleio.py", line 2135, in zato.simpleio.CySimpleIO._get_output_json
zato    |   File "src/zato/cy/simpleio.py", line 2115, in zato.simpleio.CySimpleIO._convert_to_dicts
zato    |   File "src/zato/cy/simpleio.py", line 2036, in _yield_data_dicts
zato    | zato.simpleio.SerialisationError: Required element `id` missing in `{}` (<class 'zato.server.service.internal.service.GetChannelList'>)
zato    | 
zato    | During handling of the above exception, another exception occurred:
zato    | 
zato    | Traceback (most recent call last):
zato    |   File "/opt/zato/3.2.0/code/zato-server/src/zato/server/connection/http_soap/channel.py", line 338, in dispatch
zato    |     response = self.request_handler.handle(cid, url_match, channel_item, wsgi_environ,
zato    |   File "/opt/zato/3.2.0/code/zato-server/src/zato/server/connection/http_soap/channel.py", line 679, in handle
zato    |     response = service.update_handle(self._set_response_data, service, raw_request,
zato    |   File "/opt/zato/3.2.0/code/zato-server/src/zato/server/service/__init__.py", line 918, in update_handle
zato    |     raise e
zato    |   File "/opt/zato/3.2.0/code/zato-server/src/zato/server/service/__init__.py", line 858, in update_handle
zato    |     self._invoke(service, channel)
zato    |   File "/opt/zato/3.2.0/code/zato-server/src/zato/server/service/__init__.py", line 743, in _invoke
zato    |     service.handle()
zato    |   File "/opt/zato/3.2.0/code/zato-server/src/zato/server/service/internal/service.py", line 507, in handle
zato    |     response = func(
zato    |   File "/opt/zato/3.2.0/code/zato-server/src/zato/server/service/__init__.py", line 1054, in invoke
zato    |     return self.invoke_by_impl_name(self.server.service_store.name_to_impl_name[name], *args, **kwargs)
zato    |   File "/opt/zato/3.2.0/code/zato-server/src/zato/server/service/__init__.py", line 1032, in invoke_by_impl_name
zato    |     return self.update_handle(*invoke_args, **kwargs)
zato    |   File "/opt/zato/3.2.0/code/zato-server/src/zato/server/service/__init__.py", line 913, in update_handle
zato    |     raise Exception(exc_formatted)
zato    | Exception: Traceback (most recent call last):
zato    |   File "/opt/zato/3.2.0/code/zato-server/src/zato/server/service/__init__.py", line 858, in update_handle
zato    |     self._invoke(service, channel)
zato    |   File "/opt/zato/3.2.0/code/zato-server/src/zato/server/service/__init__.py", line 743, in _invoke
zato    |     service.handle()
zato    |   File "/opt/zato/3.2.0/code/zato-server/src/zato/server/service/internal/service.py", line 394, in handle
zato    |     class_ = channel_type_class[self.request.input.channel_type]
zato    | KeyError: 'soap'
zato    | 
zato    | `
zato    | 2022-04-11 09:42:13,021 - INFO - 3042:Dummy-120 - zato.hot-deploy.create:0 - Creating tar archive
zato    | 2022-04-11 09:42:13,023 - INFO - 3042:Dummy-120 - zato.hot-deploy.create:0 - Creating tar archive
zato    | 2022-04-11 09:42:13,186 - INFO - 3042:Dummy-120 - zato.hot-deploy.create:0 - Deployed 1 service from `/opt/zato/env/qs-1/server1/work/hot-deploy/current/FirstService.py` -> ['api.user.get-details']
zato    | 2022-04-11 09:42:15,056 - ERROR - 3042:Dummy-128 - zato.server.connection.http_soap.channel:0 - Caught an exception, cid:`d5245ef618127b6885ad6f6d`, status_code:`HTTPStatus.INTERNAL_SERVER_ERROR`, `Traceback (most recent call last):
zato    |   File "/opt/zato/3.2.0/code/zato-server/src/zato/server/service/__init__.py", line 886, in update_handle
zato    |     response = set_response_func(service, data_format=data_format, transport=transport, **kwargs)
zato    |   File "/opt/zato/3.2.0/code/zato-server/src/zato/server/service/__init__.py", line 705, in set_response_data
zato    |     response = response.getvalue(serialize=kwargs.get('serialize'))
zato    |   File "src/zato/cy/reqresp/payload.py", line 201, in zato.cy.reqresp.payload.SimpleIOPayload.getvalue
zato    |   File "src/zato/cy/reqresp/payload.py", line 229, in zato.cy.reqresp.payload.SimpleIOPayload.getvalue
zato    |   File "src/zato/cy/simpleio.py", line 2156, in zato.simpleio.CySimpleIO.get_output
zato    |   File "src/zato/cy/simpleio.py", line 2135, in zato.simpleio.CySimpleIO._get_output_json
zato    |   File "src/zato/cy/simpleio.py", line 2115, in zato.simpleio.CySimpleIO._convert_to_dicts
zato    |   File "src/zato/cy/simpleio.py", line 2036, in _yield_data_dicts
zato    | zato.simpleio.SerialisationError: Required element `id` missing in `{}` (<class 'zato.server.service.internal.service.GetChannelList'>)
zato    | 
zato    | During handling of the above exception, another exception occurred:
zato    | 
zato    | Traceback (most recent call last):
zato    |   File "/opt/zato/3.2.0/code/zato-server/src/zato/server/connection/http_soap/channel.py", line 338, in dispatch
zato    |     response = self.request_handler.handle(cid, url_match, channel_item, wsgi_environ,
zato    |   File "/opt/zato/3.2.0/code/zato-server/src/zato/server/connection/http_soap/channel.py", line 679, in handle
zato    |     response = service.update_handle(self._set_response_data, service, raw_request,
zato    |   File "/opt/zato/3.2.0/code/zato-server/src/zato/server/service/__init__.py", line 918, in update_handle
zato    |     raise e
zato    |   File "/opt/zato/3.2.0/code/zato-server/src/zato/server/service/__init__.py", line 858, in update_handle
zato    |     self._invoke(service, channel)
zato    |   File "/opt/zato/3.2.0/code/zato-server/src/zato/server/service/__init__.py", line 743, in _invoke
zato    |     service.handle()
zato    |   File "/opt/zato/3.2.0/code/zato-server/src/zato/server/service/internal/service.py", line 507, in handle
zato    |     response = func(
zato    |   File "/opt/zato/3.2.0/code/zato-server/src/zato/server/service/__init__.py", line 1054, in invoke
zato    |     return self.invoke_by_impl_name(self.server.service_store.name_to_impl_name[name], *args, **kwargs)
zato    |   File "/opt/zato/3.2.0/code/zato-server/src/zato/server/service/__init__.py", line 1032, in invoke_by_impl_name
zato    |     return self.update_handle(*invoke_args, **kwargs)
zato    |   File "/opt/zato/3.2.0/code/zato-server/src/zato/server/service/__init__.py", line 913, in update_handle
zato    |     raise Exception(exc_formatted)
zato    | Exception: Traceback (most recent call last):
zato    |   File "/opt/zato/3.2.0/code/zato-server/src/zato/server/service/__init__.py", line 858, in update_handle
zato    |     self._invoke(service, channel)
zato    |   File "/opt/zato/3.2.0/code/zato-server/src/zato/server/service/__init__.py", line 743, in _invoke
zato    |     service.handle()
zato    |   File "/opt/zato/3.2.0/code/zato-server/src/zato/server/service/internal/service.py", line 394, in handle
zato    |     class_ = channel_type_class[self.request.input.channel_type]
zato    | KeyError: 'soap'

I don’t know what I have done wrong. It was just a simple copy-paste
If you could help me guyz I would be really grateful

My second question is, that could we use this docker-compose for production. Do you have any suggestion please.

Thank you very much :grinning: :grinning:

Hello @louistwiice,

please use the latest Quickstart image that was published today - it corrects the very situation that you reported.

As to the usage of this image in production, yes, definitely, you can use it in any environment.

Regards.

1 Like

Hello @dsuch

Thank you very It works now :grinning: :grinning: !! You are really helpfull