waha icon indicating copy to clipboard operation
waha copied to clipboard

[BUG][WEBJS] - Failed to Unzip File: End-of-Central-Directory Signature Not Found

Open Sabyrzhanuly opened this issue 1 year ago • 6 comments

Describe the bug

When attempting to unzip a ZIP file, the process fails with an error indicating that the file is either not a ZIP archive or is corrupted. This prevents the application from proceeding with further actions.

Version

Get the WAHA version by calling GET /api/version

{
  "version": "2024.11.11 ",
  "engine": "WEBJS",
  "tier": "PLUS"
}

Docker Logs

[/app/RemoteAuth-30309616.zip] End-of-central-directory signature not found.
Either this file is not a zipfile, or it constitutes one disk of a multi-part archive.
In the latter case, the central directory and zipfile comment will be found on the last disk(s) of this archive.

unzip: cannot find zipfile directory in one of /app/RemoteAuth-30309616.zip or /app/RemoteAuth-30309616.zip.zip,
and cannot find /app/RemoteAuth-30309616.zip.ZIP, period.

patron:PLUS

Sabyrzhanuly avatar Dec 02 '24 09:12 Sabyrzhanuly

Is there any solution to this problem? It has occurred more than once already and is very inconvenient. Please advise.

Currently, the version is as follows:

Engine: WEBJS Version: 2025.2.1

@devlikepro

patron:PLUS

Sabyrzhanuly avatar Feb 10 '25 07:02 Sabyrzhanuly

Exactly this error, right?

End-of-central-directory signature not found.

or may be a different one?

What infrsastructure do you have, any over-the-network disk by any chance? Or just regular dedicated VPS + docker? MongoDB or regular file system?

patron:PRO

devlikepro avatar Feb 10 '25 10:02 devlikepro

Exactly this error, right?

End-of-central-directory signature not found.

or may be a different one?

What infrsastructure do you have, any over-the-network disk by any chance? Or just regular dedicated VPS + docker? MongoDB or regular file system?

patron:PRO

Everything is standard. A regular VPS + Docker and MongoDB. Yes, that is indeed the error.

patron:PLUS

Sabyrzhanuly avatar Feb 10 '25 10:02 Sabyrzhanuly

  1. How many sessions do you have?
  2. Could you share some logs before the error, it should print the archive size, may be something we'll find there, not sure

May be try switching to postgresql for one session to see if it helps with the error. https://waha.devlike.pro/docs/how-to/storages/#sessions---postgresql

patron:PRO

devlikepro avatar Feb 10 '25 10:02 devlikepro

  1. How many sessions do you have?
  2. Could you share some logs before the error, it should print the archive size, may be something we'll find there, not sure

May be try switching to postgresql for one session to see if it helps with the error. https://waha.devlike.pro/docs/how-to/storages/#sessions---postgresql

patron:PRO

I don't have any logs; I need to check them in real time. I don't store all logs to save disk space. Which session storage is more reliable — local or PostgreSQL?

patron:PLUS

Sabyrzhanuly avatar Feb 10 '25 11:02 Sabyrzhanuly

local is the best option, it doesn't have to zip any files at all

patron:PRO

devlikepro avatar Feb 10 '25 12:02 devlikepro

@Sabyrzhanuly I'm facing the same issue. Did you manage to solve it?

patron:ADVANCED

KKshitiz avatar Aug 14 '25 15:08 KKshitiz

Hi, I often got the same issue. Mine is running under AKS, WAHA have been configured with persistent storage mounted at /app/.media, same as MongoDB that data persisted in Azure disk.

I'm using waha plus: waha-plus@sha256:1013784fe208e0dbbbdb0af78a6eb29898e3de7b863aa52754832fb2a4086368

-------------- current /app directory ----------------

root@waha-bf6cc4795-zzm6h:/app# ls -la
total 67876
drwxr-xr-x   1 root root     4096 Nov 18 04:53 .
drwxr-xr-x   1 root root     4096 Nov 18 04:47 ..
drwxrwxrwx   2 root root        0 Jan 21  2025 .media
drwxr-xr-x   3 root root     4096 Nov 18 05:03 .wwebjs_auth
-rw-r--r--   1 root root 25165824 Nov 18 05:03 RemoteAuth-default.zip
drwxr-xr-x   1 root root     4096 Sep  5 04:25 dist
-rwxr-xr-x   1 root root 44281968 Aug 30 11:27 gows
drwxr-xr-x 780 root root    28672 Sep  5 04:25 node_modules
-rw-rw-r--   1 root root     4849 Sep  5 04:24 package.json
root@waha-bf6cc4795-zzm6h:/app# du -hs .
1.5G    .
root@waha-bf6cc4795-zzm6h:/app# df -h .
Filesystem      Size  Used Avail Use% Mounted on
overlay         248G   73G  176G  30% /
root@waha-bf6cc4795-zzm6h:/app# df -h /app/.media/
Filesystem                                                                                Size  Used Avail Use% Mounted on
//f584310****.file.core.windows.net/pvc-b88d9f26-b335-41e2-a08d-d80a377f1025  100G  709M  100G   1% /app/.media
root@waha-bf6cc4795-zzm6h:/app#

----------- error log from WAHA pod ---------------

[05:00:27.780] INFO (WhatsappSession/42): session:default - Using cache type: 'none' {"session":"default"}
[05:00:27.784] INFO (WebJSMongoAuth/42): session:default - Checking if session exists... {"session":"default"}
[05:00:27.787] INFO (WebJSMongoAuth/42): session:default - Session exists: true {"session":"default"}
[05:00:27.787] INFO (WebJSMongoAuth/42): session:default - Extracting existing session... {"session":"default"}
[05:00:29.221] INFO (WebJSMongoAuth/42): session:default - Session has been extracted. {"session":"default"}
[05:00:29.229] ERROR (WhatsappSession/42): session:default - Command failed: unzip -q /app/RemoteAuth-default.zip -d /app/.wwebjs_auth/RemoteAuth-default
[/app/RemoteAuth-default.zip]
  End-of-central-directory signature not found.  Either this file is not
  a zipfile, or it constitutes one disk of a multi-part archive.  In the
  latter case the central directory and zipfile comment will be found on
  the last disk(s) of this archive.
unzip:  cannot find zipfile directory in one of /app/RemoteAuth-default.zip or
        /app/RemoteAuth-default.zip.zip, and cannot find /app/RemoteAuth-default.zip.ZIP, period.
 {"session":"default"}
    err: {
      "type": "Error",
      "message": "Command failed: unzip -q /app/RemoteAuth-default.zip -d /app/.wwebjs_auth/RemoteAuth-default\n[/app/RemoteAuth-default.zip]\n  End-of-central-directory signature not found.  Either this file is not\n  a zipfile, or it constitutes one disk of a multi-part archive.  In the\n  latter case the central directory and zipfile comment will be found on\n  the last disk(s) of this archive.\nunzip:  cannot find zipfile directory in one of /app/RemoteAuth-default.zip or\n        /app/RemoteAuth-default.zip.zip, and cannot find /app/RemoteAuth-default.zip.ZIP, period.\n",
      "stack":
          Error: Command failed: unzip -q /app/RemoteAuth-default.zip -d /app/.wwebjs_auth/RemoteAuth-default
          [/app/RemoteAuth-default.zip]
            End-of-central-directory signature not found.  Either this file is not
            a zipfile, or it constitutes one disk of a multi-part archive.  In the
            latter case the central directory and zipfile comment will be found on
            the last disk(s) of this archive.
          unzip:  cannot find zipfile directory in one of /app/RemoteAuth-default.zip or
                  /app/RemoteAuth-default.zip.zip, and cannot find /app/RemoteAuth-default.zip.ZIP, period.
              at genericNodeError (node:internal/errors:983:15)
              at wrappedFn (node:internal/errors:537:14)
              at ChildProcess.exithandler (node:child_process:414:12)
              at ChildProcess.emit (node:events:518:28)
              at maybeClose (node:internal/child_process:1101:16)
              at ChildProcess._handle.onexit (node:internal/child_process:304:5)
      "code": 9,
      "killed": false,
      "signal": null,
      "cmd": "unzip -q /app/RemoteAuth-default.zip -d /app/.wwebjs_auth/RemoteAuth-default",
      "stdout": "",
      "stderr": "[/app/RemoteAuth-default.zip]\n  End-of-central-directory signature not found.  Either this file is not\n  a zipfile, or it constitutes one disk of a multi-part archive.  In the\n  latter case the central directory and zipfile comment will be found on\n  the last disk(s) of this archive.\nunzip:  cannot find zipfile directory in one of /app/RemoteAuth-default.zip or\n        /app/RemoteAuth-default.zip.zip, and cannot find /app/RemoteAuth-default.zip.ZIP, period.\n"
    }
[05:00:29.230] INFO (WhatsappSession/42): session:default - Job scheduled with timeout 2000 ms {"session":"default","job":"start-engine","class":"SingleDelayedJobRunner"}
[05:00:41.242] ERROR (WhatsappSession/42): session:default - Failed to destroy whatsapp client {"session":"default"}
    err: {
      "type": "TypeError",
      "message": "Cannot read properties of null (reading 'close')",
      "stack":
          TypeError: Cannot read properties of null (reading 'close')
              at WebjsClientPlus.destroy (/app/node_modules/whatsapp-web.js/src/Client.js:792:31)
              at WebjsClientPlus.destroy (/app/dist/core/engines/webjs/WebjsClientCore.js:87:21)
              at WhatsappSessionWebJSPlus.end (/app/dist/core/engines/webjs/session.webjs.core.js:214:81)
              at async /app/dist/core/engines/webjs/session.webjs.core.js:110:13
    }

hattaiwat avatar Nov 18 '25 05:11 hattaiwat