Skip to content

Still the dreaded Error reading SMB directory: Error: STATUS_INVALID_PARAMETER (0xC000000D) with smb2 nodejs #53

@junomax-decision-sciences

Description

I cant shake the error when using smb2 in its most basic form:
Error reading SMB directory: Error: STATUS_INVALID_PARAMETER (0xC000000D) : An invalid parameter was passed to a service or function.

I know this works because I can use the samba-client (smbclient) and connect, ls, etc... so the credentials works.

I am puzzled...

Here is the code. Thank you for any clue... (I hope this is a not a dead thread before it even starts...). Hope you can help.

const SMB2 = require('smb2');

// SMB2 Configuration
const smbConfig = {
share: "\\MY_IP\ShareName",
domain: "", // Leave empty if no domain
username: "user_hidden",
password: "password_hidden",
};

// Create SMB2 client
const smb2Client = new SMB2(smbConfig);

// Test directory path
const directoryPath = 'test_dir'; // Set to the directory path you want to test, empty for root -> empty does not work neither...

// Function to test SMB2 configuration
function testSmb2Config() {
console.log("Testing SMB2 Configuration...");

smb2Client.readdir(directoryPath, (err, files) => {
    if (err) {
        console.error('Error reading SMB directory:', err);
    } else {
        console.log('Directory content:', files);
    }
});

}

// Run the test
testSmb2Config();

pretty basic...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions