-
Notifications
You must be signed in to change notification settings - Fork 227
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
TypeError: channelCredentials._equals is not a function #834
Comments
@davemason-ladbible thanks for the write up! Any chance you could provide us with a stack trace? |
@callmehiphop Sure, here you are:
|
Interesting, @murgatroid99 any thoughts on this? |
My best guess from that error is that a Client or Channel is being created with a bad |
Found the same when attempting to connect to the emulator. Latest version of both the emulator and this library. |
Found the same when attempting to create a new subscription wihtin the emulator. Topic creation is ok. Versions:
|
I'm going to put this on my list of stuff to retry shortly. I suspect some changes have happened to the emulator itself, because some of the problems I've tried to reproduce weren't happening for me. Also grpc-js has changed a lot. I see that some are using gRPC C++, though, so grpc-js updates wouldn't help with that. |
@feywind If the issue isn't resolved with the new version of grpc-js (and it's still an issue with the emulator) let's kick it to @kamalaboulhosn for guidance on ownership. |
I finally got a chance to try this out myself. I did have to make a few tweaks to make it works, so maybe this will help. This is my Dockerfile, based on the original, but with an updated openjdk:
This fixed a Java exception in the emulator for not finding the Duration class. This is the sample code: const PubSub = require('@google-cloud/pubsub').PubSub;
const pub = async (topicName, data) => {
const options = {
projectId: 'testproject',
apiEndpoint: 'localhost:8085'
};
const pubsub = new PubSub(options);
const stringifiedData = JSON.stringify(data);
const dataBuffer = await Buffer.from(stringifiedData);
const topicId = `projects/${options.projectId}/topics/${topicName}`;
const topic = pubsub.topic(topicId);
const exists = await topic.exists();
if (!exists[0]) {
await topic.create();
console.log('created topic');
}
let sub = pubsub.subscription('testsub');
const subExists = await sub.exists();
if (!subExists[0]) {
await topic.createSubscription('testsub');
console.log('created sub');
sub = topic.subscription('testsub');
}
const receivePromise = new Promise(r => {
sub.on('message', message => {
console.log('Message received', message.data.toString());
message.ack();
r();
});
});
const response = await topic.publish(dataBuffer);
console.log('Message published', response);
await receivePromise;
};
pub('testtopic2', { test: 'test' }).then(() => {
console.log('Exiting');
process.exit(0);
}).catch(e => {
console.error('Error', e);
}); This is the package.json: {
"name": "example",
"version": "1.0.0",
"description": "",
"dependencies": {
"@google-cloud/pubsub": "^2.0.0"
}
} And I'm getting this output:
So I think this has been fixed by subsequent grpc updates or other changes. @willianw Your subscriber issue might be fixed by updating the JDK in the Docker image? Please feel free to re-open if there are still problems! |
…googleapis#834) * Moving API reference snippets and renaming region tags to not conflict with documentation snippets * fix mismatched tags, fix mixed backups files * fix quickstart tag * linkenator fix
🤖 I have created a release \*beep\* \*boop\* --- ## [3.3.0](https://www.github.com/googleapis/nodejs-bigtable/compare/v3.2.0...v3.3.0) (2021-03-08) ### Features * add CMEK fields ([googleapis#845](https://www.github.com/googleapis/nodejs-bigtable/issues/845)) ([0381fb7](https://www.github.com/googleapis/nodejs-bigtable/commit/0381fb7da68492b85f8a3359d5fb97ca4898810e)) * introduce style enumeration ([googleapis#833](https://www.github.com/googleapis/nodejs-bigtable/issues/833)) ([99b7617](https://www.github.com/googleapis/nodejs-bigtable/commit/99b7617e215126fc36ef3c3ebefb244e0d8d2242)) * **protos:** update BigtableTableAdmin GetIamPolicy, change DeleteAppProfileRequest.ignore_warnings to REQUIRED ([59a0d26](https://www.github.com/googleapis/nodejs-bigtable/commit/59a0d269d5196991dd395e671d7d5f54ce449005)) ### Bug Fixes * **browser:** check for fetch on window ([googleapis#824](https://www.github.com/googleapis/nodejs-bigtable/issues/824)) ([a38cbcc](https://www.github.com/googleapis/nodejs-bigtable/commit/a38cbcca1660bc40fe137acb973bf62f3c55754e)) * Renaming region tags to not conflict with documentation snippets ([googleapis#834](https://www.github.com/googleapis/nodejs-bigtable/issues/834)) ([5d3e8f7](https://www.github.com/googleapis/nodejs-bigtable/commit/5d3e8f721c2a32a33bf41baa1ed237fb90f7cbd6)) * **retry:** restore grpc_service_config for CreateBackup and RestoreTable ([googleapis#851](https://www.github.com/googleapis/nodejs-bigtable/issues/851)) ([3ff2828](https://www.github.com/googleapis/nodejs-bigtable/commit/3ff282855f4f9a52a89bca8d087c1423e71bd7c6)) * set keepalive configuration ([googleapis#836](https://www.github.com/googleapis/nodejs-bigtable/issues/836)) ([8105dea](https://www.github.com/googleapis/nodejs-bigtable/commit/8105dea272de44e69915d3e62e5b5add106b54cb)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
This issue occurs on versions 1.1.2 and later.
When attempting to publish a message to the emulator, I'm getting the following error:
TypeError: channelCredentials._equals is not a function
Function to re-create error:
Dockerfile of emulator:
Environment details
@google-cloud/pubsub
version: 1.1.2+The text was updated successfully, but these errors were encountered: