Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

client error: (422) Unprocessable Entity (WebDAV; RFC 4918) #41

Closed
cpsievert opened this issue Apr 9, 2015 · 14 comments
Closed

client error: (422) Unprocessable Entity (WebDAV; RFC 4918) #41

cpsievert opened this issue Apr 9, 2015 · 14 comments
Assignees
Labels

Comments

@cpsievert
Copy link
Contributor

Sorry this isn't really a minimal example, but I'm not sure of a good way to reduce it:

library(git2r)
library(gistr)
repo <- clone("https://github.com/cpsievert/AnimintTest.git", "AnimintTest")
fs <- dir("AnimintTest/FluView", full.names = TRUE)
gist_create(fs, description = "FluView")
#> Error in list2gist(x) : Not coerceable to a gist
#> In addition: Warning message:
#>   In process(response) :
#>   client error: (422) Unprocessable Entity (WebDAV; RFC 4918)
@sckott sckott added the bug label Apr 9, 2015
@sckott sckott self-assigned this Apr 9, 2015
@sckott
Copy link
Contributor

sckott commented Apr 10, 2015

@cpsievert you have a folder in that directory, which i think is what causes the problem.

@sckott
Copy link
Contributor

sckott commented Apr 10, 2015

@cpsievert what would you want to have happen with a folder ? e.g., recursive behavior so that all files in a folder are pushed up? Or if a folder is found, skip it?

@cpsievert
Copy link
Contributor Author

whoops, sorry about that, maybe you could add a check at the start of gist_create() like:

if (any(file_test("-d", files))) stop("Can't upload directories as a gist.)

?

@sckott
Copy link
Contributor

sckott commented Apr 10, 2015

Yeah, that sounds good to stop if a folder is found,

other than this issue, I think this should work even with the hundreds of files you have in your e.g.

@cpsievert
Copy link
Contributor Author

Yea, I forgot that in animint2dir() we flatten the file structure (which requires changing some hrefs). I'll play around some more and report back.

@sckott
Copy link
Contributor

sckott commented Apr 10, 2015

thanks 👍

@sckott
Copy link
Contributor

sckott commented Apr 10, 2015

added checks to gist_create() for binary files and directories in ad40063

@cpsievert
Copy link
Contributor Author

Thanks, I think it's safe to close this.

@sckott
Copy link
Contributor

sckott commented Apr 13, 2015

cool, thanks for bringing this up

@cpsievert
Copy link
Contributor Author

No prob, I flattened the file structure and now I get this error:

Error: Validation Failed
resource: Gist
code: missing_field
field: files
In addition: Warning message:
In max(b) : no non-missing arguments to max; returning -Inf

Perhaps I've hit the limit on the number of files?

Shall we migrate to another issue?

@sckott
Copy link
Contributor

sckott commented Apr 13, 2015

i'll try it again, and see if it's a diff. problem... 🕐

@sckott
Copy link
Contributor

sckott commented Apr 13, 2015

@cpsievert that warning In max(b) : no non-missing arguments to max; returning -Inf was just related to a helper fxn for checking for binary files. should be fixed now in commit not yet pushed

For the large number of files you have I think using git will be much easier and faster. Have you tried that? Is it do-able for your use case?

Using gist_create() with this example, it's failing, but haven't quite tracked down exactly why yet, something with the Github API

@cpsievert
Copy link
Contributor Author

Got it, thanks, I'll think about using git2r in animint instead (I didn't know it was on CRAN!)

@sckott
Copy link
Contributor

sckott commented Apr 13, 2015

yeah, so nice that it's on cran now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants