Skip to content
Troubleshooting Lan...
 
Notifications
Clear all

Troubleshooting Langchain SQL Agent Errors

20 Posts
4 Users
0 Reactions
7 Views
TAN_YONG_SHENG
(@tan_yong_sheng)
Posts: 13
Active Member
Topic starter
 

Describe the problem/error/question

I am attempting to utilize the langchain SQL agent with my Postgres database, but I'm encountering an error where the SQL agent cannot read properties of undefined (reading 'text'). I'm uncertain how to resolve this.

What is the error message (if any)?

Problem in node ‘Agent‘
Cannot read properties of undefined (reading 'text')

TypeError: Cannot read properties of undefined (reading 'text')
    at NoOpOutputParser.parseResult (/usr/local/lib/node_modules/callin.io/node_modules/.pnpm/langchain@0.0.154_@getzep+zep-js@0.7.2_@google-ai+generativelanguage@0.2.1_@huggingface+infer_bjcifbwga3ntgxrzz4r5mlqi6i/node_modules/langchain/dist/schema/output_parser.cjs:47:42)
    at NoOpOutputParser.parseResultWithPrompt (/usr/local/lib/node_modules/callin.io/node_modules/.pnpm/langchain@0.0.154_@getzep+zep-js@0.7.2_@google-ai+generativelanguage@0.2.1_@huggingface+infer_bjcifbwga3ntgxrzz4r5mlqi6i/node_modules/langchain/dist/schema/output_parser.cjs:20:21)
    at LLMChain._getFinalOutput (/usr/local/lib/node_modules/callin.io/node_modules/.pnpm/langchain@0.0.154_@getzep+zep-js@0.7.2_@google-ai+generativelanguage@0.2.1_@huggingface+infer_bjcifbwga3ntgxrzz4r5mlqi6i/node_modules/langchain/dist/chains/llm_chain.cjs:96:55)
    at LLMChain._call (/usr/local/lib/node_modules/callin.io/node_modules/.pnpm/langchain@0.0.154_@getzep+zep-js@0.7.2_@google-ai+generativelanguage@0.2.1_@huggingface+infer_bjcifbwga3ntgxrzz4r5mlqi6i/node_modules/langchain/dist/chains/llm_chain.cjs:126:42)
    at LLMChain.call (/usr/local/lib/node_modules/callin.io/node_modules/.pnpm/langchain@0.0.154_@getzep+zep-js@0.7.2_@google-ai+generativelanguage@0.2.1_@huggingface+infer_bjcifbwga3ntgxrzz4r5mlqi6i/node_modules/langchain/dist/chains/base.cjs:104:28)
    at LLMChain.predict (/usr/local/lib/node_modules/callin.io/node_modules/.pnpm/langchain@0.0.154_@getzep+zep-js@0.7.2_@google-ai+generativelanguage@0.2.1_@huggingface+infer_bjcifbwga3ntgxrzz4r5mlqi6i/node_modules/langchain/dist/chains/llm_chain.cjs:142:24)
    at ZeroShotAgent._plan (/usr/local/lib/node_modules/callin.io/node_modules/.pnpm/langchain@0.0.154_@getzep+zep-js@0.7.2_@google-ai+generativelanguage@0.2.1_@huggingface+infer_bjcifbwga3ntgxrzz4r5mlqi6i/node_modules/langchain/dist/agents/agent.cjs:234:24)
    at AgentExecutor._call (/usr/local/lib/node_modules/callin.io/node_modules/.pnpm/langchain@0.0.154_@getzep+zep-js@0.7.2_@google-ai+generativelanguage@0.2.1_@huggingface+infer_bjcifbwga3ntgxrzz4r5mlqi6i/node_modules/langchain/dist/agents/executor.cjs:144:26)
    at AgentExecutor.call (/usr/local/lib/node_modules/callin.io/node_modules/.pnpm/langchain@0.0.154_@getzep+zep-js@0.7.2_@google-ai+generativelanguage@0.2.1_@huggingface+infer_bjcifbwga3ntgxrzz4r5mlqi6i/node_modules/langchain/dist/chains/base.cjs:104:28)
    at Object.sqlAgentAgentExecute (/usr/local/lib/node_modules/callin.io/packages/@n8n/nodes-langchain/dist/nodes/agents/Agent/agents/SqlAgent/execute.js:61:26)

Please share your workflow

(Note: When configuring the Postgres credentials, I entered host.docker.internal into the "host" field because I am running my callin.io instance using Docker and Postgres.)

Share the output returned by the last node

The output is the same as the error message.

Information on your callin.io setup

  • callin.io version: callin.io AI beta version 1.11.0
  • Database (default: SQLite):: PostgreSQL
  • callin.io EXECUTIONS_PROCESS setting (default: own, main):
  • Running callin.io via (Docker, npm, callin.io cloud, desktop app): Docker
  • Operating system: Windows 11

Please provide the rewritten markdown content *it should be in the markdown format.

 
Posted : 30/10/2023 4:11 pm
TAN_YONG_SHENG
(@tan_yong_sheng)
Posts: 13
Active Member
Topic starter
 

Has anyone here utilized the SQL agent within callin.io previously? Appreciate any insights!

 
Posted : 30/10/2023 4:12 pm
Jon
 Jon
(@jon)
Posts: 96
Trusted Member
 

Hello,

The node appears to be functioning correctly on my end. Could you please try executing it independently, without the preceding nodes, to see if that makes any difference?

 
Posted : 30/10/2023 4:57 pm
TAN_YONG_SHENG
(@tan_yong_sheng)
Posts: 13
Active Member
Topic starter
 

Hi

Thanks for the reply. Yes, I'm encountering the same error when using your workflow (simply by importing your workflow JSON file).

 
Posted : 31/10/2023 12:21 pm
TAN_YONG_SHENG
(@tan_yong_sheng)
Posts: 13
Active Member
Topic starter
 

Could a configuration error in my Postgres database setup be the cause?

 
Posted : 31/10/2023 12:22 pm
Jon
 Jon
(@jon)
Posts: 96
Trusted Member
 

Hey,

It shouldn't be as long as that connection works. Can you try to repull the image to see if that helps?

 
Posted : 31/10/2023 12:25 pm
TAN_YONG_SHENG
(@tan_yong_sheng)
Posts: 13
Active Member
Topic starter
 

I used docker-compose pull to update the docker image, specifically for the callin.io AI beta version to 1.14.0. However, the same error persists:

The error code is shown here:

e

 
Posted : 31/10/2023 2:56 pm
TAN_YONG_SHENG
(@tan_yong_sheng)
Posts: 13
Active Member
Topic starter
 

Just wanted to share my docker-compose.yml file:

(I based this on the example found here: https://github.com/n8n-io/n8n/tree/master/docker/compose/withPostgres , with the only modification being the change of the docker image to docker.n8n.io/n8nio/n8n:ai-beta instead of docker.n8n.io/n8nio/n8n)

name: ${COMPOSE_PROJECT_NAME}
volumes:
  db_storage:
  n8n_storage:

services:
  postgres:
    image: postgres:11
    restart: always
    environment:
      - POSTGRES_USER
      - POSTGRES_PASSWORD
      - POSTGRES_DB
      - POSTGRES_NON_ROOT_USER
      - POSTGRES_NON_ROOT_PASSWORD
    volumes:
      - db_storage:/var/lib/postgresql/data
      - ./init-data.sh:/docker-entrypoint-initdb.d/init-data.sh
    healthcheck:
      test: ['CMD-SHELL', 'pg_isready -h localhost -U ${POSTGRES_USER} -d ${POSTGRES_DB}']
      interval: 5s
      timeout: 5s
      retries: 10

  n8n:
    # use n8n ai beta version
    image: docker.n8n.io/n8nio/n8n:ai-beta # docker.n8n.io/n8nio/n8n
    restart: always
    environment:
      - DB_TYPE=postgresdb
      - DB_POSTGRESDB_HOST=postgres
      - DB_POSTGRESDB_PORT=5432
      - DB_POSTGRESDB_DATABASE=${POSTGRES_DB}
      - DB_POSTGRESDB_USER=${POSTGRES_NON_ROOT_USER}
      - DB_POSTGRESDB_PASSWORD=${POSTGRES_NON_ROOT_PASSWORD}
    ports:
      - 5678:5678
    links:
      - postgres
    volumes:
      - n8n_storage:/home/node/.n8n
    depends_on:
      postgres:
        condition: service_healthy

init-data.sh

#!/bin/bash
set -e;

if [ -n "${POSTGRES_NON_ROOT_USER:-}" ] && [ -n "${POSTGRES_NON_ROOT_PASSWORD:-}" ]; then
    psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL
        CREATE USER ${POSTGRES_NON_ROOT_USER} WITH PASSWORD '${POSTGRES_NON_ROOT_PASSWORD}';
        GRANT ALL PRIVILEGES ON DATABASE ${POSTGRES_DB} TO ${POSTGRES_NON_ROOT_USER};
    EOSQL
else
    echo "SETUP INFO: No Environment variables given!"
fi

.env file

COMPOSE_PROJECT_NAME = n8n

POSTGRES_USER=postgres
POSTGRES_PASSWORD=postgres
POSTGRES_DB=n8n

POSTGRES_NON_ROOT_USER=nonrootuser
POSTGRES_NON_ROOT_PASSWORD=nonrootuser
 
Posted : 31/10/2023 3:04 pm
Jon
 Jon
(@jon)
Posts: 96
Trusted Member
 

Any ideas what could be going on here?

 
Posted : 31/10/2023 3:10 pm
oleg
 oleg
(@oleg)
Posts: 7
Active Member
 

Could you please share the agent's logs view?

Have you tried executing a simple query using a standard (non-agent) Postgres node? Are there any logs visible in your Postgres Docker container?

 
Posted : 31/10/2023 3:48 pm
TAN_YONG_SHENG
(@tan_yong_sheng)
Posts: 13
Active Member
Topic starter
 
  1. Could you please share the logs for the agent, specifically focusing on the agent node and the Google Palm chat model?

Raw json of input:


{
  "messages": [
    {
      "lc": 1,
      "type": "constructor",
      "id": [
        "langchain",
        "schema",
        "HumanMessage"
      ],
      "kwargs": {
        "content": "You are an agent designed to interact with an SQL database.nGiven an input question, create a syntactically correct sqlite query to run, then look at the results of the query and return the answer.nUnless the user specifies a specific number of examples they wish to obtain, always limit your query to at most 10 results using the LIMIT clause.nYou can order the results by a relevant column to return the most interesting examples in the database.nNever query for all the columns from a specific table, only ask for a the few relevant columns given the question.nYou have access to tools for interacting with the database.nOnly use the below tools. Only use the information returned by the below tools to construct your final answer.nYou MUST double check your query before executing it. If you get an error while executing a query, rewrite the query and try again.nnDO NOT make any DML statements (INSERT, UPDATE, DELETE, DROP etc.) to the database.nnIf the question does not seem related to the database, just return "I don't know" as the answer.nnquery-sql: Input to this tool is a detailed and correct SQL query, output is a result from the database.n  If the query is not correct, an error message will be returned.n  If an error is returned, rewrite the query, check the query, and try again.ninfo-sql: Input to this tool is a comma-separated list of tables, output is the schema and sample rows for those tables.n    Be sure that the tables actually exist by calling list-tables-sql first!nn    Example Input: "table1, table2, table3.nlist-tables-sql: Input is an empty string, output is a comma-separated list of tables in the database.nquery-checker: Use this tool to double check if your query is correct before executing it.n    Always use this tool before executing a query with query-sql!nnUse the following format in your response:nnQuestion: the input question you must answernThought: you should always think about what to donAction: the action to take, should be one of [query-sql,info-sql,list-tables-sql,query-checker]nAction Input: the input to the actionnObservation: the result of the actionn... (this Thought/Action/Action Input/Observation can repeat N times)nThought: I now know the final answernFinal Answer: the final answer to the original input questionnnBegin!nnQuestion: which campaign has the highest conversion?nThought: I should look at the tables in the database to see what I can query.n",
        "additional_kwargs": {}
      }
    }
  ],
  "options": {
    "stop": [
      "nObservation: "
    ],
    "promptIndex": 0
  }
}

Raw json of output


{
  "response": {
    "generations": [],
    "llmOutput": {
      "filters": [
        {
          "reason": "OTHER"
        }
      ]
    }
  }
}
 
Posted : 31/10/2023 4:26 pm
TAN_YONG_SHENG
(@tan_yong_sheng)
Posts: 13
Active Member
Topic starter
 

Could you please share the logs for the agent? (full workflow)

The log appears similar to the one shown above:

 
Posted : 31/10/2023 4:31 pm
TAN_YONG_SHENG
(@tan_yong_sheng)
Posts: 13
Active Member
Topic starter
 

Here are the logs from my Dockerized PostgreSQL database:

2023-10-31 18:50:44 
2023-10-31 18:50:44 PostgreSQL Database directory appears to contain a database; Skipping initialization
2023-10-31 18:50:44 
2023-10-31 22:38:52 
2023-10-31 22:38:52 PostgreSQL Database directory appears to contain a database; Skipping initialization
2023-10-31 22:38:52 
2023-10-31 18:50:46 2023-10-31 10:50:46.198 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
2023-10-31 18:50:46 2023-10-31 10:50:46.200 UTC [1] LOG:  listening on IPv6 address "::", port 5432
2023-10-31 18:50:46 2023-10-31 10:50:46.211 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2023-10-31 18:50:46 2023-10-31 10:50:46.421 UTC [26] LOG:  database system was shut down at 2023-10-31 10:50:11 UTC
2023-10-31 18:50:46 2023-10-31 10:50:46.548 UTC [1] LOG:  database system is ready to accept connections
2023-10-31 18:52:28 2023-10-31 10:52:28.535 UTC [132] ERROR:  permission denied to create extension "uuid-ossp"
2023-10-31 18:52:28 2023-10-31 10:52:28.535 UTC [132] HINT:  Must be superuser to create this extension.
2023-10-31 18:52:28 2023-10-31 10:52:28.535 UTC [132] STATEMENT:  CREATE EXTENSION IF NOT EXISTS "uuid-ossp"
2023-10-31 20:16:38 2023-10-31 12:16:38.144 UTC [415] ERROR:  duplicate key value violates unique constraint "pk_workflow_statistics"
2023-10-31 20:16:38 2023-10-31 12:16:38.144 UTC [415] DETAIL:  Key ("workflowId", name)=("BTjdV55kBTPYcz6i", data_loaded) already exists.
2023-10-31 20:16:38 2023-10-31 12:16:38.144 UTC [415] STATEMENT:  INSERT INTO "public"."workflow_statistics"("count", "latestEvent", "name", "workflowId") VALUES ($1, $2, $3, $4)
2023-10-31 20:18:47 2023-10-31 12:18:47.237 UTC [601] ERROR:  duplicate key value violates unique constraint "pk_workflow_statistics"
2023-10-31 20:18:47 2023-10-31 12:18:47.237 UTC [601] DETAIL:  Key ("workflowId", name)=("BTjdV55kBTPYcz6i", data_loaded) already exists.
2023-10-31 20:18:47 2023-10-31 12:18:47.237 UTC [601] STATEMENT:  INSERT INTO "public"."workflow_statistics"("count", "latestEvent", "name", "workflowId") VALUES ($1, $2, $3, $4)
2023-10-31 22:29:24 2023-10-31 14:29:24.613 UTC [1] LOG:  received fast shutdown request
2023-10-31 22:29:24 2023-10-31 14:29:24.628 UTC [1] LOG:  aborting any active transactions
2023-10-31 22:29:24 2023-10-31 14:29:24.659 UTC [1] LOG:  background worker "logical replication launcher" (PID 32) exited with exit code 1
2023-10-31 22:29:24 2023-10-31 14:29:24.668 UTC [27] LOG:  shutting down
2023-10-31 22:29:24 2023-10-31 14:29:24.823 UTC [1] LOG:  database system is shut down
2023-10-31 22:38:52 2023-10-31 14:38:52.875 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
2023-10-31 22:38:52 2023-10-31 14:38:52.877 UTC [1] LOG:  listening on IPv6 address "::", port 5432
2023-10-31 22:38:52 2023-10-31 14:38:52.889 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2023-10-31 22:38:52 2023-10-31 14:38:52.970 UTC [26] LOG:  database system was shut down at 2023-10-31 14:29:24 UTC
2023-10-31 22:38:53 2023-10-31 14:38:53.021 UTC [1] LOG:  database system is ready to accept connections
2023-10-31 22:39:11 2023-10-31 14:39:11.844 UTC [58] ERROR:  permission denied to create extension "uuid-ossp"
2023-10-31 22:39:11 2023-10-31 14:39:11.844 UTC [58] HINT:  Must be superuser to create this extension.
2023-10-31 22:39:11 2023-10-31 14:39:11.844 UTC [58] STATEMENT:  CREATE EXTENSION IF NOT EXISTS "uuid-ossp"
2023-10-31 22:40:31 2023-10-31 14:40:31.989 UTC [170] ERROR:  duplicate key value violates unique constraint "pk_workflow_statistics"
2023-10-31 22:40:31 2023-10-31 14:40:31.989 UTC [170] DETAIL:  Key ("workflowId", name)=("BTjdV55kBTPYcz6i", data_loaded) already exists.
2023-10-31 22:40:31 2023-10-31 14:40:31.989 UTC [170] STATEMENT:  INSERT INTO "public"."workflow_statistics"("count", "latestEvent", "name", "workflowId") VALUES ($1, $2, $3, $4)
2023-11-01 00:20:36 2023-10-31 16:20:36.212 UTC [7525] ERROR:  duplicate key value violates unique constraint "pk_workflow_statistics"
2023-11-01 00:20:36 2023-10-31 16:20:36.212 UTC [7525] DETAIL:  Key ("workflowId", name)=("4qkQ2Apyr1oBg5nM", data_loaded) already exists.
2023-11-01 00:20:36 2023-10-31 16:20:36.212 UTC [7525] STATEMENT:  INSERT INTO "public"."workflow_statistics"("count", "latestEvent", "name", "workflowId") VALUES ($1, $2, $3, $4)
2023-11-01 00:20:38 2023-10-31 16:20:38.003 UTC [7534] ERROR:  duplicate key value violates unique constraint "pk_workflow_statistics"
2023-11-01 00:20:38 2023-10-31 16:20:38.003 UTC [7534] DETAIL:  Key ("workflowId", name)=("4qkQ2Apyr1oBg5nM", data_loaded) already exists.
2023-11-01 00:20:38 2023-10-31 16:20:38.003 UTC [7534] STATEMENT:  INSERT INTO "public"."workflow_statistics"("count", "latestEvent", "name", "workflowId") VALUES ($1, $2, $3, $4)
2023-11-01 00:20:39 2023-10-31 16:20:39.205 UTC [7525] ERROR:  duplicate key value violates unique constraint "pk_workflow_statistics"
2023-11-01 00:20:39 2023-10-31 16:20:39.205 UTC [7525] DETAIL:  Key ("workflowId", name)=("4qkQ2Apyr1oBg5nM", data_loaded) already exists.
2023-11-01 00:20:39 2023-10-31 16:20:39.205 UTC [7525] STATEMENT:  INSERT INTO "public"."workflow_statistics"("count", "latestEvent", "name", "workflowId") VALUES ($1, $2, $3, $4)
2023-11-01 00:20:40 2023-10-31 16:20:40.312 UTC [7534] ERROR:  duplicate key value violates unique constraint "pk_workflow_statistics"
2023-11-01 00:20:40 2023-10-31 16:20:40.312 UTC [7534] DETAIL:  Key ("workflowId", name)=("4qkQ2Apyr1oBg5nM", data_loaded) already exists.
2023-11-01 00:20:40 2023-10-31 16:20:40.312 UTC [7534] STATEMENT:  INSERT INTO "public"."workflow_statistics"("count", "latestEvent", "name", "workflowId") VALUES ($1, $2, $3, $4)
2023-11-01 00:20:42 2023-10-31 16:20:42.125 UTC [7525] ERROR:  duplicate key value violates unique constraint "pk_workflow_statistics"
2023-11-01 00:20:42 2023-10-31 16:20:42.125 UTC [7525] DETAIL:  Key ("workflowId", name)=("4qkQ2Apyr1oBg5nM", data_loaded) already exists.
2023-11-01 00:20:42 2023-10-31 16:20:42.125 UTC [7525] STATEMENT:  INSERT INTO "public"."workflow_statistics"("count", "latestEvent", "name", "workflowId") VALUES ($1, $2, $3, $4)
2023-11-01 00:20:46 2023-10-31 16:20:46.037 UTC [7534] ERROR:  duplicate key value violates unique constraint "pk_workflow_statistics"
2023-11-01 00:20:46 2023-10-31 16:20:46.037 UTC [7534] DETAIL:  Key ("workflowId", name)=("4qkQ2Apyr1oBg5nM", data_loaded) already exists.
2023-11-01 00:20:46 2023-10-31 16:20:46.037 UTC [7534] STATEMENT:  INSERT INTO "public"."workflow_statistics"("count", "latestEvent", "name", "workflowId") VALUES ($1, $2, $3, $4)
2023-11-01 00:20:46 2023-10-31 16:20:46.983 UTC [7525] ERROR:  duplicate key value violates unique constraint "pk_workflow_statistics"
2023-11-01 00:20:46 2023-10-31 16:20:46.983 UTC [7525] DETAIL:  Key ("workflowId", name)=("4qkQ2Apyr1oBg5nM", data_loaded) already exists.
2023-11-01 00:20:46 2023-10-31 16:20:46.983 UTC [7525] STATEMENT:  INSERT INTO "public"."workflow_statistics"("count", "latestEvent", "name", "workflowId") VALUES ($1, $2, $3, $4)
2023-11-01 00:20:47 2023-10-31 16:20:47.946 UTC [7534] ERROR:  duplicate key value violates unique constraint "pk_workflow_statistics"
2023-11-01 00:20:47 2023-10-31 16:20:47.946 UTC [7534] DETAIL:  Key ("workflowId", name)=("4qkQ2Apyr1oBg5nM", data_loaded) already exists.
2023-11-01 00:20:47 2023-10-31 16:20:47.946 UTC [7534] STATEMENT:  INSERT INTO "public"."workflow_statistics"("count", "latestEvent", "name", "workflowId") VALUES ($1, $2, $3, $4)
2023-11-01 00:20:48 2023-10-31 16:20:48.807 UTC [7525] ERROR:  duplicate key value violates unique constraint "pk_workflow_statistics"
2023-11-01 00:20:48 2023-10-31 16:20:48.807 UTC [7525] DETAIL:  Key ("workflowId", name)=("4qkQ2Apyr1oBg5nM", data_loaded) already exists.
2023-11-01 00:20:48 2023-10-31 16:20:48.807 UTC [7525] STATEMENT:  INSERT INTO "public"."workflow_statistics"("count", "latestEvent", "name", "workflowId") VALUES ($1, $2, $3, $4)
2023-11-01 00:22:32 2023-10-31 16:22:32.552 UTC [1] LOG:  received fast shutdown request
2023-11-01 00:22:32 2023-10-31 16:22:32.580 UTC [1] LOG:  aborting any active transactions
2023-11-01 00:22:32 2023-10-31 16:22:32.743 UTC [1] LOG:  background worker "logical replication launcher" (PID 32) exited with exit code 1
2023-11-01 00:22:32 2023-10-31 16:22:32.841 UTC [27] LOG:  shutting down
2023-11-01 00:22:33 2023-10-31 16:22:33.483 UTC [1] LOG:  database system is shut down
2023-11-01 00:27:42 2023-10-31 16:27:42.109 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
2023-11-01 00:27:42 2023-10-31 16:27:42.112 UTC [1] LOG:  listening on IPv6 address "::", port 5432
2023-11-01 00:27:42 2023-10-31 16:27:42.133 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2023-11-01 00:27:42 2023-10-31 16:27:42.398 UTC [26] LOG:  database system was shut down at 2023-10-31 16:22:33 UTC
2023-11-01 00:27:42 2023-10-31 16:27:42.508 UTC [1] LOG:  database system is ready to accept connections
2023-11-01 00:28:15 2023-10-31 16:28:15.080 UTC [74] ERROR:  permission denied to create extension "uuid-ossp"
2023-11-01 00:28:15 2023-10-31 16:28:15.080 UTC [74] HINT:  Must be superuser to create this extension.
2023-11-01 00:28:15 2023-10-31 16:28:15.080 UTC [74] STATEMENT:  CREATE EXTENSION IF NOT EXISTS "uuid-ossp"
2023-11-01 00:28:59 2023-10-31 16:28:59.062 UTC [143] ERROR:  duplicate key value violates unique constraint "pk_workflow_statistics"
2023-11-01 00:28:59 2023-10-31 16:28:59.062 UTC [143] DETAIL:  Key ("workflowId", name)=("BTjdV55kBTPYcz6i", data_loaded) already exists.
2023-11-01 00:28:59 2023-10-31 16:28:59.062 UTC [143] STATEMENT:  INSERT INTO "public"."workflow_statistics"("count", "latestEvent", "name", "workflowId") VALUES ($1, $2, $3, $4)
2023-11-01 00:27:41 
2023-11-01 00:27:41 PostgreSQL Database directory appears to contain a database; Skipping initialization
2023-11-01 00:27:41
 
Posted : 31/10/2023 4:34 pm
TAN_YONG_SHENG
(@tan_yong_sheng)
Posts: 13
Active Member
Topic starter
 

I attempted to use the standard Postgres node.

Workflow 1, which performs an "insert," was successful. It created a table named n8n_analytics and populated it with data according to the specified columns.

However, Workflow 2, designed for "upsert," did not function as anticipated.

  • The complete workflows utilizing Postgres are shown below:
  • The error message for Workflow 2 is displayed below:

I will attempt to open another trial callin.io cloud instance to verify if my workflow operates correctly on the cloud platform.

 
Posted : 31/10/2023 5:03 pm
Jon
 Jon
(@jon)
Posts: 96
Trusted Member
 

Hello,

Cloud and self-hosted versions will be largely identical, with no functional differences in the callin.io version. The upsert error you're encountering might be resolved by switching from 'Map Automatically' to 'Map Manually'. However, if your table includes an auto-generated field, this will also lead to an error. In such cases, you would need to utilize the 'Execute Query' option instead.

 
Posted : 31/10/2023 5:12 pm
Page 1 / 2
Share: