n8n - 💡(How to fix) Fix SSH Private Key credential drops newlines when pasting, causing "Cannot parse privateKey: Unsupported key format" [1 pull requests]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

Error in the UI: "Couldn't connect with these settings" Error in the logs: error:1C80006B:Provider routines::wrong final block length

  • error: all

Fix Action

Fixed

RAW_BUFFERClick to expand / collapse

Bug Description

When creating an SSH Private Key credential, pasting a multi-line private key (OpenSSH format) into the Private Key field silently strips all newlines. The field is defined with password: true, which renders <input type="password"> instead of <textarea>, and HTML password inputs don't preserve newlines. The stored key becomes a single line. formatPrivateKey tries to fix it by splitting on ----- and replacing \s+ with \n, but the base64 body has no whitespace → stays one line → ssh2 can't parse it. Error in the UI: "Couldn't connect with these settings"
Error in the logs: error:1C80006B:Provider routines::wrong final block length

To Reproduce

  1. n8n → Credentials → Add New → SSH Private Key
  2. Fill Host, Port, Username
  3. Paste a multi-line OpenSSH key into Private Key
  4. Click Test → "Couldn't connect with these settings" Fix Option A (simplest): Remove password: true from the privateKey field definition. The field has rows: 4 → renders as <textarea> which preserves newlines. Option B: Fix formatPrivateKey to insert \n every 64 chars in the base64 body.

Expected behavior

Connection estabilishedwhen correct values are provided

Debug Info

Debug info

core

  • n8nVersion: 2.21.7
  • platform: docker (self-hosted)
  • nodeJsVersion: 24.15.0
  • nodeEnv: production
  • database: postgres
  • executionMode: scaling (single-main)
  • concurrency: -1
  • license: enterprise (production)
  • consumerId: e8db9cb3-4d3a-410d-83da-3474a3391f09

storage

  • success: all
  • error: all
  • progress: false
  • manual: true
  • binaryMode: database

pruning

  • enabled: true
  • maxAge: 336 hours
  • maxCount: 10000 executions

client

  • userAgent: mozilla/5.0 (windows nt 10.0; win64; x64) applewebkit/537.36 (khtml, like gecko) chrome/148.0.0.0 safari/537.36 edg/148.0.0.0
  • isTouchDevice: false

cluster

  • instanceCount: 3
  • versions: 2.21.7
  • instances:
    • instanceKey: a26ea3cc-0242-447e-81e9-bad237ff33da, hostId: worker-1af927d6b189, instanceType: worker, instanceRole: unset, version: 2.21.7
    • instanceKey: e5ae352d-db6a-4cdd-8a61-2ccc54a9a807, hostId: worker-9a812388552b, instanceType: worker, instanceRole: unset, version: 2.21.7
    • instanceKey: 41f6634b-ae48-46ef-905a-441a0925301b, hostId: main-bfd69e2ae9a9, instanceType: main, instanceRole: leader, version: 2.21.7
  • checks:
    • check: hostid-clash, status: succeeded, warnings: -
    • check: lifecycle, status: succeeded, warnings: -
    • check: split-brain, status: succeeded, warnings: -
    • check: version-mismatch, status: succeeded, warnings: -

Generated at: 2026-05-23T13:57:39.285Z

Operating System

Ubuntu

n8n Version

2.21.7

Node.js Version

22

Database

SQLite (default)

Execution mode

main (default)

Hosting

n8n cloud

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

Connection estabilishedwhen correct values are provided

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING