datadrivencv icon indicating copy to clipboard operation
datadrivencv copied to clipboard

Failure to knit CV

Open stanleesocca opened this issue 4 years ago • 9 comments

Hi Nick,

Lovely package you got. I tried using it and followed the step you enumerated in your website. But when i tried to knit the html or pdf version I get this sort of error message

 Error: Client error: (403) PERMISSION_DENIED
  * Client does not have sufficient permission. This can happen because the OAuth token does not have the right scopes, the client doesn't have permission, or the API has not been enabled for the client project.
  * The caller does not have permission

Any idea how to navigate this one. Stan

stanleesocca avatar May 23 '20 09:05 stanleesocca

Ah. It looks like you need to run a google sheets call outside of the knit first. Try running googlesheets4::read_sheet(data_location, sheet = "language_skills", skip = 1) in the console once. That should set up the proper permissions etc. Also, to make sure, did you set the sheet sharing to be "public" (or "anyone can read")? This isn't strictly necessary but makes authentication easier.

nstrayer avatar May 23 '20 22:05 nstrayer

I have exactly the same error @stanleesocca On the other hand when I try @nstrayer : googlesheets4 :: read_sheet ("https://docs.google.com/spreadsheets/d/1zraEpmrTpUBSpP-nZewv4FMGRebDVVndyFq9T1DPQW0/", sheet = "language_skills", skip = 1) It generates an error: "Error: Client error: (403) PERMISSION_DENIED   * Client does not have sufficient permission. This can happen because the OAuth token does not have the right scope ... " I don't understand how I can modify for sheet sharing to be "public". It should be noted that when I try with its excel, it runs perfectly.

biologisturiel avatar May 25 '20 06:05 biologisturiel

@biologisturiel if you want to keep your sheet private you can use the method as described in this link https://josiahparry.com/post/2020-01-13-gs4-auth/. You just need to change up the functions names that have changed in the new version of googlesheets4

mannymistry avatar May 25 '20 23:05 mannymistry

Hello, I'm still stuck. I have tried several ways, however the only way is using the excel link from @nstrayer

biologisturiel avatar May 26 '20 05:05 biologisturiel

@biologisturiel did you manage to switch your sheet to public? https://support.google.com/docs/answer/183965?co=GENIE.Platform%3DDesktop&hl=en#

mannymistry avatar May 26 '20 10:05 mannymistry

@nstrayer @mannymistry I've tried making my sheet public, and authenticating gs4 seemed to work, but I'm still getting the same error:

Error: Client error: (403) PERMISSION_DENIED * Client does not have sufficient permission. This can happen because the OAuth token does not have the right scopes, the client doesn't have permission, or the API has not been enabled for the client project. * The caller does not have permission

jgammerman avatar May 26 '20 13:05 jgammerman

Hi guys this is how I got around it. Context - I am using a private sheet. Make sure you are using the most updated version of googlesheets4. First I added my api key to the project specific cache .secrets.

designate project-specific cache options(gargle_oauth_cache = ".secrets") check the value of the option, if you like gargle::gargle_oauth_cache()

trigger auth on purpose --> store a token in the specified cache a browser will be opened googlesheets4::gs4_auth()

after I did this I manually adjusted the create_CV_object I changed the default sheet_is_publicly_readable = FALSE as well after the else I removed what was there and added googlesheets4::gs4_auth( cache = ".secrets", email = "[email protected]" )

mannymistry avatar May 26 '20 17:05 mannymistry

Hi all,

I've just run into the same issue. Did the googlesheets call above but got the error again. So I made the sheet 'public' by clicking 'Share', then under 'get link' I changed the permissions to 'anyone with the link' which worked just fine.

will-ball avatar May 27 '20 10:05 will-ball

Hello again! Finally I found a solution thanks to @will-ball , I followed the indicated:

  1. Make a copy of "https://docs.google.com/spreadsheets/d/14MQICF2F8-vf8CKPF1m4lyGKO6_thG-4aSwat1e2TWc/edit" (File -> Make a copy)
  2. Click on Share
  3. In the option get link, click on "change", below "copy link", point to "editor".
  4. Finally, copy link. PD: Keep in mind to modify little by little, since when I made a big modification, I got:

"Result 5 must be a single string"...

Thanks everyone for your help, it's a great package!

biologisturiel avatar May 28 '20 06:05 biologisturiel