Workflow getting error on execution

ERROR: Pyodide already fatally failed and can no longer be used.

Details

Stack

Error: Pyodide already fatally failed and can no longer be used.
    at Object.get [as runPythonAsync] (/usr/lib/node_modules/n8n/node_modules/pyodide/pyodide.asm.js:9:103459)
    at PythonSandbox.runCodeInPython (/usr/lib/node_modules/n8n/node_modules/n8n-nodes-base/nodes/Code/PythonSandbox.ts:62:18)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at PythonSandbox.runCodeAllItems (/usr/lib/node_modules/n8n/node_modules/n8n-nodes-base/nodes/Code/PythonSandbox.ts:47:27)
    at Object.execute (/usr/lib/node_modules/n8n/node_modules/n8n-nodes-base/nodes/Code/Code.node.ts:135:14)
    at Workflow.runNode (/usr/lib/node_modules/n8n/node_modules/n8n-workflow/src/Workflow.ts:1332:8)
    at /usr/lib/node_modules/n8n/node_modules/n8n-core/src/WorkflowExecute.ts:1046:29
    at /usr/lib/node_modules/n8n/node_modules/n8n-core/src/WorkflowExecute.ts:1722:11

Integration_Types

Parameters


Docs

Mode

Language

Python

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

ret_data =

for item in _input.all():

rec = item.json[“body”]

for key, val in rec.items():

if val in [“psa”, “emails”, “alerts”]:

ret_data.append(key)

company_ids = _(‘Webhook’).all()[0].json[“body”].get(“company_ids”)

print(“company_ids”, company_ids)

companies_list = company_ids.split(“,”)

tenant_id = _(‘Webhook’).all()[0].json[“headers”][“x-tenant-id”]

ret_data = “,”.join(ret_data)

return {“integrations”: “{”+ret_data+“}”, “tenantid”: tenant_id, “companies”: “{”+company_ids+“}”, “companies_list”: companies_list}

Debug by using print() statements and viewing their output in the browser console.

I wish this node would…

Describe the problem/error/question

What is the error message (if any)?

Please share your workflow

(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)

Share the output returned by the last node

Information on your n8n setup

  • n8n version: : 1.27
  • Database (default: SQLite): : Postgres
  • n8n EXECUTIONS_PROCESS setting (default: own, main): : main
  • Running n8n via (Docker, npm, n8n cloud, desktop app): : npm
  • Operating system:: Ubuntu 20.0

Please help on this asap.

Hi @Raju_Bishnoi Please edit the question and include the code part inside this block.

image

1 Like

Hi @mcnaveen
Please find below python code.

import json

tenant_data = []
for item in _input.all():
    tenant_ids = item.json["tenant_ids"]
    print(type(tenant_ids))
    if tenant_ids:
        for tenantid, val in tenant_ids.items():
            tenant_data.append({"tenant_id": tenantid})
    print(tenant_data)
    print(type(tenant_data))
return tenant_data

To avoid duplication of work. This question got also posted to GitHub: