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

Update dependencies in project.clj #71

Merged
merged 1 commit into from
Jan 5, 2021

Conversation

dotemacs
Copy link
Contributor

@dotemacs dotemacs commented Jan 4, 2021

outdated.md needs to be removed before creating the PR otherwise it
makes it into the PR.

:no-tests directive needs to be used with lein ancient, so that the
test aren't run straight away, after the dependency upgrade. This way
the PR is created.

Whoever gets the PR will still need to do some manual clean up, but at
least the start of the PR is there and it's visible that the upgrade
should take place.

outdated.md needs to be removed before creating the PR otherwise it
makes it into the PR.

:no-tests directive needs to be used with lein ancient, so that the
test aren't run straight away, after the dependency upgrade. This way
the PR is created.

Whoever gets the PR will still need to do some manual clean up, but at
least the start of the PR is there and it's visible that the upgrade
should take place.
@dotemacs
Copy link
Contributor Author

dotemacs commented Jan 5, 2021

This will create the PR, but then when the PR is created, CI will run tests for the new PR, which will eventually reach:

lein test :only nvd.task.check-test/self-check

ERROR in (self-check) (ConnectionFactory.java:196)
Uncaught exception, not in assertion.
expected: nil
  actual: org.owasp.dependencycheck.data.nvdcve.DatabaseException: Database schema does not match this version of dependency-check
 at org.owasp.dependencycheck.data.nvdcve.ConnectionFactory.initialize (ConnectionFactory.java:196)
    org.owasp.dependencycheck.data.nvdcve.ConnectionFactory.getConnection (ConnectionFactory.java:234)
    org.owasp.dependencycheck.data.nvdcve.CveDB.open (CveDB.java:271)
    org.owasp.dependencycheck.data.nvdcve.CveDB.<init> (CveDB.java:241)
    org.owasp.dependencycheck.Engine.openDatabase (Engine.java:969)
    org.owasp.dependencycheck.Engine.doUpdates (Engine.java:845)
    org.owasp.dependencycheck.Engine.doUpdates (Engine.java:828)
    nvd.task.update_database$_main.invokeStatic (update_database.clj:35)
    nvd.task.update_database$_main.invoke (update_database.clj:29)
    nvd.task.check_test$fn__2017.invokeStatic (check_test.clj:44)
    nvd.task.check_test/fn (check_test.clj:42)
    clojure.test$test_var$fn__9737.invoke (test.clj:717)
    clojure.test$test_var.invokeStatic (test.clj:717)
    clojure.test$test_var.invoke (test.clj:708)
    clojure.test$test_vars$fn__9763$fn__9768.invoke (test.clj:735)
    clojure.test$default_fixture.invokeStatic (test.clj:687)
    clojure.test$default_fixture.invoke (test.clj:683)
    clojure.test$test_vars$fn__9763.invoke (test.clj:735)
    clojure.test$default_fixture.invokeStatic (test.clj:687)
    clojure.test$default_fixture.invoke (test.clj:683)
    clojure.test$test_vars.invokeStatic (test.clj:731)
    clojure.test$test_all_vars.invokeStatic (test.clj:737)
    clojure.test$test_ns.invokeStatic (test.clj:758)
    clojure.test$test_ns.invoke (test.clj:743)
    user$eval226$fn__349.invoke (form-init2068874241547681319.clj:1)
    clojure.lang.AFn.applyToHelper (AFn.java:156)
    clojure.lang.AFn.applyTo (AFn.java:144)
    clojure.core$apply.invokeStatic (core.clj:667)
    clojure.core$apply.invoke (core.clj:660)
    leiningen.core.injected$compose_hooks$fn__156.doInvoke (form-init2068874241547681319.clj:1)
    clojure.lang.RestFn.applyTo (RestFn.java:137)
    clojure.core$apply.invokeStatic (core.clj:665)
    clojure.core$apply.invoke (core.clj:660)
    leiningen.core.injected$run_hooks.invokeStatic (form-init2068874241547681319.clj:1)
    leiningen.core.injected$run_hooks.invoke (form-init2068874241547681319.clj:1)
    leiningen.core.injected$prepare_for_hooks$fn__161$fn__162.doInvoke (form-init2068874241547681319.clj:1)
    clojure.lang.RestFn.applyTo (RestFn.java:137)
    clojure.lang.AFunction$1.doInvoke (AFunction.java:31)
    clojure.lang.RestFn.invoke (RestFn.java:408)
    clojure.core$map$fn__5866.invoke (core.clj:2755)
    clojure.lang.LazySeq.sval (LazySeq.java:42)
    clojure.lang.LazySeq.seq (LazySeq.java:51)
    clojure.lang.Cons.next (Cons.java:39)
    clojure.lang.RT.boundedLength (RT.java:1792)
    clojure.lang.RestFn.applyTo (RestFn.java:130)
    clojure.core$apply.invokeStatic (core.clj:667)
    clojure.test$run_tests.invokeStatic (test.clj:768)
    clojure.test$run_tests.doInvoke (test.clj:768)
    clojure.lang.RestFn.applyTo (RestFn.java:137)
    clojure.core$apply.invokeStatic (core.clj:665)
    clojure.core$apply.invoke (core.clj:660)
    user$eval226$fn__361$fn__414.invoke (form-init2068874241547681319.clj:1)
    user$eval226$fn__361$fn__362.invoke (form-init2068874241547681319.clj:1)
    user$eval226$fn__361.invoke (form-init2068874241547681319.clj:1)
    user$eval226.invokeStatic (form-init2068874241547681319.clj:1)
    user$eval226.invoke (form-init2068874241547681319.clj:1)
    clojure.lang.Compiler.eval (Compiler.java:7177)
    clojure.lang.Compiler.eval (Compiler.java:7167)
    clojure.lang.Compiler.load (Compiler.java:7636)
    clojure.lang.Compiler.loadFile (Compiler.java:7574)
    clojure.main$load_script.invokeStatic (main.clj:475)
    clojure.main$init_opt.invokeStatic (main.clj:477)
    clojure.main$init_opt.invoke (main.clj:477)
    clojure.main$initialize.invokeStatic (main.clj:508)
    clojure.main$null_opt.invokeStatic (main.clj:542)
    clojure.main$null_opt.invoke (main.clj:539)
    clojure.main$main.invokeStatic (main.clj:664)
    clojure.main$main.doInvoke (main.clj:616)
    clojure.lang.RestFn.applyTo (RestFn.java:137)
    clojure.lang.Var.applyTo (Var.java:705)
    clojure.main.main (main.java:40)
Caused by: org.owasp.dependencycheck.data.nvdcve.DatabaseException: unable to upgrade the database schema - please run the dependency-check purge command to remove the existing database
 at org.owasp.dependencycheck.data.nvdcve.ConnectionFactory.updateSchema (ConnectionFactory.java:376)
    org.owasp.dependencycheck.data.nvdcve.ConnectionFactory.ensureSchemaVersion (ConnectionFactory.java:445)
    org.owasp.dependencycheck.data.nvdcve.ConnectionFactory.initialize (ConnectionFactory.java:193)
    org.owasp.dependencycheck.data.nvdcve.ConnectionFactory.getConnection (ConnectionFactory.java:234)
    org.owasp.dependencycheck.data.nvdcve.CveDB.open (CveDB.java:271)
    org.owasp.dependencycheck.data.nvdcve.CveDB.<init> (CveDB.java:241)
    org.owasp.dependencycheck.Engine.openDatabase (Engine.java:969)
    org.owasp.dependencycheck.Engine.doUpdates (Engine.java:845)
    org.owasp.dependencycheck.Engine.doUpdates (Engine.java:828)
    nvd.task.update_database$_main.invokeStatic (update_database.clj:35)
    nvd.task.update_database$_main.invoke (update_database.clj:29)
    nvd.task.check_test$fn__2017.invokeStatic (check_test.clj:44)
    nvd.task.check_test/fn (check_test.clj:42)
    clojure.test$test_var$fn__9737.invoke (test.clj:717)
    clojure.test$test_var.invokeStatic (test.clj:717)
    clojure.test$test_var.invoke (test.clj:708)
    clojure.test$test_vars$fn__9763$fn__9768.invoke (test.clj:735)
    clojure.test$default_fixture.invokeStatic (test.clj:687)
    clojure.test$default_fixture.invoke (test.clj:683)
    clojure.test$test_vars$fn__9763.invoke (test.clj:735)
    clojure.test$default_fixture.invokeStatic (test.clj:687)
    clojure.test$default_fixture.invoke (test.clj:683)
    clojure.test$test_vars.invokeStatic (test.clj:731)
    clojure.test$test_all_vars.invokeStatic (test.clj:737)
    clojure.test$test_ns.invokeStatic (test.clj:758)
    clojure.test$test_ns.invoke (test.clj:743)
    user$eval226$fn__349.invoke (form-init2068874241547681319.clj:1)
    clojure.lang.AFn.applyToHelper (AFn.java:156)
    clojure.lang.AFn.applyTo (AFn.java:144)
    clojure.core$apply.invokeStatic (core.clj:667)
    clojure.core$apply.invoke (core.clj:660)
    leiningen.core.injected$compose_hooks$fn__156.doInvoke (form-init2068874241547681319.clj:1)
    clojure.lang.RestFn.applyTo (RestFn.java:137)
    clojure.core$apply.invokeStatic (core.clj:665)
    clojure.core$apply.invoke (core.clj:660)
    leiningen.core.injected$run_hooks.invokeStatic (form-init2068874241547681319.clj:1)
    leiningen.core.injected$run_hooks.invoke (form-init2068874241547681319.clj:1)
    leiningen.core.injected$prepare_for_hooks$fn__161$fn__162.doInvoke (form-init2068874241547681319.clj:1)
    clojure.lang.RestFn.applyTo (RestFn.java:137)
    clojure.lang.AFunction$1.doInvoke (AFunction.java:31)
    clojure.lang.RestFn.invoke (RestFn.java:408)
    clojure.core$map$fn__5866.invoke (core.clj:2755)
    clojure.lang.LazySeq.sval (LazySeq.java:42)
    clojure.lang.LazySeq.seq (LazySeq.java:51)
    clojure.lang.Cons.next (Cons.java:39)
    clojure.lang.RT.boundedLength (RT.java:1792)
    clojure.lang.RestFn.applyTo (RestFn.java:130)
    clojure.core$apply.invokeStatic (core.clj:667)
    clojure.test$run_tests.invokeStatic (test.clj:768)
    clojure.test$run_tests.doInvoke (test.clj:768)
    clojure.lang.RestFn.applyTo (RestFn.java:137)
    clojure.core$apply.invokeStatic (core.clj:665)
    clojure.core$apply.invoke (core.clj:660)
    user$eval226$fn__361$fn__414.invoke (form-init2068874241547681319.clj:1)
    user$eval226$fn__361$fn__362.invoke (form-init2068874241547681319.clj:1)
    user$eval226$fn__361.invoke (form-init2068874241547681319.clj:1)
    user$eval226.invokeStatic (form-init2068874241547681319.clj:1)
    user$eval226.invoke (form-init2068874241547681319.clj:1)
    clojure.lang.Compiler.eval (Compiler.java:7177)
    clojure.lang.Compiler.eval (Compiler.java:7167)
    clojure.lang.Compiler.load (Compiler.java:7636)
    clojure.lang.Compiler.loadFile (Compiler.java:7574)
    clojure.main$load_script.invokeStatic (main.clj:475)
    clojure.main$init_opt.invokeStatic (main.clj:477)
    clojure.main$init_opt.invoke (main.clj:477)
    clojure.main$initialize.invokeStatic (main.clj:508)
    clojure.main$null_opt.invokeStatic (main.clj:542)
    clojure.main$null_opt.invoke (main.clj:539)
    clojure.main$main.invokeStatic (main.clj:664)
    clojure.main$main.doInvoke (main.clj:616)
    clojure.lang.RestFn.applyTo (RestFn.java:137)
    clojure.lang.Var.applyTo (Var.java:705)
    clojure.main.main (main.java:40)

Ran 2 tests containing 3 assertions.
0 failures, 1 errors.
Tests failed.

Which obviously points to the fact that there is a schema mismatch between the previous version od NVD and the latest.

I googled around to see if there was a quick way to do the upgrade the schema... I'm guessing you have more context... Thanks

@rm-hull
Copy link
Owner

rm-hull commented Jan 5, 2021

Will look into the schema mismatch... It is most likely that upgrading dependency check from 5.x to 6.x is the cause.

@rm-hull rm-hull merged commit 970b46d into rm-hull:master Jan 5, 2021
@dotemacs dotemacs deleted the really-fix-dependencies branch January 5, 2021 09:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants