grpc.Credentials.createSsl() - Cannot read property 'createSsl' of undefined - grpc

I am getting following error running nodejs (latest stable) & grpc (installed via npm install grpc) on win7 x64:
Relevant code:
var certPath = path.join(process.env.LOCALAPPDATA, 'cert', 'rpc.cert');
var cert = fs.readFileSync(certPath);
var creds = grpc.Credentials.createSsl(cert);
Error:
var creds = grpc.Credentials.createSsl();
^
TypeError: Cannot read property 'createSsl' of undefined
rpc.cert is present in the path and is readable + is in PEM standard format. I guess, gRPC is throwing error, because it does not understand the format maybe ? Or what I am doing wrong here - or what am I missing ?
Thank you very much for any help!

This is actually just a minor API usage error. Some time within the last couple of versions, grpc.Credentials changed to grpc.credentials (with a lower-case c). You should be able to call grpc.credentials.createSsl() just fine.

Related

Jython error: java.util.zip.DataFormatException: invalid code lengths set

Using StreamSets Jython (Python 2.7) processor when I make an API call using Python requests module
r = requests.get("https://someurl.com", headers={"Authorization":"Bearer sometokenstring"})
I get an error:
INFO java.util.zip.DataFormatException: invalid code lengths set.
Same code runs without this error in a linux terminal with Python 2.7. Any ideas to resolve this error?
This got resolved by adding a requests header attribute: "Accept-Encoding": "deflate" as the zip format data was causing some issue. So now the request looks like:
r = requests.get("https://someurl.com", headers={"Authorization":"Bearer sometokenstring","Accept-Encoding":"deflate"})

TypeError: undefined is not an object on Paw app

I installed some new plugin on Paw app (Postman 1 and 2 export, Swagger 2). And since I have this error when I try to make a new export. I tried to uninstall and reinstall only one plugin, and I still have this error.
But before I install some new plugin, I made some export without error.
This is the error I get when I attempt to make an export:
Export Failed
JavaScript Exception: TypeError: undefined is not an object (evaluating 'ds.length') ({
column = 20;
line = 2277;
})
Sorry for the very late follow up. We've been able to reproduce this issue, and release a fix last week.
Please update your Paw extensions by going to the Paw menu > Extensions > Check for Extensions Updates…
This will trigger the updating of all your installed extensions. Then, please try again to export your project, it should be working correctly.

Unspecified error when using Meteor with TypeScript

I'm developing a web application with Meteor and TypeScript. I'm also using the Nitrous.io cloud development environment.
I installed the TypeScript compiler and added TypeScript libraries from here: https://github.com/meteor-typescript.
I am trying to use Iron Router in my app.
The error I'm getting is:
/lib/package_defs/ironrouter.d.ts(80,56): error TS1005: ',' expected.
/lib/package_defs/ironrouter.d.ts(80,92): error TS1005: ',' expected.
Error: Unspecified error
I get the same error with other packages, whenever the '|' character is used. For example, line 80 of ironrouter.d.ts is:
export function onBeforeAction(hookOrFunc?: string | Function, funcOrParams?: Function | any, params?: any): void;
I tried changing all '|' to ',' like the error message suggests, but then I get another error message:
/lib/package_defs/ironrouter.d.ts(80,58): error TS1016: Required parameter cannot follow optional parameter.
Error: Unspecified error
I'm no expert and I'm new to TypeScript and Meteor.
What could be causing this error? Please help.
Thank you.
Union types were added in version 1.4 of TypeScript and are used in the definition file you mention:
export function onBeforeAction(hookOrFunc?: string | Function, funcOrParams?: Function | any, params?: any): void;
If you have already installed version 1.4 or above, make sure your project is using it (view you project file):
<TypeScriptToolsVersion>1.4</TypeScriptToolsVersion>
If you are still certain that you are using version 1.4, check that you can use the new features using this snippet:
type example = string | number;
You can track support for TypeScript 1.4 in WebStorm here.

Parse error when on production

I have developed a Symfony2 project (v2.2.2) and it was working all fine locally.
When I deploy it on my server I meet 2 issues:
the folder /bin does not transfer through Filezilla (impossible to start transfer)
i encounter a parse error when trying to access web/app.php/ in debug mode (see below)
First I do not understand why it would work in local but not on production.
I also guessed these errors where linked but I do not know what is /bin used for (contains only 2 files doctrine and doctrine.php) and if I remove it locally it keeps working ...
Parse error is the following :
"FatalErrorException: Parse: syntax error, unexpected '[' in /home/colocall/twinkler/src/Tk/ExpenseBundle/Services/Expenses.php line 21"
Expenses.php line 15->25:
public function getAllExpenses($member, $group)
{
$all_expenses_col = $group->getExpenses();
$all_expenses = array();
foreach($all_expenses_col as $expense){
$all_expenses[] = [$expense, $this->forYou($member, $expense)];
}
return $all_expenses;
}
Maybe linked to : The parse error also happen when i try to update my database through ssh connection.
If someone would know the reason why I can't make it working it would save my day that i have already lost ...
Thank you in advance,
Jules
Your error is produced by using the short array syntax [] in your code.
It is not available in PHP 5.3.10 aka on your production server. The short syntax was introduced in PHP 5.4 which explains why your code is working in your dev-environment.
change ...
$all_expenses[] = [$expense, $this->forYou($member, $expense)];
...to
$all_expenses[] = array($expense, $this->forYou($member, $expense));
... or update your server's php version and it will work :)

CFURLCopyResourcePropertyForKey error when gitk

can someone explain ho to resolve this error:
CFURLCopyResourcePropertyForKey failed because it was passed this URL which has no scheme:
it´s probably caused by xCode when i try to gitk or gitk --all in the Terminal. It started to appear after the Mountain Lion upgrade. Thanks :)
Error screenshot:
I got this error just now and find a solution to solve it.
I was trying to invoke the function getResourceValue:forKey:error: in my project and my os version is 10.7.5.
I init a new NSURL object by using + URLWithString: and the problem occurred before, after I replace it with + fileURLWithPath:, it's ok now.
The difference value between the two objects with different functions is /Volumes/Data/a file://localhost/Volumes/Data/a/
Apple has statemented that about NSURL class below,
Handling Object Creation Failure The NSURL class fails to create a new NSURL object if the path being passed is not well-formed; the path must comply with RFC 2396. Examples of cases that will not succeed are strings containing space characters and high-bit characters. Should creating an NSURL object fail, the creation methods return nil, which you must be prepared to handle. If you are creating NSURL objects using file system paths, you should use fileURLWithPath: or initFileURLWithPath:, which handle the subtle differences between URL paths and file system paths. If you wish to be tolerant of malformed path strings, you’ll need to use functions provided by the Core Foundation framework to clean up the strings.
Error while using getResourceValue:forKey method in NSURL
On Mountain Lion 10.8.2, I fixed this issue when calling gitk from terminal by installing/upgrading tcl and tk.
brew install tcl
brew install tk
The UI of gitk will likely change, but you can tweak that in ~/.gitk.

Resources