"Invalid tree info" - Fileless directories
See original GitHub issueIssue Description
Following along with sbt-microsite: Publish using GitHub4s, I’ve created a token with the repo
scope, and have Enable SSO
’d (which is required by my environment).
I was then able to use the Github API to perform some simple tests:
- List commits for my repo
- List entries for a given tree
Despite this, when attempting to use publishMicrosite
, I get:
[error] Error committing filesGitHub returned an error: Failed invoking with status : 422 body :
{"message":"Invalid tree info","documentation_url":"https://developer.github.com/v3/git/trees/#create-a-tree"}
at sbtorgpolicies.github.syntax$GHResponseOps.execE(syntax.scala:53)
at sbtorgpolicies.github.syntax$EitherTOps.execE(syntax.scala:43)
at sbtorgpolicies.github.GitHubOps.commitDir(GitHubOps.scala:172)
at sbtorgpolicies.github.GitHubOps.commitDir(GitHubOps.scala:148)
at microsites.MicrositeAutoImportSettings.$anonfun$micrositeTasksSettings$13(MicrositeKeys.scala:305)
at scala.Function1.$anonfun$compose$1(Function1.scala:44)
at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:40)
at sbt.std.Transform$$anon$4.work(System.scala:67)
at sbt.Execute.$anonfun$submit$2(Execute.scala:269)
at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:16)
at sbt.Execute.work(Execute.scala:278)
at sbt.Execute.$anonfun$submit$1(Execute.scala:269)
at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:178)
at sbt.CompletionService$$anon$2.call(CompletionService.scala:37)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: github4s.GithubResponses$UnsuccessfulHttpRequest: Failed invoking with status : 422 body :
{"message":"Invalid tree info","documentation_url":"https://developer.github.com/v3/git/trees/#create-a-tree"}
at github4s.HttpRequestBuilderExtensionJVM.toEntity(HttpRequestBuilderExtensionJVM.scala:84)
at github4s.HttpRequestBuilderExtensionJVM.toEntity$(HttpRequestBuilderExtensionJVM.scala:74)
at github4s.jvm.Implicits$.toEntity(Implicits.scala:21)
at github4s.HttpRequestBuilderExtensionJVM$$anon$1.$anonfun$runMap$3(HttpRequestBuilderExtensionJVM.scala:67)
at scala.util.Try$.apply(Try.scala:209)
at sbtorgpolicies.github.instances$$anon$2.capture(instances.scala:57)
at sbtorgpolicies.github.instances$$anon$2.capture(instances.scala:56)
at github4s.HttpRequestBuilderExtensionJVM$$anon$1.runMap(HttpRequestBuilderExtensionJVM.scala:61)
at github4s.HttpRequestBuilderExtensionJVM$$anon$1.run(HttpRequestBuilderExtensionJVM.scala:34)
at github4s.HttpClient.post(HttpClient.scala:159)
at github4s.api.GitData.createTree(GitData.scala:251)
at github4s.free.interpreters.Interpreters$$anon$9.$anonfun$apply$7(Interpreters.scala:295)
at cats.data.Kleisli.$anonfun$map$1(Kleisli.scala:19)
at cats.data.KleisliFlatMap.$anonfun$tailRecM$2(Kleisli.scala:534)
at cats.instances.TryInstances$$anon$1.tailRecM(try.scala:57)
at cats.instances.TryInstances$$anon$1.tailRecM(try.scala:15)
at cats.data.KleisliFlatMap.$anonfun$tailRecM$1(Kleisli.scala:534)
at cats.data.Kleisli.$anonfun$map$1(Kleisli.scala:19)
at cats.data.KleisliFlatMap.$anonfun$tailRecM$2(Kleisli.scala:534)
at cats.instances.TryInstances$$anon$1.tailRecM(try.scala:57)
at cats.instances.TryInstances$$anon$1.tailRecM(try.scala:15)
at cats.data.KleisliFlatMap.$anonfun$tailRecM$1(Kleisli.scala:534)
at github4s.Github$GithubIOSyntaxEither.exec(Github.scala:62)
at sbtorgpolicies.github.syntax$GHResponseOps.execE(syntax.scala:51)
... 19 more
I found https://github.com/47deg/sbt-org-policies/issues/388#issuecomment-437045396, which was largely unhelpful other than to suggest that perhaps despite supplying the token, it doesn’t work as advertised (possibly in my SSO environment).
Any assistance would be appreciated!
Issue Analytics
- State:
- Created 4 years ago
- Comments:10 (1 by maintainers)
Top Results From Across the Web
"Invalid tree info" - Fileless directories · Issue #259 - GitHub
I found that github4s will struggle to commit this structure (422), with the culprit being the fileless microsite directory. As a workaround I ......
Read more >File and Directory Discovery, Technique T1083 - Enterprise
ID Name Description
S0045 ADVSTORESHELL ADVSTORESHELL can list files and directories.
S0031 BACKSPACE BACKSPACE allows adversaries to search for files.
S0234 Bandook Bandook has a command...
Read more >Malware Analysis: Memory Forensics with Volatility 3
In this post, we're going to take a look a Volatility 3, the newest version of the industries most popular memory forensics tool....
Read more >I cannot add the parent directory to *safe.directory* in Git
git folder (the git repository) is the issue. Cloning the project anew is a platform independent way to make sure you are the...
Read more >TXOne StellarOne for StellarEnforce - Trend Micro
An “exported endpoint info.csv” file will be downloaded to the folder which your browser specifies. It includes all agent information. Page ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I am seeing the same error “Invalid tree info” when trying to use the API to add individual files to my repo. I don’t have empty folders. Has a solution been found? Edit : I found other issue in my own code that was corrupting the data I was passing in. Ignore my question.
I have the same problem. While I had such a structure the publication was successful:
When I got such a structure that the publication began to fail with an error “Invalid tree info”:
I got directory dir3 with no files in it - just another directory (dir4) The error “Invalid tree info” went away only after I added the file to the directory dir3: