Enmasse problem: JSON parsing failed

I have a problem when trying do do enmasse in zato. I have an enmasse file like the following

channel_amqp: []

channel_jms_wmq: []

channel_plain_http:

  - cache_expiry: 0
    cache_id:
    cache_name:
    cache_type:
    connection: channel
    content_encoding: ""
    content_type:
    data_format: json
    has_rbac: false
    host:
    http_accept: "*/*"
    id: 666
    is_active: true
    is_internal: false
    is_rate_limit_active: false
    match_slash: true
    merge_url_params_req: true
    method: POST
    name: /agent-merchant-payment
    params_pri: channel-params-over-msg
    ping_method: HEAD
    pool_size: 20
    rate_limit_check_parent_def: false
    rate_limit_def: ""
    rate_limit_type: APPROXIMATE
    sec_def: zato-no-security
    sec_tls_ca_cert_id:
    sec_type:
    sec_use_rbac: false
    security_id:
    security_name:
    serialization_type: string
    service: agent-merchant-payment.agent-merchant-payment
    service_id: 700
    service_name: agent-merchant-payment.agent-merchant-payment
    service_whitelist: ""
    soap_action: ""
    soap_version:
    timeout: 10
    transport: plain_http
    url_params_pri: qs-over-path
    url_path: /agent-merchant-payment

  - cache_expiry: 0
    cache_id:
    cache_name:
    cache_type:
    connection: channel
    content_encoding: ""
    content_type:
    data_format: json
    has_rbac: false
    host:
    http_accept: "*/*"
    id: 667
    is_active: true
    is_internal: false
    is_rate_limit_active: false
    match_slash: true
    merge_url_params_req: true
    method: POST
    name: /agent-set-pin
    params_pri: channel-params-over-msg
    ping_method: HEAD
    pool_size: 20
    rate_limit_check_parent_def: false
    rate_limit_def: ""
    rate_limit_type: APPROXIMATE
    sec_def: zato-no-security
    sec_tls_ca_cert_id:
    sec_type:
    sec_use_rbac: false
    security_id:
    security_name:
    serialization_type: string
    service: agent-setpin.agent-set-pin
    service_id: 740
    service_name: agent-setpin.agent-set-pin
    service_whitelist: ""
    soap_action: ""
    soap_version:
    timeout: 10
    transport: plain_http
    url_params_pri: qs-over-path
    url_path: /agent-set-pin

  - cache_expiry: 0
    cache_id:
    cache_name:
    cache_type:
    connection: channel
    content_encoding: ""
    content_type:
    data_format: json
    has_rbac: false
    host:
    http_accept: "*/*"
    id: 668
    is_active: true
    is_internal: false
    is_rate_limit_active: false
    match_slash: true
    merge_url_params_req: true
    method: POST
    name: /agent-set-pin/mobile/
    params_pri: channel-params-over-msg
    ping_method: HEAD
    pool_size: 20
    rate_limit_check_parent_def: false
    rate_limit_def: ""
    rate_limit_type: APPROXIMATE
    sec_def: zato-no-security
    sec_tls_ca_cert_id:
    sec_type:
    sec_use_rbac: false
    security_id:
    security_name:
    serialization_type: string
    service: agent-setpin-mobile.agent-set-pin-mobile
    service_id: 739
    service_name: agent-setpin-mobile.agent-set-pin-mobile
    service_whitelist: ""
    soap_action: ""
    soap_version:
    timeout: 10
    transport: plain_http
    url_params_pri: qs-over-path
    url_path: /agent-set-pin/mobile/

  - cache_expiry: 0
    cache_id:
    cache_name:
    cache_type:
    connection: channel
    content_encoding: ""
    content_type:
    data_format: json
    has_rbac: false
    host:
    http_accept: "*/*"
    id: 669
    is_active: true
    is_internal: false
    is_rate_limit_active: false
    match_slash: true
    merge_url_params_req: true
    method: POST
    name: /agent/nfc/get/money/
    params_pri: channel-params-over-msg
    ping_method: HEAD
    pool_size: 20
    rate_limit_check_parent_def: false
    rate_limit_def: ""
    rate_limit_type: APPROXIMATE
    sec_def: zato-no-security
    sec_tls_ca_cert_id:
    sec_type:
    sec_use_rbac: false
    security_id:
    security_name:
    serialization_type: string
    service: agent-nfc-get-money.agent-nfc-get-money
    service_id: 709
    service_name: agent-nfc-get-money.agent-nfc-get-money
    service_whitelist: ""
    soap_action: ""
    soap_version:
    timeout: 10
    transport: plain_http
    url_params_pri: qs-over-path
    url_path: /agent/nfc/get/money/

[...]

I used the command

zato@c36d1ab694f2:~$ zato enmasse --import --replace-odb-objects --input ./zato-enmasse.yml ./env/qs-1/server1/

I have the following error:

JSON parsing failed
0 warnings and 4 errors found:
+-----------------+------------------------------------------------------------------------------------------------------+
|       Key       |                                                Value                                                 |
+=================+======================================================================================================+
| err0001/E06     | Ignoring unknown element type def_cloud_openstack_swift in the input.                                |
| unrecognized    |                                                                                                      |
| import element  |                                                                                                      |
+-----------------+------------------------------------------------------------------------------------------------------+
| err0002/E06     | Ignoring unknown element type json_pointer in the input.                                             |
| unrecognized    |                                                                                                      |
| import element  |                                                                                                      |
+-----------------+------------------------------------------------------------------------------------------------------+
| err0003/E06     | Ignoring unknown element type notif_cloud_openstack_swift in the input.                              |
| unrecognized    |                                                                                                      |
| import element  |                                                                                                      |
+-----------------+------------------------------------------------------------------------------------------------------+
| err0004/E06     | Ignoring unknown element type outconn_stomp in the input.                                            |
| unrecognized    |                                                                                                      |
| import element  |                                                                                                      |
+-----------------+------------------------------------------------------------------------------------------------------+

I don’t know if my enmasse file is wrong. i have created it from a previous zato on Docker (image: registry.gitlab.com/zatosource/docker-registry/quickstart:3.1-py3). If you could help me it would be great. thank you

Hello @louistwiice,

I am not sure what you mean by β€œ[...]” - have you not posted the whole enmasse file?

Hi,

I have put […] to mean etc. Here is a sample

channel_amqp: []

channel_jms_wmq: []

channel_plain_http:

  - cache_expiry: 0
    cache_id:
    cache_name:
    cache_type:
    connection: channel
    content_encoding: ""
    content_type:
    data_format: json
    has_rbac: false
    host:
    http_accept: "*/*"
    id: 666
    is_active: true
    is_internal: false
    is_rate_limit_active: false
    match_slash: true
    merge_url_params_req: true
    method: POST
    name: /payment
    params_pri: channel-params-over-msg
    ping_method: HEAD
    pool_size: 20
    rate_limit_check_parent_def: false
    rate_limit_def: ""
    rate_limit_type: APPROXIMATE
    sec_def: zato-no-security
    sec_tls_ca_cert_id:
    sec_type:
    sec_use_rbac: false
    security_id:
    security_name:
    serialization_type: string
    service: payment
    service_id: 700
    service_name: payment
    service_whitelist: ""
    soap_action: ""
    soap_version:
    timeout: 10
    transport: plain_http
    url_params_pri: qs-over-path
    url_path: /payment

  - cache_expiry: 0
    cache_id:
    cache_name:
    cache_type:
    connection: channel
    content_encoding: ""
    content_type:
    data_format: json
    has_rbac: false
    host:
    http_accept: "*/*"
    id: 667
    is_active: true
    is_internal: false
    is_rate_limit_active: false
    match_slash: true
    merge_url_params_req: true
    method: POST
    name: /set-pin
    params_pri: channel-params-over-msg
    ping_method: HEAD
    pool_size: 20
    rate_limit_check_parent_def: false
    rate_limit_def: ""
    rate_limit_type: APPROXIMATE
    sec_def: zato-no-security
    sec_tls_ca_cert_id:
    sec_type:
    sec_use_rbac: false
    security_id:
    security_name:
    serialization_type: string
    service: set-pin
    service_id: 740
    service_name: setpin
    service_whitelist: ""
    soap_action: ""
    soap_version:
    timeout: 10
    transport: plain_http
    url_params_pri: qs-over-path
    url_path: /set-pin

  - cache_expiry: 0
    cache_id:
    cache_name:
    cache_type:
    connection: channel
    content_encoding: ""
    content_type:
    data_format: json
    has_rbac: false
    host:
    http_accept: "*/*"
    id: 848
    is_active: true
    is_internal: false
    is_rate_limit_active: false
    match_slash: true
    merge_url_params_req: true
    method: POST
    name: purchase
    params_pri: channel-params-over-msg
    ping_method: HEAD
    pool_size: 20
    rate_limit_check_parent_def: false
    rate_limit_def: ""
    rate_limit_type: APPROXIMATE
    sec_def: zato-no-security
    sec_tls_ca_cert_id:
    sec_type:
    sec_use_rbac: false
    security_id:
    security_name:
    serialization_type: string
    service: mintroute
    service_id: 898
    service_name: mintroute
    service_whitelist: ""
    soap_action: ""
    soap_version:
    timeout: 10
    transport: plain_http
    url_params_pri: qs-over-path
    url_path: /purchase/

channel_zmq: []

cloud_aws_s3: []

