waha icon indicating copy to clipboard operation
waha copied to clipboard

[NOWEB] - /api/sendImage fails to upload media on version 2025.9.5 ~ 2025.10.2

Open yusoft-app opened this issue 1 year ago • 38 comments

Describe the bug

After updating to WAHA Plus version 2025.9.8 (engine: NOWEB), the /api/sendImage endpoint stopped working. It consistently returns the error:

Media upload failed on all hosts

In version 2025.9.7, /api/sendImage worked normally, even though that version had a different issue (duplicate sending bug).

Version

{
  "version": "2025.9.8",
  "engine": "NOWEB",
  "tier": "PLUS",
  "browser": null
}

Steps

To Reproduce Steps to reproduce the behavior:

  1. Run WAHA Plus version 2025.9.8 (engine NOWEB).
  2. Send a POST request to /api/sendImage with a public image URL.
  3. Observe the error response "Media upload failed on all hosts".

Actual response

{
  "statusCode": 500,
  "timestamp": "2025-10-05T23:15:17.558Z",
  "exception": {
    "message": "Media upload failed on all hosts",
    "data": null,
    "isBoom": true,
    "isServer": true,
    "output": {},
    "name": "Error",
    "stack": "Error: Media upload failed on all hosts\n    at Object.upload ..."
  },
  "request": {
    "path": "/api/sendImage",
    "method": "POST",
    "body": {
      "chatId": "[email protected]",
      "file": {
        "mimetype": "image/png",
        "url": "https://example.domain.app/image_link/demo/repair_note.png",
        "filename": "note.png"
      },
      "caption": "Test sending image via API",
      "session": "demo_session_1"
    },
    "query": {}
  },
  "version": {
    "version": "2025.9.8",
    "engine": "NOWEB",
    "tier": "PLUS",
    "browser": null
  }
}

⚠️ Note: All data above (phone numbers, URLs, filenames, session names) have been anonymized and are not real.

patron:PLUS

yusoft-app avatar Oct 05 '25 23:10 yusoft-app

Hi! Could you check docker logs when it happens?

docker compose logs -f

and send /api/sendImage request?

patron:PRO

devlikepro avatar Oct 06 '25 09:10 devlikepro

also enable debug for that session

patron:PRO

devlikepro avatar Oct 06 '25 09:10 devlikepro

WAHA_LOG_LEVEL=debug env variable or in dashboard in session config

patron:PRO

devlikepro avatar Oct 06 '25 09:10 devlikepro

Hi! Could you check docker logs when it happens?

docker compose logs -f

and send /api/sendImage request?

patron:PRO

Hi, thanks for your quick response! 🙏

Unfortunately, I can’t perform detailed debugging immediately because my WAHA instance runs on a production server with several active clients. Enabling debug logs or reproducing the issue in real time could potentially interrupt ongoing sessions, so I need to wait for a low-traffic window (usually early morning UTC+7) before I can safely capture logs.

If possible, please also try reproducing this issue on your side — it happens consistently right after upgrading.

Here’s a quick summary of what I observed:

  • Upgraded from 2025.9.3 → 2025.9.8 → got the error:

Media upload failed on all hosts

  • Downgraded back to 2025.9.3, and everything worked fine again.
  • Tried upgrading again to 2025.9.8 the next day → same error appeared.
  • Downgraded again to 2025.9.3 (since versions 2025.9.5 – 2025.9.7 had another bug: every message was sent 3 times per request).
  • I didn’t test version 2025.9.4.

So the /api/sendImage issue seems specific to 2025.9.8, while the duplicate-sending issue occurred between 2025.9.5 and 2025.9.7.

Below is the actual API response when the issue occurs (with sensitive request data partially masked):

{
  "statusCode": 500,
  "timestamp": "2025-10-05T23:15:17.558Z",
  "exception": {
    "message": "Media upload failed on all hosts",
    "data": null,
    "isBoom": true,
    "isServer": true,
    "output": {},
    "name": "Error",
    "stack": "Error: Media upload failed on all hosts\n    at Object.upload (file:///app/node_modules/@adiwajshing/baileys/lib/Utils/messages-media.js:578:19)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n    at async file:///app/node_modules/@adiwajshing/baileys/lib/Utils/messages.js:146:28\n    at async Promise.all (index 0)\n    at async prepareWAMessageMedia (file:///app/node_modules/@adiwajshing/baileys/lib/Utils/messages.js:144:40)\n    at async generateWAMessageContent (file:///app/node_modules/@adiwajshing/baileys/lib/Utils/messages.js:467:13)\n    at async generateWAMessage (file:///app/node_modules/@adiwajshing/baileys/lib/Utils/messages.js:589:46)\n    at async Object.sendMessage (file:///app/node_modules/@adiwajshing/baileys/lib/Socket/messages-send.js:889:33)"
  },
  "request": {
    "path": "/api/sendImage",
    "method": "POST",
    "body": {
      "chatId": "[email protected]",
      "file": {
        "mimetype": "image/png",
        "url": "https://example.domain.app/image_link/.../repair_receipt_note.png",
        "filename": "note.png"
      },
      "caption": "Test send image",
      "session": "demo_session"
    },
    "query": {}
  },
  "version": {
    "version": "2025.9.8",
    "engine": "NOWEB",
    "tier": "PLUS",
    "browser": null
  }
}

⚠️ Note: Only the "request" data has been masked — other fields are kept intact in case you need file location references (e.g., @adiwajshing/baileys/...).

I’ll try to collect full debug logs during the next maintenance window and share them once available. Thanks again for looking into this! 🙌

patron:PLUS

yusoft-app avatar Oct 06 '25 09:10 yusoft-app

This is happening since update to the newest version on every instance: @devlikepro

Image

patron:PRO

motammi avatar Oct 06 '25 09:10 motammi

+1

huangzhong0406 avatar Oct 10 '25 07:10 huangzhong0406

Could you test 2025.10.1 🙏

patron:PRO

devlikepro avatar Oct 12 '25 12:10 devlikepro

Could you test 2025.10.1 🙏

Hi 👋 Yes, I’ve already tested version 2025.10.1 — unfortunately, the issue still persists. The /api/sendImage endpoint continues to fail with the same error (Media upload failed on all hosts).

I’ve created a new detailed bug report for this under post #1486, which includes the full API response, Docker logs, and environment details for version 2025.10.1.

Please check that issue for all updated information. 🙏

patron:PLUS

yusoft-app avatar Oct 12 '25 13:10 yusoft-app

Portuguese


Title:

Você poderia testar 2025.10.1 🙏

Olá 👋 Sim, já testei a versão 2025.10.1 — infelizmente, o problema ainda persiste. O endpoint /api/sendImage continua falhando com o mesmo erro (falha no upload de mídia em todos os hosts).

Criei um novo relatório de bug detalhado para isso na postagem nº 1486, que inclui a resposta completa da API, logs do Docker e detalhes do ambiente para a versão 2025.10.1.

Verifique esse problema para obter todas as informações atualizadas. 🙏

github-actions[bot] avatar Oct 12 '25 13:10 github-actions[bot]

Hi! Could you try to add this to env variable?

NODE_TLS_REJECT_UNAUTHORIZED=0

patron:PRO

devlikepro avatar Oct 13 '25 02:10 devlikepro

Portuguese


Title:

Oi! Você poderia tentar adicionar isso à variável env?

NODE_TLS_REJECT_UNAUTHORIZED=0

github-actions[bot] avatar Oct 13 '25 02:10 github-actions[bot]

Hi! Could you try to add this to env variable?

NODE_TLS_REJECT_UNAUTHORIZED=0

patron:PRO

Hi 👋

Thanks for your quick response. I’ve added the suggested environment variable to my WAHA configuration:

NODE_TLS_REJECT_UNAUTHORIZED=0

Unfortunately, the issue still persists — there’s no change in behavior. The /api/sendImage endpoint continues to fail with the same error:

{
  "statusCode": 500,
  "timestamp": "2025-10-13T03:47:32.614Z",
  "exception": {
    "message": "Media upload failed on all hosts",
    "data": null,
    "isBoom": true,
    "isServer": true,
    "output": {},
    "name": "Error",
    "stack": "Error: Media upload failed on all hosts\n    at Object.upload (file:///app/node_modules/@adiwajshing/baileys/lib/Utils/messages-media.js:578:19)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n    at async file:///app/node_modules/@adiwajshing/baileys/lib/Utils/messages.js:146:28\n    at async Promise.all (index 0)\n    at async prepareWAMessageMedia (file:///app/node_modules/@adiwajshing/baileys/lib/Utils/messages.js:144:40)\n    at async generateWAMessageContent (file:///app/node_modules/@adiwajshing/baileys/lib/Utils/messages.js:467:13)\n    at async generateWAMessage (file:///app/node_modules/@adiwajshing/baileys/lib/Utils/messages.js:589:46)\n    at async Object.sendMessage (file:///app/node_modules/@adiwajshing/baileys/lib/Socket/messages-send.js:893:33)"
  },
  "request": {
    "path": "/api/sendImage",
    "method": "POST",
    "body": {
      "chatId": "[email protected]",
      "file": {
        "mimetype": "image/jpeg",
        "url": "https://example.domain.app/image_link/demo/whatsapp_media/sample_image.jpg",
        "filename": "image.jpg"
      },
      "caption": "Test sending image with NODE_TLS_REJECT_UNAUTHORIZED=0",
      "session": "demo_session_1"
    },
    "query": {}
  },
  "version": {
    "version": "2025.10.1",
    "engine": "NOWEB",
    "tier": "PLUS",
    "browser": null
  }
}

⚠️ Note: Sensitive values like phone numbers and URLs have been sanitized for privacy, but the response structure and error trace remain unchanged.

At this point, it seems this issue is not related to TLS verification. Could you please confirm if there’s any specific dependency or module update in Baileys or NOWEB engine that could be affecting media upload handling?

Thanks again for your time and assistance 🙏

patron:PLUS

yusoft-app avatar Oct 13 '25 03:10 yusoft-app

Portuguese


Title:

Olá! Você poderia tentar adicionar isso à variável env?

NODE_TLS_REJECT_UNAUTHORIZED=0

![patrono:PRO](https://camo.githubusercontent.com/4f70c3a9ee2450c288faea5e1a1b7ebd0ffc1571450a59676b300ffb32b32537/68747470733a2f2f69 6d672e736869656c64732e696f2f62616467652f706174726f6e2d50524f2d313838613432)

Olá 👋

Obrigado pela sua resposta rápida. Adicionei a variável de ambiente sugerida à minha configuração WAHA:

NODE_TLS_REJECT_UNAUTHORIZED=0

Infelizmente, o problema ainda persiste — não há nenhuma mudança de comportamento. O endpoint /api/sendImage continua falhando com o mesmo erro:

{
  "statusCode": 500,
  "carimbo de data/hora": "2025-10-13T03:47:32.614Z",
  "exceção": {
    "message": "Falha no upload de mídia em todos os hosts",
    "dados": nulo,
    "isBoom": verdadeiro,
    "isServer": verdadeiro,
    "saída": {},
    "nome": "Erro",
    "stack": "Erro: falha no upload de mídia em todos os hosts\n em Object.upload (file:///app/node_modules/@adiwajshing/baileys/lib/Utils/messages-media.js:578:19)\n em process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n em arquivo assíncrono:///app/node_modules/@adiwajshing/baileys/lib/Utils/messages.js:146:28\n em async Promise.all (índice 0)\n em assíncrono prepareWAMessageMedia (file:///app/node_modules/@adiwajshing/baileys/lib/Utils/messages.js:144:40)\n em generateWAMessageContent assíncrono (file:///app/node_modules/@adiwajshing/baileys/lib/Utils/messages.js:467:13)\n    em assíncrono generateWAMessage (file:///app/node_modules/@adiwajshing/baileys/lib/Utils/messages.js:589:46)\n em async Object.sendMessage (arquivo:///app/node_modules/@adiwajshing/baileys/lib/Socket/messages-send.js:893:33)"
  },
  "solicitar": {
    "caminho": "/api/sendImage",
    "método": "POST",
    "corpo": {
      "chatId": "[email protected]",
      "arquivo": {
        "mimetype": "imagem/jpeg",
        "url": "https://example.domain.app/image_link/demo/whatsapp_media/sample_image.jpg",
        "nome do arquivo": "imagem.jpg"
      },
      "caption": "Teste o envio de imagem com NODE_TLS_REJECT_UNAUTHORIZED=0",
      "sessão": "demo_session_1"
    },
    "consulta": {}
  },
  "versão": {
    "versão": "2025.10.1",
    "motor": "NOWEB",
    "camada": "MAIS",
    "navegador": nulo
  }
}

⚠️ Observação: valores confidenciais, como números de telefone e URLs, foram limpos para fins de privacidade, mas a estrutura de resposta e o rastreamento de erros permanecem inalterados.

Neste ponto, parece que este problema não está relacionado à verificação TLS. Você poderia confirmar se há alguma dependência específica ou atualização de módulo no mecanismo Baileys ou NOWEB que possa estar afetando o processamento de upload de mídia?

Obrigado novamente pelo seu tempo e ajuda 🙏

github-actions[bot] avatar Oct 13 '25 03:10 github-actions[bot]

same bug in WEBJS "the image is now longer available" or "loading failed"

patron:PLUS

unclegharib-jpg avatar Oct 13 '25 04:10 unclegharib-jpg

Portuguese


Title:

mesmo bug em WEBJS "a imagem já está mais disponível" ou "falha ao carregar"

github-actions[bot] avatar Oct 13 '25 04:10 github-actions[bot]

Same big happening here.... Any solution?

patron:PLUS

jaderweb avatar Oct 14 '25 15:10 jaderweb

Portuguese


Title:

O mesmo grande acontecimento aqui... Alguma solução?

github-actions[bot] avatar Oct 14 '25 15:10 github-actions[bot]

Could you check docker logs when you send the image and search for any uploadResult or upload failed, reason string?

patron:PRO

devlikepro avatar Oct 15 '25 03:10 devlikepro

Portuguese


Title:

Você poderia verificar os logs do docker ao enviar a imagem e procurar por qualquer string uploadResult?

github-actions[bot] avatar Oct 15 '25 03:10 github-actions[bot]

Does it happen also after "logout/scan qr" code?

patron:PRO

devlikepro avatar Oct 15 '25 03:10 devlikepro