Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
junomax-decision-sciences opened this issue Jan 27, 2024 · 1 comment

Comments

@junomax-decision-sciences

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...

@Jonexuan
Copy link

Have you solved this problem? I really want to know the answer,pls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants