How to fix runtime error: Invalid API key error - android-studio

I am using Firebase Console, when I try to register a user, I get the following error:
E/RegisterActivity: An internal error has occurred. [ API key not valid. Please pass a valid API key. ]
I/ViewRootImpl: dispatchDetachedFromWindow in doDie
W/libEGL: EGLNativeWindowType 0x7673a27350 disconnect failed
D/MouseWheelSynthesizer: mMoveStepInDp: 64, mMoveStepInPixel: 192, mUpTimeDelayed: 100
D/ViewRootImpl: ViewRootImpl mIsInProductivePCDisplay: false
D/InputEventReceiver: dispatchInputInterval 1000000
D/mali_winsys: EGLint new_window_surface(egl_winsys_display *, void *, EGLSurface, EGLConfig, egl_winsys_surface **, EGLBoolean) returns 0x3000
I/ViewRootImpl: dispatchDetachedFromWindow in doDie
W/libEGL: EGLNativeWindowType 0x7673a27350 disconnect failed
I have tried to clean the build and restart it. I also uninstalled and re-installed the app as well, but it still does not work.
How can I fix this?

Related

Node-RSA/node-asn1 error : Expected 0x30: got 0x37

I'm using NodeRSA to verify the signature of a given data thanks to a public key.
When I'm initiating NodeRSA, an error is thrown, which comes from a module used by NodeRSA : node-asn1.
The error is Expected 0x30: got 0x37.
I dove into the code and identified the exact line where the error occurred, but as I'm a newbie in crypto, I couldn't really find any solution.
var reader = new ber.Reader(buffer);
reader.readSequence();
var header = new ber.Reader(reader.readString(0x30, true));
I know some errors are expecting 0x2, which is the start of text. But I can't understand why we are expecting a 0 (0x30) and we've got a 7 (0x37) instead.
Would you have any solutions, or even ideas that I could dive into ?

Line number error does not show up when using MSSQL Node?

I have been using MySQL database with Nodejs for a while. I recently switched to MSSQL with Nodejs
When using a try catch block with Nodejs and Mysql any error with the query execution would give me the line at which the error occured
So while using MySQL I did:
try{
await pool.quer(`sql statement`)
}
catch(err){
console.log(err)
}
This would give me an error and the line number of error. But with node-mssql, I get:
{ RequestError: Incorrect syntax near 'Invalid'.
at StreamEvents.req.once.err (C:\Users\David\Main Web\node_modules\mssql\lib\msnodesqlv8\request.js:463:17)
at Object.onceWrapper (events.js:277:13)
at StreamEvents.emit (events.js:189:13)
at errors.forEach.err (C:\Users\David\Main Web\node_modules\msnodesqlv8\lib\reader.js:33:20)
at Array.forEach (<anonymous>)
at routeStatementError (C:\Users\David\Main Web\node_modules\msnodesqlv8\lib\reader.js:26:14)
at invokeObject.end (C:\Users\David\Main Web\node_modules\msnodesqlv8\lib\reader.js:258:13)
at freeStatement (C:\Users\David\Main Web\node_modules\msnodesqlv8\lib\driver.js:160:13)
at cppDriver.freeStatement (C:\Users\David\Main Web\node_modules\msnodesqlv8\lib\driver.js:150:11)
code: 'EREQUEST',
originalError:
{ Error: [Microsoft][SQL Server Native Client 11.0][SQL Server]Incorrect syntax near 'Invalid'. sqlstate: '42000', code: 102 },
name: 'RequestError',
number: 102,
state: undefined }
This is such an unhelpful error. I know where the error is coming from for this error because there is only one sql statement getting executed right now but as my program grows without knowing where the error is coming from it will be hard to debug. Is this an expected behavior of node-mssql?
If you see the documentation here, it clearly mentions what it return in error and what not.
It clearly mentions that "Those errors are initialized in node-mssql module and its original stack may be cropped. You can always access original error with err.originalError"
In your catch block you can try printing the stack trace. That should give you the line number where the error occurred. You can use one of the following statements:
console.stack("---TRACE---")
OR
var stackTrace = new Error().stack
console.log(stackTrace)

puppet migration: v3.8.5 -> v5.4.0 "Could not find template"

I'm migrating a from puppetmaster on Xenial (v3.8.5) to Bionic (v5.4.0) and have run into an issue. So far I've copied the node and modules files from the old server to the new and had a client connect. I keep getting the following error on the client and master:
Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Function Call, Could not find template 'ntp/client_ntp.conf.erb' (file: /etc/puppet/code/environments/production/manifests/modules/ntp/manifests/init.pp, line: 17, column: 20) on node owain18.dimerocker.com
The template file exists at: /etc/puppet/code/environments/production/manifests/modules/ntp/templates/client_ntp.conf.erb
The contents of ntp/manifests/init.pp:
class ntp {
package { "ntp": }
file { "/etc/ntp.conf":
mode => "644",
content => template("ntp/client_ntp.conf.erb"),
notify => Service["ntp"],
require => Package["ntp"],
} # file
service { "ntp":
ensure => running,
enable => true,
require => Package["ntp"],
} # service
} # class ntp
(I removed some comments from the top of the file so the line number in the error doesn't match, but there's no code missing.)
Any pointers on how to fix this issue? Thanks for your help.

List of Cassandra error codes

While using the datastax node.js driver I'm getting an exception code as documented under http://docs.datastax.com/en/developer/nodejs-driver-dse/1.4/api/module.errors/class.ResponseError/.
However I cannot find any documentation about all available exception codes. Anybody an idea where to find?
I'm not sure that the code values are specifically documented anywhere but you could always look at the ExceptionCode source for the version of Cassandra you are working with.
On trunk this lists the errors as:
SERVER_ERROR (0x0000),
PROTOCOL_ERROR (0x000A),
BAD_CREDENTIALS (0x0100),
// 1xx: problem during request execution
UNAVAILABLE (0x1000),
OVERLOADED (0x1001),
IS_BOOTSTRAPPING (0x1002),
TRUNCATE_ERROR (0x1003),
WRITE_TIMEOUT (0x1100),
READ_TIMEOUT (0x1200),
READ_FAILURE (0x1300),
FUNCTION_FAILURE (0x1400),
WRITE_FAILURE (0x1500),
CDC_WRITE_FAILURE (0x1600),
// 2xx: problem validating the request
SYNTAX_ERROR (0x2000),
UNAUTHORIZED (0x2100),
INVALID (0x2200),
CONFIG_ERROR (0x2300),
ALREADY_EXISTS (0x2400),
UNPREPARED (0x2500);
The response error codes are not properly documented in the driver, I've created a ticket for it: https://datastax-oss.atlassian.net/browse/NODEJS-418
In the meantime, you should be getting code completion on your IDE (VS Code / WebStorm) and/or look at the code:
const responseErrorCodes = {
serverError: 0x0000,
protocolError: 0x000A,
badCredentials: 0x0100,
unavailableException: 0x1000,
overloaded: 0x1001,
isBootstrapping: 0x1002,
truncateError: 0x1003,
writeTimeout: 0x1100,
readTimeout: 0x1200,
readFailure: 0x1300,
functionFailure: 0x1400,
writeFailure: 0x1500,
syntaxError: 0x2000,
unauthorized: 0x2100,
invalid: 0x2200,
configError: 0x2300,
alreadyExists: 0x2400,
unprepared: 0x2500
};
To check against a certain error code, you should use something like:
if (err.code === cassandra.types.responseErrorCodes.syntaxError) {
// ...
}

Error "Unable to get property 'normalize' of undefined or null reference" in require.js with text.js

I'm making my first attempt at using the text.js plugin (v2.0.12) for require.js (v2.1.15). I've had require working well up to this point, however, when I attempt to resolve a text dependency, I get two errors. The first error is Unable to get property 'normalize' of undefined or null reference [require.js, Line: 955] then, after the allotted time, I'll get a timeout error for the html file I'm attempting to load. The focus of this cry for help is the former error.
One curious observation I've noticed is that if I resolve the text module without declaring a file, there is no error. However, when I add the file path e.g. text!path/file, the error is triggered.
Additionally, I noticed that the load timeout error references the text module with _unnormalized2 appended. Not sure if that's to be expected but I thought is odd. Any help would be greatly appreciated!
Here's the block of code which errors:
//If current map is not normalized, wait for that
//normalized name to load instead of continuing.
if (this.map.unnormalized) {
//Normalize the ID if the plugin allows it.
if (plugin.normalize) { // error occurs here (line 955)
name = plugin.normalize(name, function (name) {
return normalize(name, parentName, true);
}) || '';
}
// ...
}
Ok, it turns out to have been a self-sabotage! I was creating a shortcut definition for the text module for which I left out the factory method. So, instead of
define('text', ['Scripts/text'], function(text) { return text; });
I had:
define('text', ['Scripts/text']);
Nothing to do with text.js whatsoever.

Resources