wa-automate-nodejs icon indicating copy to clipboard operation
wa-automate-nodejs copied to clipboard

Failed to load resource on sendImage

Open crescent1 opened this issue 2 years ago • 27 comments

Are you using the latest version of the library?

  • [X] I have checked and am using the latest version of the library.

What type of session are you experiencing this issue on?

Multi-device and I have set multiDevice to true in my config OR am using the --multi-device flag

What type of host account are you experiencing this issue on?

Personal account (normal)

Mode

My own code

Current Behavior

image failed to send (work fine on local development)

Expected Behavior

image sent successfully

Steps To Reproduce

client.sendImage( [email protected], https://drive.google.com/uc?id=19EXFscynB351dXfdPAL_PadPP0PeoH2R&export=download, basket.jpg, basket.jpg, null, false, false, false, false, false );

create() code OR full CLI command + CONFIG

create({
        sessionId: phone,
        useChrome: true,
        headless: true,
        authTimeout: 0, //set to 0 to wait forever for connection to phone
        qrTimeout: 0, //set to 0 to wait forever for a qr scan
        qrLogSkip: true,
        autoRefresh: true,
        restartOnCrash: start,
        sessionDataPath: './session',
        deleteSessionDataOnLogout: true,
        disableSpins: true,
        multiDevice: true,
        killClientOnLogout: true,
        logging: [
          {
            type: 'file',
            options: {
              filename: './logs/application-%DATE%.log',
            },
          },
        ]
      });

DEBUG INFO

{
  "WA_VERSION": "2.2245.9",
  "WA_AUTOMATE_VERSION": "4.51.1",
  "BROWSER_VERSION": "HeadlessChrome/107.0.5304.110",
  "START_TS": 1669358189291,
  "RAM_INFO": "Total: 2.07 GB | Free: 1.51 GB",
  "PPTR_VERSION": "15.0.0",
  "LATEST_VERSION": true,
  "CLI": false,
  "PATCH_HASH": "f69bc",
  "LAUNCH_TIME_MS": 42927,
  "ACC_TYPE": "PERSONAL",
  "chats": 106,
  "messages": 147,
  "contacts": 549,
  "isMd": true,
  "INSTANCE_ID": "cae36582-fe22-4eed-9c0e-82e61c77dc91"
}

Environment

- OS: Linux 5.15
- Node: 16.17.1
- npm: 8.19.3

Screenshots/Logs

info: Saved temporary file to /tmp/1m6a0qvwei.basket.jpg.jpeg {"timestamp":"2022-11-25T07:00:14.239Z"}
info: IN 0604e  {"_args":{"caption":"basket.jpg","file":"dn2isadk0","filename":"basket.jpg","hideTags":false,"ptt":false,"quotedMsgId":null,"to":"[email protected]","viewOnce":false,"waitForId":false,"withoutPreview":false},"_method":"sendImage","timestamp":"2022-11-25T07:00:14.258Z"}
info: Page Console: Failed to load resource: the server responded with a status of 404 () {"timestamp":"2022-11-25T07:00:14.594Z"}
info: IN 12e12  {"_args":{"content":"test","to":"[email protected]"},"_method":["sendSeen","sendMessage"],"timestamp":"2022-11-25T07:03:36.570Z"}
info: OUT 12e12: 131ms  {"res":"[email protected]_3EB0CD9E2A1890DD0656_out","timestamp":"2022-11-25T07:03:36.701Z"}
info: Saved temporary file to /tmp/221vlw8np6.IMG-20220722-WA0045.jpg.jpeg {"timestamp":"2022-11-25T07:03:55.287Z"}
info: IN 4f63a  {"_args":{"caption":"IMG-20220722-WA0045.jpg","file":"d1r3j4jak","filename":"IMG-20220722-WA0045.jpg","hideTags":false,"ptt":false,"quotedMsgId":null,"to":"[email protected]","viewOnce":false,"waitForId":false,"withoutPreview":false},"_method":"sendImage","timestamp":"2022-11-25T07:03:55.674Z"}
info: Page Console: Failed to load resource: the server responded with a status of 404 () {"timestamp":"2022-11-25T07:03:56.001Z"}
info: Saved temporary file to /tmp/1gmt8hadnp.IMG-20220722-WA0045.jpeg {"timestamp":"2022-11-25T07:08:39.070Z"}
info: IN df382  {"_args":{"caption":"IMG-20220722-WA0045","file":"dl20bynhv","filename":"IMG-20220722-WA0045","hideTags":false,"ptt":false,"quotedMsgId":null,"to":"[email protected]","viewOnce":false,"waitForId":false,"withoutPreview":false},"_method":"sendImage","timestamp":"2022-11-25T07:08:39.087Z"}
info: Page Console: Failed to load resource: the server responded with a status of 404 () {"timestamp":"2022-11-25T07:08:39.745Z"}

Anything else?

0|waapi  | Error: Evaluation failed: Error: MediaFileEmpty
0|waapi  |     at h.sendToChat (https://web.whatsapp.com/app.77ee8aa7a4c593101105.js:75:729330)
0|waapi  |     at pptr://__puppeteer_evaluation_script__:1:203630
0|waapi  |     at async window.<computed>.<computed> [as sendImage] (pptr://__puppeteer_evaluation_script__:1:200123)
0|waapi  |     at ExecutionContext._ExecutionContext_evaluate (/home/user/projects/waapi/node_modules/puppeteer/src/common/ExecutionContext.ts:306:13)
0|waapi  |     at runMicrotasks (<anonymous>)
0|waapi  |     at processTicksAndRejections (node:internal/process/task_queues:96:5)
0|waapi  |     at ExecutionContext.evaluate (/home/user/projects/waapi/node_modules/puppeteer/src/common/ExecutionContext.ts:150:12)

crescent1 avatar Nov 25 '22 07:11 crescent1