SOLVED: Discord Trigger ‘Invalid URL’ Error - Workflow Stuck on Activation

SOLVED: Discord Trigger ‘Invalid URL’ Error - Workflow Stuck on Activation

Describe the problem/error/question

Discord Trigger nodes from the `n8n-nodes-discord-trigger` community package work perfectly in test mode but fail when activating workflows. Users experience "Invalid URL" errors when trying to deactivate workflows, 500 Internal Server Errors, and stuck workflows that cannot be managed. The bot responds to @mentions and direct messages (Discord Trigger nodes) but slash commands routed through webhook nodes fail immediately. This issue commonly occurs after installing Discord community nodes or upgrading n8n versions.

What is the error message (if any)?

- Browser UI: "Workflow could not be deactivated: Failed to deactivate trigger of workflow ID 'QbGnkmAIxXUJ6UZF': Invalid URL"
- Browser Console: `PATCH https://n8n.madpanda3d.com/rest/workflows/QbGnkmAIxXUJ6UZF 500 (Internal Server Error)`
- n8n Logs: 
  ```
  ResponseError: The requested webhook 'POST /rest/telemetry/proxy/v1/page' is not registered.
  ResponseError: The requested webhook 'POST /rest/telemetry/proxy/v1/identify' is not registered.
  ResponseError: The requested webhook 'POST /rest/telemetry/proxy/v1/track' is not registered.
  ```
- After uninstalling nodes: `Unrecognized node type: n8n-nodes-discord-trigger.discordTrigger`
- Credential test failures due to incorrect API configuration

Please share your workflow

Any workflow containing Discord Trigger nodes from the `n8n-nodes-discord-trigger` community package. The issue affects workflows with both Discord Trigger nodes (for @mentions/DMs) and regular Webhook nodes (for slash commands).

Share the output returned by the last node

N/A - Issue occurs during workflow activation/deactivation, not during execution.

Information on your n8n setup

  • - **n8n version:** 1.108.2
    - **Database:** PostgreSQL 15
    - **n8n EXECUTIONS_PROCESS setting:** main
    - **Running n8n via:** Docker Compose with Nginx Proxy Manager
    - **Operating system:** Ubuntu 22.04 (Hostinger VPS)
    

COMPLETE SOLUTION BELOW

## COMPLETE SOLUTION

### ROOT CAUSE
The primary issue is incorrect WEBHOOK_URL configuration. Most users set:
```
WEBHOOK_URL=https://yourdomain.com
```
But it must include the webhook path:
```
WEBHOOK_URL=https://yourdomain.com/webhook/
```

### SECONDARY ISSUES
1. Incorrect Discord credential configuration
2. Missing n8n API key setup
3. Wrong Base URL in credentials

### RECOVERY METHOD (when workflows are stuck)

1. **Uninstall the problematic Discord community node** temporarily via n8n UI

2. **Stop n8n containers:**
   ```bash
   docker-compose down
   ```

3. **Start PostgreSQL and use recovery mode:**
   ```bash
   docker-compose up -d postgres
   docker run --rm -it --network n8n_default -v n8n_n8n_data:/home/node/.n8n -e DB_TYPE=postgresdb -e DB_POSTGRESDB_DATABASE=n8n -e DB_POSTGRESDB_HOST=postgres -e DB_POSTGRESDB_PORT=5432 -e DB_POSTGRESDB_USER=n8n -e DB_POSTGRESDB_PASSWORD=your_secure_password -e WEBHOOK_URL=https://yourdomain.com/webhook/ -p 5678:5678 docker.n8n.io/n8nio/n8n:latest start --skip-executions
   ```

4. **Access n8n via:** `http://localhost:5678`

5. **Deactivate and delete stuck workflows**

6. **Stop recovery container** (Ctrl+C)

### PERMANENT FIX

1. **Fix WEBHOOK_URL in docker-compose.yml:**
   ```yaml
   environment:
     - WEBHOOK_URL=https://yourdomain.com/webhook/
   ```

2. **Configure Discord credentials correctly:**
   - **Client ID**: Your Discord Application ID
   - **Bot Token**: Your Discord Bot Token  
   - **n8n API key**: Generate from n8n Settings > API Keys
   - **Base URL**: `https://yourdomain.com/api/v1` (must include `/api/v1`)

3. **Restart n8n normally:**
   ```bash
   docker-compose up -d
   ```

4. **Reinstall Discord community nodes**

5. **Recreate workflows with fresh nodes** (don't copy old Discord Trigger/Webhook nodes)

### PREVENTION
- Always include `/webhook/` in WEBHOOK_URL configuration
- Set up credentials with correct Base URL (`/api/v1`)
- Test with simple workflows first after configuration changes
- Take VPS snapshots before major changes
- Use fresh nodes instead of copying problematic ones

### VERIFICATION
After implementing the fix:
- Discord Trigger nodes should activate without errors
- @mentions and DMs work (Discord Trigger nodes)
- Slash commands work (Webhook nodes)
- No webhook registration errors in logs
- Workflows can be deactivated normally

This solution resolves both Discord trigger activation issues and webhook registration problems permanently.

Great work friend

2 Likes

The issue has been resolved

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.