pedroslopez / whatsapp-web.js

A WhatsApp client library for NodeJS that connects through the WhatsApp Web browser app
https://wwebjs.dev
Apache License 2.0
15.21k stars 3.63k forks source link

Could not create directory /wweb/sessions/cache/session-479717: Read-only file system (30) #3095

Closed alexduca closed 3 months ago

alexduca commented 3 months ago

Is there an existing issue for this?

Describe the bug

I have a server.js file that manages my whatsapp sessions by starting and closing a dedicated terminal (running a app.js file) based on active/deactivated sessions. This all works and also manages the creation of directories. When I activate a session, a 6-digit numeric id is generated that is used to identify the session and from the main /wweb/sessions folder, the following directories are created: /wweb/sessions/479717 for project files (this folder is deleted when you turn off the session) /wweb/sessions/cache/session-479717 to save the session with LocalAuth()

The problem is really in the LocalAuth() function that gives this error when it has to save the session:

/wweb/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:241
            reject(new Error([
                   ^

Error: Failed to launch the browser process!
[0611/131646.235572:ERROR:command_line_handler.cc(137)] Could not create directory /wweb/sessions/cache/session-479717: Read-only file system (30)

This is my client:

const client = new Client({
    puppeteer: {
        executablePath: '/usr/bin/chromium-browser',
        headless: true,
        ignoreHTTPSErrors: true,
        args: [
            "--window-size=1300,1000",
            "--disable-notifications",
            "--disable-gpu",
            "--disable-setuid-sandbox",
            "--force-device-scale-factor",
            "--ignore-certificate-errors",
            "--no-sandbox",
        ],
        defaultViewport: { width:1300, height:1000 }
    },
    webVersion: '2.2412.54v2',
    webVersionCache: {
        type: 'remote',
        remotePath: 'https://raw.githubusercontent.com/guigo613/alternative-wa-version/main/html/2.2412.54v2.html'
    },
    authStrategy: new LocalAuth({ clientId: '479717', dataPath: '/wweb/sessions/cache' })
});

I would like to understand where I am going wrong... I have already tried giving privileges to the local account alberto with the following commands: sudo chmod -R 777 /wweb/sessions sudo chown -R alberto:alberto /wweb/sessions

Expected behavior

I would like to resolve this error and for the QR Code to come up for me to connect to Whatsapp Web as expected. I specify that if I disable authentication in the configuration everything works fine.

Steps to Reproduce the Bug or Issue

  1. Running my server.js file (this is always running)
  2. That is auto launching an app.js file in a dedicated terminal
  3. All this process is working
  4. Now I need the WhatsappWeb QRCode
  5. But I get the showed error
  6. I'm not happy

Relevant Code

sudo please don't ignore me

Browser Type

Chromium

WhatsApp Account Type

Standard

Does your WhatsApp account have multidevice enabled?

Yes, I am using Multi Device

Environment

"os": "Ubuntu 22.04.1 LTS",
"nodejs": "v18.20.2",
"npm": "v10.5.0",
"dependencies":` {
    "chalk": "^5.2.0",
    "colors": "^1.4.0",
    "files": "^2.2.2",
    "image-downloader": "^4.3.0",
    "ip": "^1.1.8",
    "mysql": "^2.18.1",
    "node-emoji": "^1.11.0",
    "path": "^0.12.7",
    "qr-image": "^3.2.0",
    "qrcode-terminal": "^0.12.0",
    "util": "^0.12.5",
    "whatsapp-web.js": "^1.19.5"
  }

Additional context

Question: if by “Does your WhatsApp account have multidevice enabled?” you mean multiple devices on a single script then my answer is “NO”... if, on the other hand, you mean that my account connected to the project is also associated with other devices then my answer is “YES”

alechkos commented 3 months ago

1621

alexduca commented 3 months ago

come on! i have been working so hard to find this problem, i try with documentations, i try to search online problems, i wrote on Discord with a ticket and in the general and hoped to receive a notification with a lead for a solution and i get this... the web is big, it is not easy to search... probably the problem is me...