def_amqp: []

def_cassandra: []

def_cloud_openstack_swift: []

def_jms_wmq: []

def_namespace: []

def_sec:

  - client_def: sec_def:::basic_auth:::ide_publisher
    client_name: sec_def:::basic_auth:::ide_publisher
    id: 1
    name: 'sec_def:::basic_auth:::ide_publisher:::IDE Publishers'
    opaque1:
    role_id: 2
    role_name: 'IDE Publishers'
    type: rbac_client_role

  - id: 1
    name: Create
    opaque1:
    type: rbac_permission

  - id: 1
    name: 'IDE Publishers:::zato.ide-deploy.create::Read'
    opaque1:
    perm_id: 2
    perm_name: Read
    role_id: 2
    role_name: 'IDE Publishers'
    service: zato.ide-deploy.create
    service_id: 84
    service_name: zato.ide-deploy.create
    type: rbac_role_permission

  - id: 1
    name: Root
    opaque1: ""
    parent_id:
    parent_name:
    type: rbac_role

  - id: 2
    name: Read
    opaque1:
    type: rbac_permission

  - id: 2
    name: 'IDE Publishers:::zato.ide-deploy.create::Create'
    opaque1:
    perm_id: 1
    perm_name: Create
    role_id: 2
    role_name: 'IDE Publishers'
    service: zato.ide-deploy.create
    service_id: 84
    service_name: zato.ide-deploy.create
    type: rbac_role_permission

  - id: 2
    name: 'IDE Publishers'
    opaque1: ""
    parent_id: 1
    parent_name: Root
    type: rbac_role

  - id: 3
    name: Update
    opaque1:
    type: rbac_permission

  - id: 3
    name: 'IDE Publishers:::zato.ide-deploy.create::Update'
    opaque1:
    perm_id: 3
    perm_name: Update
    role_id: 2
    role_name: 'IDE Publishers'
    service: zato.ide-deploy.create
    service_id: 84
    service_name: zato.ide-deploy.create
    type: rbac_role_permission

  - id: 4
    is_active: true
    is_rate_limit_active: ""
    name: ide_publisher
    rate_limit_check_parent_def: ""
    rate_limit_def: ""
    rate_limit_type: ""
    realm: ide_publisher
    type: basic_auth
    username: ide_publisher

  - id: 4
    name: Delete
    opaque1:
    type: rbac_permission

email_imap: []

email_smtp: []

json_pointer: []

json_rpc: []

notif_cloud_openstack_swift: []

notif_sql: []

outconn_amqp: []

outconn_ftp: []

outconn_jms_wmq: []

outconn_odoo: []

outconn_sap: []

outconn_sql: []

outconn_stomp: []

outconn_zmq: []

pubsub_endpoint: []

pubsub_topic: []

query_cassandra: []

scheduler:

  - cron_definition:
    days:
    extra: ""
    hours:
    id: 11
    is_active: true
    job_type: interval_based
    minutes: 30
    name: zato.wsx.cleanup.pub-sub
    repeats:
    seconds:
    service: pub.zato.channel.web-socket.cleanup-wsx-pub-sub
    service_id: 508
    service_name: pub.zato.channel.web-socket.cleanup-wsx-pub-sub
    start_date: 2022-04-19T10:17:21.680851
    weeks:

  - cron_definition:
    days:
    extra: ""
    hours:
    id: 12
    is_active: true
    job_type: interval_based
    minutes: 30
    name: zato.wsx.cleanup
    repeats:
    seconds:
    service: pub.zato.channel.web-socket.cleanup-wsx
    service_id: 645
    service_name: pub.zato.channel.web-socket.cleanup-wsx
    start_date: 2022-04-19T10:17:21.680851
    weeks:

search_es: []

search_solr: []

web_socket: []

xpath: []

zato_cache_builtin:

  - cache_id: 1
    cache_type: builtin
    current_size: 0
    extend_expiry_on_get: true
    extend_expiry_on_set: true
    id: 1
    is_active: true
    is_default: true
    max_item_size: 10000
    max_size: 10000
    name: default
    opaque1:
    persistent_storage: sql
    sync_method: in-background

zato_cache_memcached: []

zato_generic_connection: []

zato_sms_twilio: []

Ok, but if you are reporting an issue with a file then you cannot not submit the whole file because then I need to spend my time asking for details which should not have been necessary.

In your file, please delete all the entries that the enmasse invocation warned about, e.g. json_pointer. These are to do with features that are no longer in v3.2 and this is why they are not recognized. Please simply delete all such instances from the file.

1 Like

Hi @dsuch

Really sorry about that. That was my mistake.
I have tried what you have said and it works fine now. I have cleaned the file and delete some keys

Thank you very much :+1: :+1: :+1: :+1: