"bulkNote request failed with Proton code 65561" by creating a document - javascript

im currently doing the quick-start of domino-db and when i tried to create a document i got an internal error with the error message "bulkNote request failed with Proton code 65561".
Do you know what the problem is and is it possible to check some logs of proton to see what went wrong.
const serverConfig = {
hostName : 'XXXXXXX.de', // Host name of and port are valid
connection: {
port: 'XXXX',
},
};
const databaseConfig = {
filePath: 'node-demo.nsf', // The database file name
};
useServer(serverConfig)
.then((server) => server.useDatabase(databaseConfig))
.then((database) => database.createDocument({
document: {
Form: 'Contact',
FirstName: 'Aaron',
LastName: 'Aardman',
City: 'Arlington',
State: 'MA',
},
}))
.catch(console.error);
edit:
The error appears every time i access a document(document.read, bulkReadDocuments) not only by the creation of a document.

Here's the definition of that error code (from errorcodes.js):
65561: { id: 'INVALID_SQN', msg: 'Invalid or missing protocol sequence number.' },
This suggests you are using the Beta version of domino-db with the latest release of Proton. Proton now checks the protocol sequence number for every request -- to make sure it's not an incompatible request from a newer client. The Beta version of domino-db did not send the sequence number.
Please check your app and make sure it's using the latest version of domino-db.

Related

My Android device cannot retrieve the internal credential

After I succeeded to make 'platform' credential, I tried to retrieve the credential to get the assertion.
but when I passed the credentialRequestOptions as below
const publicKeyCredentialRequestOptions = {
challenge: Uint8Array.from(challengeFromServer, (c) => c.charCodeAt(0)),
allowCredentials: [
{
transports: ["internal"],
type: "public-key",
id: Uint8Array.from(credentialId, (c) => c.charCodeAt(0))
}
],
timeout: 60000,
userVerification: "required",
rpId: rpId
}
the userVerification pop-up, finger-print verification, appeared as normal
but after I fulfilled it, I got "The operation either timed out or was not allowed" exception.
when I remove the tansports: ["internal"] option in allowCredential, my device asked me "choose the secure key from BlueTooth, NFC or USB"
it seems my device does not support 'internal' credential.
Testing Env
Device : SM-N971N(Galaxy Note10)
OS : Android12
Browser : Chrome 107.0.5304.91
The most likely cause is that the credential ID is incorrect. Try logging it with console.log() immediately after registration, and immediately before making the assertion to ensure that there's no an encoding issue.

How to use credentials to work with nodegit.push on Windows

Edit: I'm changing the question to suit my current understanding of the problem which has changed significantly.
Original Title: Nodegit seems to be asking for wrong credentials on push
When trying to push using nodegit nothing seems to work on Windows (while they work fine on Linux).
Using SSH
sshKeyFromAgent - error authenticating: failed connecting agent
sshKeyNew - credentials callback is repeatedly (looks like an infinite loop
but I can't be sure)
sshKeyMemoryNew: credentials is called twice and then node exits with no diagnostic (the exit and beforeExit events on process aren't signalled)
Using HTTPS
userpassPlaintextNew: [Error: unknown certificate check failure] errno: -17
Original question follows.
I'm trying to get nodegit to push and the following question seems to address this situation. However I'm not able to get it to work.
I've cloned a repository using SSH and when I try to push, my credentials callback is being called with user git and not motti (which is the actual git user).
try {
const remote = await repository.getRemote("origin");
await remote.push(["refs/head/master:refs/heads/master"], {
callbacks: {
credentials: (url, user) => {
console.log(`Push asked for credentials for '${user}' on ${url}`);
return git.Cred.sshKeyFromAgent(user);
}
}
});
}
catch(err) {
console.log("Error:", err);
}
I get the following output:
Push asked for credentials for 'git' on git#github.[redacted].net:motti/tmp.git
Error: { Error: error authenticating: failed connecting agent errno: -1, errorFunction: 'Remote.push' }
If I try to hardcode motti to the sshKeyFromAgent function the error changes to:
Error: { Error: username does not match previous request errno: -1, errorFunction: 'Remote.push' }
This my first time trying to programmatically use git so I may be missing something basic...
Answer for some questions from comments:
I'm running on windows 10
node v8.9.4
git version 2.15.0.windows.1
nodegit version 0.24.1
the user running node is my primary user which when I use for git in command line works correctly
Instead of using git.Cred.sshKeyFromAgent - you could use git.Cred.sshKeyNew and pass your username / keys along.
const fs = require('fs');
// ...
const username = "git";
const publickey = fs.readFileSync("PATH TO PUBLIC KEY").toString();
const privatekey = fs.readFileSync("PATH TO PRIVATE KEY").toString();
const passphrase = "YOUR PASSPHRASE IF THE KEY HAS ONE";
const cred = await Git.Cred.sshKeyMemoryNew(username, publickey, privatekey, passphrase);
const remote = await repository.getRemote("origin");
await remote.push(["refs/head/master:refs/heads/master"], {
callbacks: {
credentials: (url, user) => cred
}
});
You need to run an ssh agent locally and save your password there. Follow these steps to make it work:
Enable the ssh agent locally (automatically runs on OS X): https://code.visualstudio.com/docs/remote/troubleshooting#_setting-up-the-ssh-agent
Run 'ssh-add' in the same CLI as you're running your nodegit actions and enter your passphrase
I hope this helps because I also struggled a lot with it and it can be very frustrating.

Node JS VPN connect to endpoint

I hope you can help!
I have setup and Amazon echo applcation, the application makes a request to and AWS EC2 instance and gets JSON data as a response, this is working as expected however the use case for the final application is to connect to a private IP sending paramaters to an API to return the same JSON DATA.
for many reasons sadly I cannot share any of the endpoint information.
I need my NODE.js Application to make a request to the private IP over a VPN connection, Im currently using OPENVPN to make local requests to the endpoint.
I have looked at node packages to see if this is possible but I cannot seem to find one, except for this package here
https://www.npmjs.com/package/node-openvpn
This package is has a dependancy thats fails to download, so i got the node_module manually but Im getting an error when i try to execute the code
var openvpnmanager = require('node-openvpn');
var opts = {
host: 'xx.xx.xx.xx', // normally '127.0.0.1', will default to if undefined
port: 443, //port openvpn management console
timeout: 1500, //timeout for connection - optional, will default to 1500ms if undefined
logpath: 'log.txt' //optional write openvpn console output to file, can be relative path or absolute
};
var auth = {
user: '*******',
pass: '*******',
};
var openvpn = openvpnmanager.connect(opts)
openvpn.on('connected', function() { //will be emited on successful interfacing with openvpn instance
openvpnmanager.authorize(auth);
});
openvpn.on('console-output', function(output) { //emits console output of openvpn instance as a line
console.log(output)
});
openvpn.on('state-change', function(state) { //emits console output of openvpn state as a array
console.log(output)
});
// openvpnmanager.getLog(console.log) //get all console logs up to this point
// and finally when/if you want to
// openvpnmanager.disconnect();
openvpn.on('disconnected', function() { //emits on disconnect
openvpnmanager.destroy() //finally destroy the disconnected manager
});
this just gives me an error
Unhandled rejection TypeError: Cannot read property 'writable' of undefined
at Telnet.exec (C:\Users\user\Desktop\alexa- po\node_modules\node-openvpn\node_modules\telnet-client\lib\telnet- client.js:90:24)
If anybody has any suggetions on how to make this possible I would be very grateful.

Configuring mqttConnect Options in Meteor for CloudMQTT

I'm trying to use the Meteor package perak:meteor-mqtt-collection to connect to CloudMQTT, but am unsure about how to interpret the syntax for the mqttConnect function:
Collection.mqttConnect(uri, topics, options, mqttOptions)
"where mqttOptions is an object that is supplied to mqtt.connect([url],options) in the MQTT.js library for configuring the underlying options of the MQTT.js-client. See the docs."
So far my Meteor test-code looks like this:
Goals = new Meteor.Collection('dbGoals');
if (Meteor.isClient) {
Goals.insert({
topic: "goals",
message: "Hello world from Meteor Web Client",
broadcast: true
});
}
if (Meteor.isServer) {
Meteor.startup(function () {
Goals.mqttConnect("m10.cloudmqtt.com", ["goals"], {
insert: true,
raw: true
},
{ servers: [{ host: 'm10.cloudmqtt.com', port: 12310 }],
clientId:"uniqueIdforEachMqttClient",
username: "myMqttUserName",
password: "myMqttUserPass",
clean:false
});
And gets the following error:
C:\Users\user\AppData\Local\.meteor\packages\meteor-tool\1.1.10\mt-os.windows.x86_32\dev_bundle\server-lib\node_modules\fibers\future.js:245
throw(ex);
^
TypeError: Cannot call method 'replace' of null
at Object.connect (C:\Users\user\AppData\Local\.meteor\packages\perak_mqtt-collection\1.0.4\npm\node_modules\mqtt\lib\connect\index.js:62:35)
at [object Object].Mongo.Collection.mqttConnect (packages/perak_mqtt-collection/packages/perak_mqtt-collection.js:37:1)
at E:\Data\Projects\Project2016\design\sw\mqttColl\.meteor\local\build\programs\server\boot.js:249:5
at mqttColl.js:25:11
=> Exited with code: 8
=> Your application is crashing.
The line mqttColl.js:25:11 is:
Goals.mqttConnect("m10.cloudmqtt.com", "goals", {
I know the object with my servers: options works with MQTT.js running on Node and CloudMQTT, but I'm not sure that I've got the mqttConnect() function parameters entered correctly for the perak Meteor package. For starters, it seems unlikely that the MQTT broker's URL would be needed in multiple places nor that the topic goals should be in brackets, but I'm just not clear on the parameter syntax.
Any suggestions?
You should add protocol into the URL: mqtt://m10.cloudmqtt.com.

Cannot get gitHub API to work in javascript. Specifically gitdata.getCommit

var GitHubApi = require("github");
var github = new GitHubApi({
// required
version: "3.0.0",
// optional
debug: true,
protocol: "https",
host: "github.com",
//pathPrefix: "/joyent/node", // for some GHEs
timeout: 5000
});
github.gitdata.getCommit({
user: "bnoordhuis",
repo: "/joyent/node",
sha: "c30cc4e3a5ead3ca5b48e8eec445740775888ed8"
}, function(err, res) {
console.log(JSON.stringify(res));
});
I posted the code above. I found a random branch in github for testing. I also found a random user as well as that user's commit randomly. I read information about the API here: http://mikedeboer.github.io/node-github/#gitdata.prototype.getCommit
When I run the code above, I get error code 404, null bnoordhuis
undefined
Any help would be awesome! I am a noob to using github api.
Here is the repo I am trying to use: https://github.com/joyent/node/
Your repository should just be 'node'. Joyent is the user.

Categories

Resources