teamtreedyn/Binoculars

dynamosheets.json or credentials.json

Closed this issue · 3 comments

I get an exception when running binoculars in dynamo sandbox.

System.ArgumentException HResult=0x80070057 Message=PKCS8 data must be contained within '-----BEGIN PRIVATE KEY-----' and '-----END PRIVATE KEY-----'. Parameter name: pkcs8PrivateKey Source=Google.Apis.Auth StackTrace: at Google.Apis.Auth.OAuth2.Pkcs8.DecodeRsaParameters(String pkcs8PrivateKey) at Google.Apis.Auth.OAuth2.ServiceAccountCredential.Initializer.FromPrivateKey(String privateKey) at Google.Apis.Auth.OAuth2.DefaultCredentialProvider.CreateServiceAccountCredentialFromParameters(JsonCredentialParameters credentialParameters) at Google.Apis.Auth.OAuth2.DefaultCredentialProvider.CreateDefaultCredentialFromParameters(JsonCredentialParameters credentialParameters) at Binoculars.ExportSheets.Execute(IList1 list) in C:\Users\donovan.wilson\Source\Repos\Binoculars\Data.cs:line 130
at Binoculars.Events.OnEvaulationCompleted(Object sender, EvaluationCompletedEventArgs e) in C:\Users\donovan.wilson\Source\Repos\Binoculars\Events.cs:line 36
at System.EventHandler1.Invoke(Object sender, TEventArgs e) at Dynamo.Models.DynamoModel.OnEvaluationCompleted(Object sender, EvaluationCompletedEventArgs e) at System.EventHandler1.Invoke(Object sender, TEventArgs e)
at Dynamo.Graph.Workspaces.HomeWorkspaceModel.OnEvaluationCompleted(EvaluationCompletedEventArgs e)
at Dynamo.Graph.Workspaces.HomeWorkspaceModel.OnUpdateGraphCompleted(AsyncTask task)
at Dynamo.Scheduler.AsyncTask.HandleTaskCompletion()
at Dynamo.Scheduler.DynamoScheduler.ProcessTaskInternal(AsyncTask asyncTask)
at Dynamo.Scheduler.DynamoScheduler.ProcessNextTask(Boolean waitIfTaskQueueIsEmpty)
at Dynamo.Scheduler.DynamoSchedulerThread.ThreadProc()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
`

Here is the line its referencing:
credential = (ServiceAccountCredential) GoogleCredential.FromStream(stream).UnderlyingCredential;

It seem like its related to the "dynamosheets.json" credential file. Should it be looking for "credentials.json" instead? see line 116 below:

string file = "dynamosheets.json"; //string file = "credentials.json";

Any help will be greatly appreciated.
Thanks,
Donovan

Hi @two9seven

I believe this bug should be fixed if instead of building from the master branch you build from the settings branch.

git checkout settings

The Getting Started guide should then walk you through how to setup the required settings.json file for this branch.

Learn more about what has changed in the settings branch here: #32

We'll be merging it into the master branch soon

Is this noted in the Readme instructions? Dang i didn't even know about the GETTING-STARTED.md! I'll read that too. Thanks

Is this noted in the Readme instructions? Dang i didn't even know about the GETTING-STARTED.md! I'll read that too. Thanks

It was separate as those changes weren't part of the master branch.

I've now merged them in #32 and updated the README.md with more detailed instructions along with links to the Getting Started Guide for configuring settings.json.

This issue should therefore be resolved, please let us know if you continue to have issues.