atomist-attic / artifact-source

ArtifactSource abstraction for source code
GNU General Public License v3.0
2 stars 3 forks source link

Failing to resetting to sha #31

Closed Lawouach closed 7 years ago

Lawouach commented 7 years ago

While cloning one of my repo, artifact source chocked because it tries to fetch with --unshallow on a full repository (https://github.com/democritus-team/jeanpaul):

Loading rugs of atomist:spring-team-handlers (0.4.0·local) completed
  Cloning democritus-team/jeanpaul#60217cf1d9e683f26564da09a36c763b27455647
Invoking handle method on event-handler SpringBootMetricsOnCommit of atomist:spring-team-handlers failed
com.atomist.source.ArtifactSourceCreationException: Failed to find commit with sha 60217cf1d9e683f26564da09a36c763b27455647
        at com.atomist.source.git.GitRepositoryCloner.com$atomist$source$git$GitRepositoryCloner$$resetToSha(GitRepositoryCloner.scala:82)
        at com.atomist.source.git.GitRepositoryCloner$$anonfun$clone$1.apply(GitRepositoryCloner.scala:45)
        at com.atomist.source.git.GitRepositoryCloner$$anonfun$clone$1.apply(GitRepositoryCloner.scala:45)
        at scala.Option.map(Option.scala:146)
        at com.atomist.source.git.GitRepositoryCloner.clone(GitRepositoryCloner.scala:45)
        at com.atomist.rug.cli.command.handlers.HandlerRepoResolver.resolveSha(HandlerRepoResolver.scala:22)
        at com.atomist.rug.kind.core.ProjectType.navigate(ProjectType.scala:48)
        at com.atomist.tree.pathexpression.NodesWithTag.com$atomist$tree$pathexpression$NodesWithTag$$findMeUnder(NodesWithTag.scala:65)
        at com.atomist.tree.pathexpression.NodesWithTag.follow(NodesWithTag.scala:90)
        at com.atomist.tree.pathexpression.LocationStep.follow(LocationStep.scala:24)
        at com.atomist.tree.pathexpression.PathExpressionEngine$$anonfun$evaluateAndReport$1.apply(PathExpressionEngine.scala:36)
        at com.atomist.tree.pathexpression.PathExpressionEngine$$anonfun$evaluateAndReport$1.apply(PathExpressionEngine.scala:31)
        at scala.collection.immutable.List.foreach(List.scala:381)
        at com.atomist.tree.pathexpression.PathExpressionEngine.evaluateAndReport(PathExpressionEngine.scala:31)
        at com.atomist.tree.pathexpression.PathExpressionEngine.evaluate(PathExpressionEngine.scala:18)
        at com.atomist.rug.runtime.js.JavaScriptEventHandler.handle(JavaScriptEventHandler.scala:71)
        at com.atomist.rug.cli.command.handlers.event.EventHandlerCommand$$anon$1.run(EventHandlerCommand.scala:51)
        at com.atomist.rug.cli.command.handlers.event.EventHandlerCommand$$anon$1.run(EventHandlerCommand.scala:49)
        at com.atomist.rug.cli.output.ProgressReportingOperationRunner.run(ProgressReportingOperationRunner.java:22)
        at com.atomist.rug.cli.command.handlers.event.EventHandlerCommand.handle(EventHandlerCommand.scala:49)
        at com.atomist.rug.cli.command.handlers.event.EventHandlerCommand.command(EventHandlerCommand.scala:36)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at com.atomist.rug.cli.command.AbstractAnnotationBasedCommand.invokeMethod(AbstractAnnotationBasedCommand.java:47)
        at com.atomist.rug.cli.command.AbstractAnnotationBasedCommand.run(AbstractAnnotationBasedCommand.java:217)
        at com.atomist.rug.cli.command.AbstractCompilingAndOperationLoadingCommand.run(AbstractCompilingAndOperationLoadingCommand.java:162)
        at com.atomist.rug.cli.command.AbstractCommand.run(AbstractCommand.java:36)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at com.atomist.rug.cli.command.ReflectiveCommandRunMethodRunner.invokeCommand(ReflectiveCommandRunMethodRunner.java:17)
        at com.atomist.rug.cli.command.ReflectiveCommandRunner.invokeReflectiveCommand(ReflectiveCommandRunner.java:93)
        at com.atomist.rug.cli.command.ReflectiveCommandRunner.invokeCommand(ReflectiveCommandRunner.java:262)
        at com.atomist.rug.cli.command.ReflectiveCommandRunner.runCommand(ReflectiveCommandRunner.java:60)
        at com.atomist.rug.cli.Runner.runCommand(Runner.java:93)
        at com.atomist.rug.cli.Runner.run(Runner.java:40)
        at com.atomist.rug.cli.Main.invokeRunner(Main.java:34)
        at com.atomist.rug.cli.Main.main(Main.java:25)
Caused by: java.lang.RuntimeException: Nonzero exit value: 128
        at scala.sys.package$.error(package.scala:27)
        at scala.sys.process.ProcessBuilderImpl$AbstractBuilder.slurp(ProcessBuilderImpl.scala:132)
        at scala.sys.process.ProcessBuilderImpl$AbstractBuilder.$bang$bang(ProcessBuilderImpl.scala:103)
        at com.atomist.source.git.GitRepositoryCloner$$anonfun$5.apply(GitRepositoryCloner.scala:80)
        at com.atomist.source.git.GitRepositoryCloner$$anonfun$5.apply(GitRepositoryCloner.scala:80)
        at scala.util.Try$.apply(Try.scala:192)
        at com.atomist.source.git.GitRepositoryCloner.com$atomist$source$git$GitRepositoryCloner$$resetToSha(GitRepositoryCloner.scala:77)
        ... 40 more

Running the commands on a frech clone did show that:

git fetch --unshallow
fatal: --unshallow on a complete repository does not make sense
✘-128 /tmp/whatever/jeanpaul [master|✔ ]
11:43 $ echo $?
128
Lawouach commented 7 years ago

Okay, I just tried again and didn't see the issue anymore.

Making, sure I have access to neo4j in prod:

$ cd ~/.awscluster/clusters/prod/atm-k8w-854454
$ ssh -F ssh_config -L 8082:10.113.0.226:8080 worker1

Now, let's try to replay the commit event:

$ cd /home/sylvain/dev/atomist/spring-team-handlers
$ rug trigger -urXl SpringBootMetricsOnCommit --id 161062 --team-id T095SFFBK --tag Commit --disable-verification --disable-version-check
Extension verification is disabled. Please use with extreme caution!
Binary dependency report for atomist:spring-team-handlers (0.5.9)
  atomist:spring-team-handlers (0.5.9)
  ├─┬ com.atomist:rug (1.0.0-m.4·jar·compile)
  | ├─┬ com.atomist:artifact-source (1.0.0-m.3·jar·compile)
  | | ├── commons-io:commons-io (2.5·jar·compile)
  | | ├── org.apache.commons:commons-compress (1.13·jar·compile)
  | | ├── org.slf4j:jcl-over-slf4j (1.7.25·jar·compile)
  | | └─┬ ch.qos.logback:logback-classic (1.2.3·jar·compile)
  | |   └── ch.qos.logback:logback-core (1.2.3·jar·compile)
  | ├─┬ com.atomist:rug-typescript-compiler (1.0.0-m.1·jar·compile)
  | | ├── com.atomist:rug-compiler (1.0.0-m.1·jar·compile)
  | | ├── commons-codec:commons-codec (1.10·jar·compile)
  | | ├── ch.qos.logback:logback-access (1.2.3·jar·compile)
  | | └── com.eclipsesource.j2v8:j2v8_linux_x86_64 (4.6.0·jar·compile)
  | ├── com.coveo:nashorn-commonjs-modules (1.0.8·jar·compile)
  | ├─┬ com.atlassian.sourcemap:sourcemap (1.7.6·jar·compile)
  | | └── com.google.code.gson:gson (2.2.3·jar·compile)
  | ├─┬ org.antlr:antlr4 (4.7·jar·compile)
  | | ├── org.antlr:antlr4-runtime (4.7·jar·compile)
  | | ├── org.antlr:antlr-runtime (3.5.2·jar·compile)
  | | ├── org.antlr:ST4 (4.0.8·jar·compile)
  | | ├── org.abego.treelayout:org.abego.treelayout.core (1.0.3·jar·compile)
  | | ├── org.glassfish:javax.json (1.0.4·jar·compile)
  | | └── com.ibm.icu:icu4j (58.2·jar·compile)
  | ├─┬ com.github.julianthome:inmemantlr-api (1.3.3·jar·compile)
  | | └── org.eclipse.jdt.core.compiler:ecj (4.6.1·jar·compile)
  | ├── com.github.javaparser:javaparser-core (3.2.5·jar·compile)
  | ├─┬ io.cucumber:gherkin (4.0.0·jar·compile)
  | | └── io.cucumber:gherkin-jvm-deps (1.0.4·jar·compile)
  | ├─┬ org.scalameta:scalameta_2.11 (1.4.0·jar·compile)
  | | ├── org.scalameta:common_2.11 (1.4.0·jar·compile)
  | | ├── org.scalameta:dialects_2.11 (1.4.0·jar·compile)
  | | ├─┬ org.scalameta:parsers_2.11 (1.4.0·jar·compile)
  | | | ├── org.scalameta:inputs_2.11 (1.4.0·jar·compile)
  | | | └── org.scalameta:tokens_2.11 (1.4.0·jar·compile)
  | | ├── org.scalameta:quasiquotes_2.11 (1.4.0·jar·compile)
  | | ├─┬ org.scalameta:tokenizers_2.11 (1.4.0·jar·compile)
  | | | └─┬ com.lihaoyi:scalaparse_2.11 (0.4.2·jar·compile)
  | | |   ├─┬ com.lihaoyi:fastparse_2.11 (0.4.2·jar·compile)
  | | |   | └── com.lihaoyi:fastparse-utils_2.11 (0.4.2·jar·compile)
  | | |   └── com.lihaoyi:sourcecode_2.11 (0.1.3·jar·compile)
  | | ├── org.scalameta:transversers_2.11 (1.4.0·jar·compile)
  | | ├── org.scalameta:trees_2.11 (1.4.0·jar·compile)
  | | └── org.scalameta:inline_2.11 (1.4.0·jar·compile)
  | ├── com.github.spullara.mustache.java:compiler (0.9.3·jar·compile)
  | ├── org.apache.commons:commons-lang3 (3.5·jar·compile)
  | ├─┬ org.springframework:spring-web (4.3.8.RELEASE·jar·compile)
  | | ├── org.springframework:spring-aop (4.3.8.RELEASE·jar·compile)
  | | ├── org.springframework:spring-beans (4.3.8.RELEASE·jar·compile)
  | | ├─┬ org.springframework:spring-context (4.3.8.RELEASE·jar·compile)
  | | | └── org.springframework:spring-expression (4.3.8.RELEASE·jar·compile)
  | | └── org.springframework:spring-core (4.3.8.RELEASE·jar·compile)
  | ├── org.scala-lang.modules:scala-parser-combinators_2.11 (1.0.4·jar·compile)
  | ├─┬ com.typesafe.scala-logging:scala-logging_2.11 (3.5.0·jar·compile)
  | | └── org.scala-lang:scala-reflect (2.11.8·jar·compile)
  | ├── org.slf4j:slf4j-api (1.7.25·jar·compile)
  | ├─┬ com.fasterxml.jackson.dataformat:jackson-dataformat-yaml (2.8.8·jar·compile)
  | | ├── com.fasterxml.jackson.core:jackson-core (2.8.8·jar·compile)
  | | └── org.yaml:snakeyaml (1.17·jar·compile)
  | ├─┬ com.fasterxml.jackson.datatype:jackson-datatype-jdk8 (2.8.8·jar·compile)
  | | └── com.fasterxml.jackson.core:jackson-databind (2.8.8·jar·compile)
  | ├─┬ com.fasterxml.jackson.datatype:jackson-datatype-jsr310 (2.8.8·jar·compile)
  | | └── com.fasterxml.jackson.core:jackson-annotations (2.8.0·jar·compile)
  | ├─┬ com.fasterxml.jackson.module:jackson-module-scala_2.11 (2.8.8·jar·compile)
  | | └─┬ com.fasterxml.jackson.module:jackson-module-paranamer (2.8.8·jar·compile)
  | |   └── com.thoughtworks.paranamer:paranamer (2.8·jar·compile)
  | └─┬ com.github.mifmif:generex (1.0.2·jar·compile)
  |   └── dk.brics.automaton:automaton (1.11-8·jar·compile)
  ├─┬ com.atomist.rug:spring-types (0.1.4·jar·compile)
  | ├── org.scalaj:scalaj-http_2.11 (2.3.0·jar·compile)
  | ├─┬ com.puppycrawl.tools:checkstyle (7.7·jar·compile)
  | | ├── antlr:antlr (2.7.7·jar·compile)
  | | ├─┬ commons-beanutils:commons-beanutils (1.9.3·jar·compile)
  | | | └── commons-collections:commons-collections (3.2.2·jar·compile)
  | | ├── commons-cli:commons-cli (1.4·jar·compile)
  | | ├── com.google.guava:guava (19.0·jar·compile)
  | | └── com.sun:tools (1.8.0·jar·system)
  | ├─┬ net.sourceforge.pmd:pmd-java (5.6.1·jar·compile)
  | | ├── jaxen:jaxen (1.1.6·jar·compile)
  | | ├── net.java.dev.javacc:javacc (5.0·jar·compile)
  | | ├─┬ net.sourceforge.pmd:pmd-core (5.6.1·jar·compile)
  | | | └── com.beust:jcommander (1.48·jar·compile)
  | | ├── net.sourceforge.saxon:saxon (9.1.0.8·jar·compile)
  | | ├── org.ow2.asm:asm (5.0.4·jar·compile)
  | | └── net.sourceforge.saxon:saxon (9.1.0.8·jar·dom·runtime)
  | ├─┬ org.scalastyle:scalastyle_2.11 (0.8.0·jar·compile)
  | | ├── org.scalariform:scalariform_2.11 (0.1.7·jar·compile)
  | | └── com.typesafe:config (1.2.0·jar·compile)
  | ├─┬ org.apache.maven:maven-project (2.2.1·jar·compile)
  | | ├── org.apache.maven:maven-settings (2.2.1·jar·compile)
  | | ├── org.apache.maven:maven-profile (2.2.1·jar·compile)
  | | ├─┬ org.apache.maven:maven-artifact-manager (2.2.1·jar·compile)
  | | | ├── org.apache.maven.wagon:wagon-provider-api (1.0-beta-6·jar·compile)
  | | | └── backport-util-concurrent:backport-util-concurrent (3.1·jar·compile)
  | | ├── org.apache.maven:maven-plugin-registry (2.2.1·jar·compile)
  | | ├── org.codehaus.plexus:plexus-interpolation (1.11·jar·compile)
  | | ├── org.apache.maven:maven-artifact (2.2.1·jar·compile)
  | | └─┬ org.codehaus.plexus:plexus-container-default (1.0-alpha-9-stable-1·jar·compile)
  | |   ├── junit:junit (3.8.1·jar·compile)
  | |   └── classworlds:classworlds (1.1-alpha-2·jar·compile)
  | ├── org.apache.maven:maven-model (3.5.0·jar·compile)
  | ├── org.codehaus.plexus:plexus-utils (3.0.24·jar·compile)
  | ├── org.eclipse.aether:aether-api (1.0.0.v20140518·jar·compile)
  | ├── org.eclipse.aether:aether-spi (1.0.0.v20140518·jar·compile)
  | ├── org.eclipse.aether:aether-util (1.0.0.v20140518·jar·compile)
  | ├── org.eclipse.aether:aether-impl (1.0.0.v20140518·jar·compile)
  | ├── org.eclipse.aether:aether-connector-basic (1.0.0.v20140518·jar·compile)
  | ├── org.eclipse.aether:aether-transport-file (1.0.0.v20140518·jar·compile)
  | ├─┬ org.eclipse.aether:aether-transport-http (1.0.0.v20140518·jar·compile)
  | | └── org.apache.httpcomponents:httpclient (4.2.6·jar·compile)
  | └─┬ org.apache.maven:maven-aether-provider (3.1.0·jar·compile)
  |   ├── org.apache.maven:maven-model-builder (3.1.0·jar·compile)
  |   ├── org.apache.maven:maven-repository-metadata (3.1.0·jar·compile)
  |   ├─┬ org.eclipse.sisu:org.eclipse.sisu.plexus (0.0.0.M2a·jar·compile)
  |   | ├─┬ javax.enterprise:cdi-api (1.0·jar·compile)
  |   | | ├── javax.annotation:jsr250-api (1.0·jar·compile)
  |   | | └── javax.inject:javax.inject (1·jar·compile)
  |   | ├─┬ org.sonatype.sisu:sisu-guice (3.1.0·jar·no_aop·compile)
  |   | | └── aopalliance:aopalliance (1.0·jar·compile)
  |   | ├─┬ org.eclipse.sisu:org.eclipse.sisu.inject (0.0.0.M2a·jar·compile)
  |   | | └── asm:asm (3.3.1·jar·compile)
  |   | └── org.codehaus.plexus:plexus-classworlds (2.4·jar·compile)
  |   └── org.codehaus.plexus:plexus-component-annotations (1.5.5·jar·compile)
  ├─┬ com.atomist.rug:rug-function-http (0.7.7·jar·compile)
  | ├── org.clojure:clojure (1.8.0·jar·compile)
  | ├── org.clojure:data.json (0.2.6·jar·compile)
  | ├─┬ clj-http:clj-http (3.4.1·jar·compile)
  | | ├── org.apache.httpcomponents:httpcore (4.4.5·jar·compile)
  | | ├─┬ org.apache.httpcomponents:httpasyncclient (4.1.2·jar·compile)
  | | | ├── org.apache.httpcomponents:httpcore-nio (4.4.5·jar·compile)
  | | | └── commons-logging:commons-logging (1.2·jar·compile)
  | | ├── org.apache.httpcomponents:httpmime (4.5.2·jar·compile)
  | | ├── slingshot:slingshot (0.12.2·jar·compile)
  | | └─┬ potemkin:potemkin (0.4.3·jar·compile)
  | |   ├── clj-tuple:clj-tuple (0.2.2·jar·compile)
  | |   └── riddley:riddley (0.1.12·jar·compile)
  | └─┬ org.clojure:core.memoize (0.5.8·jar·compile)
  |   └─┬ org.clojure:core.cache (0.6.4·jar·compile)
  |     └── org.clojure:data.priority-map (0.0.4·jar·compile)
  └─┬ com.atomist.rug:rug-functions-travis (0.18.0·jar·compile)
    ├─┬ org.bouncycastle:bcpkix-jdk15on (1.53·jar·compile)
    | └── org.bouncycastle:bcprov-jdk15on (1.53·jar·compile)
    ├── org.scala-lang:scala-library (2.11.8·jar·compile)
    └── org.scala-lang.modules:scala-xml_2.11 (1.0.5·jar·compile)
Archive dependency report for atomist:spring-team-handlers (0.5.9)
  atomist:spring-team-handlers (0.5.9)
Resolving dependencies for atomist:spring-team-handlers (0.5.9·local) completed
Compiling source files of atomist:spring-team-handlers (0.5.9·local) ⣟ OpenJDK 64-Bit Server VM warning: You have loaded library /home/sylvain/libj2v8_linux_x86_64.so which might have disabled stack guard. The VM will try to fix the stack guard now.
It's highly recommended that you fix the library with 'execstack -c <libfile>', or link it with '-z noexecstack'.
Compiling source files of atomist:spring-team-handlers (0.5.9·local) completed
Loading rugs of atomist:spring-team-handlers (0.5.9·local) completed
  Cloning democritus-team/jeanpaul#8dfa73772aee78585c30d5de73b79643237309dc
  Cloning atomisthq/atomist-config#master
→ Returned Plan
Invoking handle method on event-handler SpringBootMetricsOnCommit of atomist:spring-team-handlers completed
Running plan of event-handler SpringBootMetricsOnCommit of atomist:spring-team-handlers completed
SpringBootMetricsOnCommit
...

The problem I see however is that we had 11 commits when I tried the first time, now we have 18 on that repo. I wonder if the bug is hidden due to that.

alankstewart commented 7 years ago

I believe this is fixed with 1.0.0-m.14