I've been having problem after problem with getting Behat to work with Zombie.js. The problem I've got now is actually within the Zombie.js module (before, the errors were in the link between the two).
The error looks like so.
[RuntimeException]
Server process has been terminated: (8) [
url.js:107
throw new TypeError("Parameter 'url' must be a string, not " + typeof url)
^
TypeError: Parameter 'url' must be a string, not undefined
at Url.parse (url.js:107:11)
at urlParse (url.js:101:5)
at Object.urlResolve [as resolve] (url.js:405:10)
at History._resolve (/Users/nathanielh/www/website/node_modules/zombie/lib/zombie/history.coffee:201:20)
at History._assign (/Users/nathanielh/www/website/node_modules/zombie/lib/zombie/history.coffee:209:18)
at /Users/nathanielh/www/website/node_modules/zombie/lib/zombie/browser.coffee:326:30
at Browser.withOptions (/Users/nathanielh/www/website/node_modules/zombie/lib/zombie/browser.coffee:105:14)
at Browser.visit (/Users/nathanielh/www/website/node_modules/zombie/lib/zombie/browser.coffee:320:12)
at Socket.eval (eval at <anonymous> (/private/var/folders/fv/fp4xrfnx7kzfq2bqzywq5p9w00010f/T/mink_nodejs_serverSZBH0W:43:10), <anonymous>:2:9)
at Socket.<anonymous> (/private/var/folders/fv/fp4xrfnx7kzfq2bqzywq5p9w00010f/T/mink_nodejs_serverSZBH0W:43:5)
]
I've found that in history.coffee, the resolve function is trying to use an array element that doesn't exist.
// history.coffee
_resolve: (url)->
if url
return URL.resolve(#_stack[#_index]?.url, url)
else # Yes, this could happen
return #_stack[#_index]?.url
That reference to #_stack[#_index] resolves to undefined, which is then being passed into URL.resolve, which is then causing the error.
Any idea why this would happen?
Update
I've noticed that #_stack is empty, and #_index is -1. This shouldn't be possible, right?
The zombie driver breaks with node version 0.8.24 (0.8.23 works ok). I believe this is due to the change:
2013.06.04, Version 0.8.24 (maintenance), c1a1ab067721ea17ef7b05ec5c68b01321017f05
* url: Properly parse certain oddly formed urls (isaacs)
A similar change (made on the same day) appears to have been made in 0.10.10 (although I've not studied the commits directly).
2013.06.04, Version 0.10.10 (Stable), 25e51c396aa23018603baae2b1d9390f5d9db496
* url: Properly parse certain oddly formed urls (isaacs)
I would recommend reverting to 0.8.23 or 0.10.9 in order to get this working. If you're not already using it I recommend nvm to manage your node installations.
Same issue when trying to simulate a $nodeElement->mouseOver() with Mink/Behat/Symfony2.1
TypeError: Parameter 'url' must be a string, not object
at Url.parse (url.js:107:11)
at urlParse (url.js:101:5)
at Object.urlResolve [as resolve] (url.js:405:10)
at Object.iframe.setAttribute (/usr/lib/node_modules/zombie/lib/zombie/jsdom_patches.js:164:43)
at attrCopy (/usr/lib/node_modules/zombie/node_modules/jsdom/lib/jsdom/level1/core.js:331:14)
at Object.core.Node.cloneNode (/usr/lib/node_modules/zombie/node_modules/jsdom/lib/jsdom/level1/core.js:636:18)
at Object.core.Node.cloneNode (/usr/lib/node_modules/zombie/node_modules/jsdom/lib/jsdom/level1/core.js:706:37)
at Function.jQuery.extend.clone (/js/2225e47_jquery-1.8.2_2.js:6222:17)
at Function.jQuery.extend.parseHTML (/js/2225e47_jquery-1.8.2_2.js:501:31)
at jQuery.fn.jQuery.init (/js/2225e47_jquery-1.8.2_2.js:131:24)
at jQuery (/js/2225e47_jquery-1.8.2_2.js:44:10)
in /js/45a7194_jquery.jqModal_9.js
Node version is v0.10.15. Still digging for answers.
Related
it's two days that I am having a problem hooking and calling getPackageInfo using Frida.
I have wrote this code:
Java.perform(()=>{
const jPM=Java.use('android.app.ApplicationPackageManager');
const getPkgInfo=jPM.getPackageInfo.overload('java.lang.String','int');
getPkgInfo.implementation=(pname,f)=>{
console.log("Called => getPackageInfo (Flag="+f+", Pkg="+pname+")");
return getPkgInfo(this,pname,f);
}
});
At the line that calls getPkgInfo (return getPkgInfo(this,pname,f);) i get this error:
Called => getPackageInfo (Flag=0, Pkg=test.app)
{"type":"error","description":"TypeError: cannot read property '$getHandle' of undefined","stack":"TypeError: cannot read property '$getHandle' of undefined
at value (frida/node_modules/frida-java-bridge/lib/class-factory.js:1052)
at e (frida/node_modules/frida-java-bridge/lib/class-factory.js:585)
at <anonymous> (/script.js:42)
at apply (native)
at ne (frida/node_modules/frida-java-bridge/lib/class-factory.js:619)
at <anonymous> (frida/node_modules/frida-java-bridge/lib/class-factory.js:597)","fileName":"frida/node_modules/frida-java-bridge/lib/class-factory.js","lineNumber":1052,"columnNumber":1}
So the method is hooked, because i can see the Called => getPackageInfo (Flag=0, Pkg=test.app) string, but i can't call the original method.
This happens only when i try hooking methods that are normally called using the abstract variant (in this case android.content.pm.PackageManager.getPackageInfo, but i have also tried hooking getPackageManager).
I have made different versions of this code, for example one that calls the function in this way: this.getPackageInfo.overload('java.lang.String','int').call(this,pname,f); and i get an error saying that "this" is undefined, so i think that it is the problem.
I have tried this script on different apps and devices but i always get the same result.
I am using Frida Inject.
Please help me.
The errors
Unknown argument type '_Bool' in method -[EAzureBlobStorageFile configure:key:container:token:]. Extend RCTConvert to support this type.
Exception '*** -[__NSArrayM objectAtIndexedSubscript:]: index 3 beyond bounds [0 .. 2]' was thrown while invoking configure on target EAzureBlobStorageFile with params
and the fix of adding RCTReadString(input, "__attribute__((__unused__))") || does not apply as it was already corrected on the version im using, im working on iOS by the way
"react-native": "0.66.4"
"react-native-azure-blob-storage": "^2.0.3",
One of the workaround you can follow to resolve the above issue;
Based on the GitHub issue is the fix is to add the below code(by opening myproject /node_modules/react-native/React/Base/RCTModuleMethod.mm. ) with the upgraded version of react-native and react-native-azure-blob-storage .
Code:-
static BOOL RCTParseUnused(const char **input)
{
return RCTReadString(input, "__attribute__((unused))") ||
RCTReadString(input, "__attribute__((__unused__))") ||
RCTReadString(input, "__unused");
}
For more information please refer the below links:-
Similar SO THREAD .
Github solution|XCode 11 Beta App Launch Crash .
Lately we have been getting a lot of javascript errors "can't redefine non-configurable property "userAgent"".
We don't attempt to redefine userAgent in our code. We barely even reference userAgent. The only places would be in code like the following:
var browser_msie = (navigator.userAgent.match(/msie/i) || navigator.userAgent.match(/trident/i)) ? true : false;
I am wondering if this error is rather coming from some bad browser behavior. It only started showing up recently.
Last evening we got over 20,000 of such error messages, and all from the same member of our service.
EDIT
The error information is as follows:
Error Message:
Message: TypeError: can't redefine non-configurable property "userAgent"
URL: https://www.rephunter.net/member-home.php
Line:1
Column:130
Stack:#https://www.rephunter.net/member-home.php:1:130
Error Traceback:
#0 Called backtrace in file /var/www/rephunter/www/webroot/include/error-handler-inc.php as line #68
#1 Called error_handler in file as line #
#2 Called trigger_error in file /var/www/rephunter/www/webroot/ajax/javascript-error.php as line #14
Unfortunately this offers no help, as line 1 of the page is just <!DOCTYPE html>. I don't see how to get to that part of the code. Of course if that were possible it might be easy to see the cause of the issue.
I recall in the past the Dev Tools might have given a "spiders view" of the page, but now I only see the DOM on the Elements tab, and Sources. Both of these are formatted and their is no way to see what "line 1 char 130" means.
Error:
TypeError: Cannot convert "null" to int.
function play(connection, message){
var server = servers[message.guild.id];
server.dispatcher = connection.play(ytdl(server.queue[0], {filter: "audioonly"}));
server.queue.shift();
server.dispatcher.on("end", function(){
if(server.queue[0]){
play(connection, message);
}else {
connection.disconnect();
}
})
}
The error message I'm getting from the tester is:
TypeError: Cannot convert "null" to int
TypeError: Cannot convert "null" to int
Error: "abort(TypeError: Cannot convert "null" to int). Build with -s ASSERTIONS=1 for more info."
at (anonymous) (file:///c:/Users/pc/Documents/Discord%20Bot/node_modules/opusscript/build/opusscript_native_wasm.js:8:1741)
at emit (events.js:311:19)
I'm begging you, please help me.
Thanks.
I may have a solution for your problem!
UPDATE:
Following this answer and my bug report, prism-media released a fixed version. Thank you for such a quick solution! Keeping the text below just as a reference.
TL;DR
Find Opus.js in node_modules folder and go to line 55. You should see the following:
return this.encoder.encode(buffer, Opus.name === 'opusscript' ? null : this._options.frameSize);
CHANGE IT TO:
return this.encoder.encode(buffer, this._options.frameSize);
Then delete the same part at line 59.
Explanation
The exception is thrown in toWireType in opusscript_native_wasm.js which expects its second argument to be an int, but it gets a null. Hence, the exception.
Tracing it back, toWireType is called by OpusScriptHandler.encode for all its arguments.
Those four arguments come from OpusScript.prototype.encode in opusscript.js:69. The last argument causing the trouble (being null) is `frameSize.
The encode function is called from Opus.js:55 in prism-media which is a different module.
return this.encoder.encode(buffer, Opus.name === 'opusscript' ? null : this._options.frameSize);
There it is, the null causing all the trouble. So the exception is in fact not a fault of the opusscript package.
Long-term solutions
I reported the bug to the module owner, hopefully it gets fixed. Update: it has been fixed within a few hours! :)
Alternative solution
Using a custom loader should also work fine. It's still a hack, but more persistent :)
here's a snippet of my code
console.log("IS RESTCLIENT UNDEFINED?");
console.log(restClient === undefined);
console.log(restClient);
restClient.get(options, function(resterr, restreq, restres, restobj) {
assert.ifError(resterr);
//not important
return next();
});
The problem is that when it gets executed (it's basically most of the handler for a route, simple stuff, nothing esoteric) the output is as following:
IS RESTCLIENT UNDEFINED?
false
JsonClient {<a lot of stuff describing the client>}
assert.js:327
assert.ifError = function(err) { if (err) throw err; };
^
InternalError: restClient is not defined
at parseResponse (/srv/oms-profiles-module/node_modules/restify/lib/clients/json_client.js:67:23)
at IncomingMessage.done (/srv/oms-profiles-module/node_modules/restify/lib/clients/string_client.js:151:17)
at IncomingMessage.g (events.js:260:16)
at emitNone (events.js:72:20)
at IncomingMessage.emit (events.js:166:7)
at endReadableNT (_stream_readable.js:893:12)
at doNTCallback2 (node.js:430:9)
at process._tickCallback (node.js:344:17)
The client is defined at the beginning of the file "as usual" (worked until now), and it uses the npm module restify. I don't even understand if the problem could be the scoping or what else, has anybody gotten any good advice on where I could bang my head on?
Thanks
UPDATE: this is not a problem with scopes and such, I presume; I suspect it is something with restify because otherwise the error would be something like "ReferenceError: restClient is not defined". Still, I am at a loss since it was working before and I did not introduce any major change for it to break. Restify version is 3.0.3
Alright, the answer is simple and I feel stupid (as I should),
the assert was being fired as there is a resterr. It comes from the API handler that is being called with restClient.get()
However I was expecting the whole (other) program to do something like crash (on another assert) or to tell me ReferenceError: restClient is not defined, but analysing the logs it did NOT happen. Thus I thought that the problem was in the snippet up here and not in the remote API that I was calling (still coded by me).