jepsen-io / jepsen

A framework for distributed systems verification, with fault injection
6.81k stars 719 forks source link

Unable to locate package libzip2 #267

Closed cxucheng closed 4 years ago

cxucheng commented 6 years ago

I am trying to use jepsen on Ubuntu 16 and I follow the tutorial to try to set it up. However, it broke and giving me the error: Unable to locate package libzip2

(ns jepsen.demo
  (:require [clojure.tools.logging :refer :all]
            [clojure.string :as str]
            [jepsen [cli :as cli]
                    [control :as c]
                    [db :as db]
                    [tests :as tests]]
            [jepsen.control.util :as cu]
            [jepsen.os.debian :as debian]))

(defn db
  "Etcd DB for a particular version."
  [version]
  (reify db/DB
    (setup! [_ test node]
      (info node "installing etcd" version))

    (teardown! [_ test node]
      (info node "tearing down etcd"))))

(defn etcd-test
  "Given an options map from the command line runner (e.g. :nodes, :ssh,
  :concurrency ...), constructs a test map."
  [opts]
  (merge tests/noop-test
         opts
         {:name "etcd"
          :os   debian/os
          :db   (db "v3.1.5")}))

(defn -main
  "Handles command line arguments. Can either run a test, or a web server for
  browsing results."
  [& args]
  (cli/run! (merge (cli/single-test-cmd {:test-fn etcd-test})
                   (cli/serve-cmd))
            args))

(defn foo
  "I don't do a whole lot."
  [x]
  (println x "Hello, World!"))

I try to find this package, but it only exists in Ubuntu 14.04, so I wonder what is the solution to it?

vjuranek commented 6 years ago

if you are running jepsen on recent ubuntu or debian, you have to replace libzip2 by libzip4 here.

cxucheng commented 6 years ago

Based on my project.clj

(defproject jepsen.demo "0.1.0-SNAPSHOT"
  :description "A Jepsen test for etcd"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :main jepsen.demo
  :dependencies [[org.clojure/clojure "1.9.0"]
                 [jepsen "0.1.8"]
                 [verschlimmbesserung "0.1.3"]])

I am guessing I am using some libs from the maven, is that right? If I have to replace the package, I should compile that bunch of stuff and put it on maven, is there any tutorials on it?

Leviathan1995 commented 6 years ago

@cxucheng If you want to add other dependencies in project.clj, you just need to execute the command lein run test, lein will automatically download these dependencies.

cxucheng commented 6 years ago

@Leviathan1995 I am trying to solve the missing package libzip2 thing, cause my guess is the script that install lipzip2 is inside the package jepsen 0.1.8. So if I want to fix the missing package issue, I need to revise the src code and recompile jepsen and maybe put it on maven before I can use. Is that correct?

Leviathan1995 commented 6 years ago

@cxucheng If you modified the source code of Jepsen, you need to execute the command lein install in the path of Jensen. #248

aphyr commented 6 years ago

Hi folks. Jepsen uses Debian Jessie by default; I can't vouch for what happens on Ubuntu. I think y'all might also have some confusion here between the dependencies for a project that uses the Jepsen library (listed in project.clj and managed by leiningen) vs packages that Jepsen installs on DB nodes, which are controlled by your test's :os field.

qclu commented 6 years ago

I tried 'apt-get install libzip2' in debian 9, still got error 'Unable to locate package libzip2'. I also tried to replace lipzip2 with libzip4 in jepsen/os/debian.clj, but also I cannot bypass this error. Is there any other solution?

divya2661 commented 5 years ago

Do we have any solutions on this yet? Also, Jepsen by default uses Debian Jessie, does this mean that we also have to keep that one only whenever we try to test something?

aphyr commented 5 years ago

No, that's just the version I happen to be testing with presently, so it's the one I maintain. You can use a different implementation of the OS protocol if you'd like to test on a different operating system

divya2661 commented 5 years ago

What do you think about adding an interface where the user can override the OS functions like install, uninstall or probably changing the packages. I can raise a PR if this sounds good.

aphyr commented 5 years ago

Again, this is already in Jepsen: you can pass your own :os to the test if you'd like to install different packages. Anything that satisfies the OS protocol will do fine.

aphyr commented 5 years ago

Uh, maybe to make this suuuuper explicit: the original poster is running on Ubuntu, but in their test, they've said that they'd like to use Jepsen's Debian OS support, which is written for Debian Jessie:

         {:name "etcd"
          :os   debian/os
          :db   (db "v3.1.5")}))

This doesn't work, because it's trying to run code written for Debian Jessie on Ubuntu 16, which has different package names. If you'd like to run a Jepsen test on a different operating system, you can use an existing (or write your own), implementation of the OS protocol, and pass it in to the test instead of using debian/os. See jepsen.os for the protocol definition, jepsen.os.debian for how we support debian jessie, jepsen.os.centos for centos, etc. You can choose exactly what packages you'd like to install, and, should you like, re-use code from jepsen.os.debian (or any other namespace) by calling the functions in that namespace.

This does not require any modification to Jepsen's source, Jepsen's dependencies, or the dependencies in your test's project.clj. You just need to implement the OS protocol somewhere in your test code, e.g. by using reify or defrecord, and provide code you'd like to run on setup and teardown.

kaibimouez commented 4 years ago

Hallo @aphyr , im testing mongodb tests, i clone it from github and i have this problem and i dont find the dependencies. That show me this problem: Unable to locate package libzip2. thx in advance Mouez Kaibi

aphyr commented 4 years ago

Hi Mouez. What OS are your DB nodes running?

kaibimouez commented 4 years ago

Hallo @aphyr , the nodes are running on Ubuntu 16.04.

aphyr commented 4 years ago

OK, so... see the immediately preceding comment: you're trying to run code on an OS it wasn't designed to talk to.

kaibimouez commented 4 years ago

ok but im running too the 5 nodes on Debian but i still have the same problem. :(

aphyr commented 4 years ago

I'm guessing it's not the version of Debian that test was written for. Libzip's package name changed about a year ago.

kaibimouez commented 4 years ago

when im testing with etcd all is good and the nodes used Libzip4.But now i cloned the mongodb project in aws ec2 instance and when i run lein run test it installed automatically the libzip2. grafik

kaibimouez commented 4 years ago

hallo @aphyr , E: Unable to locate package libzip2 I have this same problem too on Debian OS.

kaibimouez commented 4 years ago

Hallo @qclu , did you find a solution for the problem E: Unable to locate package libzip2. I have this error when im testing mongodb DBMS. Thx in Advance Mouez Kaibi

qclu commented 4 years ago

hi , it is long time ago when I solved this problem.  发自我的华为手机-------- 原始邮件 --------发件人: kaibimouez notifications@github.com日期: 2019年12月12日周四 晚上8:53收件人: jepsen-io/jepsen jepsen@noreply.github.com抄送: Qichao luqichao@163.com, Mention mention@noreply.github.com主 题: Re: [jepsen-io/jepsen] Unable to locate package libzip2 (#267)Hallo @qclu , did you find a solution for the problem E: Unable to locate package libzip2. I have this error when im testing mongodb DBMS. Thx in Advance Mouez Kaibi

—You are receiving this because you were mentioned.Reply to this email directly, view it on GitHub, or unsubscribe.

kaibimouez commented 4 years ago

Hallo @divya2661 , im using now Jepsen and in dont find any solution of this error: E: Unable to locate package libzip2. Have you any idea about it? Thx

kaibimouez commented 4 years ago

Hallo @cxucheng , im using now Jepsen and in dont find any solution of this error: E: Unable to locate package libzip2. Have you any idea about it? Thx

kaibimouez commented 4 years ago

Hallo @aphyr , can i test mongo db DBMS with Jepsen only with Linux distribution debian Jessie?

aphyr commented 4 years ago

As I've said repeatedly in this thread: yes, this test was written for Debian Jessie. You can either upgrade Jepsen in the MongoDB project to a newer version which supports Stretch, or write your own implementation of the OS protocol for your purposes.