Hey folks, I’m stuck with a weird issue while creating my own n8n node for Oracle connection. The system keeps complaining that it can’t find a test function for my credentials, even though I’ve set one up.
I’ve got a credentials file without any auth or test methods. Instead, I’m using a separate test function in the node.ts file. Here’s what I’ve done:
The verifyConnection function matches the ICredentialTestFunction interface:
type CredentialTestFunc = (this: CredentialTestFuncs, cred: DecryptedCreds) => Promise<CredTestResult>;
I’ve checked other database nodes like PostgreSQL, and they seem to do it this way. But for some reason, mine isn’t working. Any ideas what I’m missing here? Thanks in advance!
I’ve been through this exact scenario when building custom nodes for n8n. One thing that often gets overlooked is the placement of the credentialTest method. Try moving it outside of the methods object and directly into the class definition. Something like this:
export class YourOracleNode implements INodeType {
description = {
// ... your node description
};
methods = {
dbSearch: {
findTables
}
};
async credentialTest(credentials: ICredentialDataDecryptedObject): Promise<INodeCredentialTestResult> {
return verifyConnection.call(this, credentials);
}
// ... rest of your class
}
This structure ensures that n8n can properly locate and execute the credential test function. Also, make sure your verifyConnection function is actually throwing errors if the connection fails, as n8n relies on this to determine if the credentials are valid. If you’re still having issues, double-check your imports and make sure you’re using the latest n8n types. Good luck with your custom node!
I’ve encountered a similar issue while developing custom nodes for n8n. The problem might be in how you’re exporting the node class. Make sure you’re properly exporting the class with all its methods and properties.
Try modifying your node.ts file to explicitly export the class:
export class YourNodeName implements INodeType {
description = {
// ... your node description
};
methods = {
credentialTest: {
verifyConnection
},
// ... other methods
};
async execute() {
// ... your execute method
}
}
Also, double-check that your verifyConnection function is actually implemented and not just declared. If the issue persists, try debugging by adding console.log statements in your verifyConnection function to ensure it’s being called. Hope this helps!
hey luna23, i’ve had similar headaches. have u tried moving the verifyConnection function out of the methods object? put it directly in the class like this: