Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unrecognized node type: n8n-nodes-searxng.searxngTool #7

Open
sivom opened this issue Jan 28, 2025 · 10 comments
Open

Unrecognized node type: n8n-nodes-searxng.searxngTool #7

sivom opened this issue Jan 28, 2025 · 10 comments

Comments

@sivom
Copy link

sivom commented Jan 28, 2025

Installed through webui and followed the installation instructions from the below link
https://github.com/sammcj/n8n-nodes-searxng

Image

Image

Below is the error log


Community package installed: n8n-nodes-searxng
Unrecognized node type: n8n-nodes-searxng.searxngTool
Error: Unrecognized node type: n8n-nodes-searxng.searxngTool
    at PackageDirectoryLoader.getNode (/usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/nodes-loader/directory-loader.js:156:15)
    at LoadNodesAndCredentials.getNode (/usr/local/lib/node_modules/n8n/dist/load-nodes-and-credentials.js:277:23)
    at NodeTypes.getByNameAndVersion (/usr/local/lib/node_modules/n8n/dist/node-types.js:36:51)
    at new Workflow (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/Workflow.js:56:39)
    at TestWebhooks.toWorkflow (/usr/local/lib/node_modules/n8n/dist/webhooks/test-webhooks.js:290:16)
    at TestWebhooks.needsWebhook (/usr/local/lib/node_modules/n8n/dist/webhooks/test-webhooks.js:169:31)
    at WorkflowExecutionService.executeManually (/usr/local/lib/node_modules/n8n/dist/workflows/workflow-execution.service.js:114:58)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at WorkflowsController.runManually (/usr/local/lib/node_modules/n8n/dist/workflows/workflows.controller.js:293:16)
    at handler (/usr/local/lib/node_modules/n8n/dist/decorators/controller.registry.js:93:24)
@ihor-sokoliuk
Copy link
Contributor

@sivom I had the same issue.
Here is the original ticket with a solution:
n8n-io/n8n#12593
Another link with my solution that I use everyday:
drudge/n8n-nodes-puppeteer#59 (comment)

@LasyShark
Copy link

@sivom Did you get this issue resolved that you could comment on? Any alternatives?
@ihor-sokoliuk No complete solution is readily apparent. Could you expand more on the following?

In my case, after this in my Dockerfile:
USER root
RUN sed -i "s/nodeType.startsWith('n8n-nodes-base') && //g" /usr/local/lib/node_modules/n8n/dist/node-types.js
USER node

Question: should we add the three lines at the bottom of the docker container code?

Image

@ihor-sokoliuk
Copy link
Contributor

@LasyShark this is not something that you can fix within the node source code
It's an n8n limitations, check the original issue thread.

I am running my n8n in docker so I have my custom n8n docker image that I build with the Dockerfile.
This Dockerfile has these lines to turn the limitations off

@rjbaat
Copy link

rjbaat commented Feb 10, 2025

@ihor-sokoliuk I would like to test your searxng node and try to run a custom build n8n container.
Can you point me to the Dockerfile you adjusted in the forked n8n. I can't find where to put the snippet you mentioned above.

USER root
RUN sed -i "s/nodeType.startsWith('n8n-nodes-base') && //g" /usr/local/lib/node_modules/n8n/dist/node-types.js
USER node

@ihor-sokoliuk
Copy link
Contributor

@rjbaat I do not fork from the n8n repo.
I write my own Dockerfile with the n8n as a base image.

My Dockerfile looks like this:

FROM n8nio/n8n:next # can be any latest version

USER root

# Remove limitation on the custom nodes as a tool
RUN sed -i "s/nodeType.startsWith('n8n-nodes-base') && //g" /usr/local/lib/node_modules/n8n/dist/node-types.js

# Install NPM libs that I need
....

USER node

And then build and run the image based on this Dockerfile.

I prefer docker compose file:

services:
  n8n:
    build:
      context: .
      dockerfile: Dockerfile
    restart: unless-stopped
    container_name: n8n
    ports:
      - "443:443"
    volumes:
      - ...

That builds the n8n image with your changes and will unblock the community tool usage in AI agent.

@netroy
Copy link

netroy commented Feb 12, 2025

starting the last release, you don't need to do any of this. You can simply set the env variable N8N_COMMUNITY_PACKAGES_ALLOW_TOOL_USAGE to true to allow community nodes as tools.

@rjbaat
Copy link

rjbaat commented Feb 12, 2025

@netroy oke cool, from what version is this ENV supported? I tried 1.77.3 but I get this error now:

Unrecognized node type: n8n-nodes-searxng.searxngTool

@netroy
Copy link

netroy commented Feb 12, 2025

never mind. I forgot that this was merged only 6 days ago, and it's yet to be a part of a release. If you want to test it, you could use the latest nightly release.

@rjbaat
Copy link

rjbaat commented Feb 12, 2025

Oke thnx! I tried with nightly and I don't get the error now. Only I get another error.

Maybe @ihor-sokoliuk you can help me out?

I am running the searing container next to n8n and connected them to the same network.
Also I added this to the query:

{
  "query": "your search terms",
  "categories": ["general"],
  "additionalFields": {
    "language": "en",
    "time_range": "month",
    "safesearch": "1"
  }
}

But I get a 403 error from searxng.
Also I tried with the expression: {{ $fromAI('search_query') }}. but that gives me a 403 aswell.

I used the default API Key from settings.yaml and also tried without key.

Do you have an idea what the problem could be?

@ihor-sokoliuk
Copy link
Contributor

ihor-sokoliuk commented Feb 16, 2025

@rjbaat you can share your node config by clicking on the searxng node at the n8n web ui, copying it (Ctrl+C) and pasting here in the code block.
It will paste the JSON representation of the n8n node.

For example, here is my searxng node as a tool that works fine:

{
  "nodes": [
    {
      "parameters": {
        "query": "={{ $fromAI(\"search_query\") }}",
        "additionalFields": {}
      },
      "type": "n8n-nodes-searxng.searxngTool",
      "typeVersion": 1,
      "position": [
        760,
        0
      ],
      "id": "57275934-4750-4161-afd7-0b448e35470c",
      "name": "Searxng",
      "credentials": {
        "searxngApi": {
          "id": "SjgKUkKRe8iOc9S8",
          "name": "Searxng account"
        }
      }
    }
  ],
  "connections": {
    "Searxng": {
      "ai_tool": [
        []
      ]
    }
  },
  "pinData": {},
  "meta": {
    "templateCredsSetupCompleted": true,
    "instanceId": "32e0122e4e877b910e74d970ea713024c39bbd223514673968296aba6460ef20"
  }
}

There could be an issue with the node setup.

Also, please consider enabling the JSON format for the SearXNG server:
open-webui/open-webui#2824

For example, this is the settings.yml for my SearXNG self-hosted server.

# see https://docs.searxng.org/admin/settings/settings.html#settings-use-default-settings
use_default_settings: true
server:
...
  limiter: false  # can be disabled for a private instance
...
ui:
  static_use_hash: true
redis:
  url: redis://redis:6379/0
general:
  default_lang: en
  enable_metrics: false
...
search:
  safe_search: 0
  autocomplete: ""
...
  formats:
    - json
    - html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants