Hey folks, I’m having trouble with my custom Oracle node for n8n. The credential testing isn’t working as expected.
My setup:
- Credentials file: No auth or test methods
- Node.ts file: Has a separate testing function
- Credentials config:
credentials: [{
name: 'myConnection',
required: true,
testedBy: 'testConnection'
}],
methods = {
listSearch: { searchTables },
credentialTest: { testConnection }
};
The testConnection function follows the ICredentialTestFunction interface.
But when I try to test, it says there’s no test function for the credentials. I’ve checked other nodes like MySQL, and they seem to do it similarly. What am I missing here? Any ideas on how to fix this?
I’ve run into this problem before with custom nodes. One thing that helped me was ensuring the testConnection function is properly async. Sometimes n8n doesn’t recognize non-async test functions correctly.
Also, double-check that your credentials file is properly linked in your main node file. I once spent hours debugging only to realize I forgot to import the credentials properly.
Another tip: try logging the methods object to the console when the node loads. This can help you verify if the testConnection function is actually present in the methods object at runtime.
If all else fails, you might want to try implementing the test method directly in the credentials file instead of the separate function. While not ideal, it’s a workaround that’s worked for me in the past when dealing with stubborn credential testing issues.
I’ve encountered similar issues when working with custom nodes. One thing to check is the file structure and imports. Ensure that your testConnection function is properly imported into the main node file where you’re defining the credentials and methods.
Also, verify that the ‘credentialTest’ property in your methods object is correctly referencing the testConnection function. Sometimes, a mismatch here can cause the test function not to be recognized.
If those look good, you might want to double-check your n8n version. Some older versions had quirks with custom credential tests. Updating to the latest stable release could potentially resolve the issue if nothing else works.
hey ethan, sounds like a tricky one! have you double-checked that your testConnection function is actually exported from the file? sometimes i forget to do that and it causes similar issues. also, make sure the function name in ‘testedBy’ matches exactly with your method name. hope this helps, good luck!