biff

Nik 2025-10-09T13:02:38.566529Z

i spun a new machine and ran biff deploy and got exception for rsync. I'm just trying out something so haven't bought/setup any domain name. Have set DOMAIN=xx.xx.xx.xx in config.env Any idea where should I start looking?

Rebuilding...

Done in 153ms.
Empty source arg specified.
rsync error: syntax or usage error (code 1) at main.c(1515) [sender=3.4.1]
Exception in thread "main" java.lang.IllegalArgumentException: Multiple methods in multimethod 'simple-dispatch' match dispatch value: class babashka.process.Process -> interface clojure.lang.IDeref and interface clojure.lang.IPersistentMap, and neither is preferred
        at clojure.lang.MultiFn.findAndCacheBestMethod(MultiFn.java:179)
        at clojure.lang.MultiFn.getMethod(MultiFn.java:150)
        at clojure.lang.MultiFn.getFn(MultiFn.java:154)
        at clojure.lang.MultiFn.invoke(MultiFn.java:229)
        at clojure.pprint$write_out.invokeStatic(pprint_base.clj:194)
        at clojure.pprint$pprint_map$fn__11151$fn__11153.invoke(dispatch.clj:113)
        at clojure.pprint$pprint_map$fn__11151.invoke(dispatch.clj:113)
        at clojure.pprint$pprint_map.invokeStatic(dispatch.clj:112)
        at clojure.pprint$pprint_map.invoke(dispatch.clj:106)
        at clojure.lang.MultiFn.invoke(MultiFn.java:229)
        at clojure.pprint$write_out.invokeStatic(pprint_base.clj:194)
        at clojure.pprint$pprint_vector$fn__11136.invoke(dispatch.clj:95)
        at clojure.pprint$pprint_vector.invokeStatic(dispatch.clj:94)
        at clojure.pprint$pprint_vector.invoke(dispatch.clj:92)
        at clojure.lang.MultiFn.invoke(MultiFn.java:229)
        at clojure.pprint$write_out.invokeStatic(pprint_base.clj:194)
        at clojure.pprint$pprint_map$fn__11151$fn__11153.invoke(dispatch.clj:113)
        at clojure.pprint$pprint_map$fn__11151.invoke(dispatch.clj:113)
        at clojure.pprint$pprint_map.invokeStatic(dispatch.clj:112)
        at clojure.pprint$pprint_map.invoke(dispatch.clj:106)
        at clojure.lang.MultiFn.invoke(MultiFn.java:229)
        at clojure.pprint$write_out.invokeStatic(pprint_base.clj:194)
        at clojure.pprint$pprint_map$fn__11151$fn__11153.invoke(dispatch.clj:113)
        at clojure.pprint$pprint_map$fn__11151.invoke(dispatch.clj:113)
        at clojure.pprint$pprint_map.invokeStatic(dispatch.clj:112)
        at clojure.pprint$pprint_map.invoke(dispatch.clj:106)
        at clojure.lang.MultiFn.invoke(MultiFn.java:229)
        at clojure.pprint$write_out.invokeStatic(pprint_base.clj:194)
        at clojure.pprint$pprint$fn__10392.invoke(pprint_base.clj:249)
        at clojure.pprint$pprint.invokeStatic(pprint_base.clj:248)
        at clojure.pprint$pprint.invoke(pprint_base.clj:241)
        at clojure.pprint$pprint.invokeStatic(pprint_base.clj:245)
        at clojure.pprint$pprint.invoke(pprint_base.clj:241)
        at clojure.lang.Var.invoke(Var.java:384)
        at clojure.main$report_error$fn__9280$fn__9281.invoke(main.clj:603)
        at clojure.main$report_error$fn__9280.invoke(main.clj:602)
        at clojure.main$report_error.invokeStatic(main.clj:601)
        at clojure.main$main.invokeStatic(main.clj:666)
        at clojure.main$main.doInvoke(main.clj:616)
        at clojure.lang.RestFn.applyTo(RestFn.java:137)
        at clojure.lang.Var.applyTo(Var.java:705)
        at clojure.main.main(main.java:40)

Nik 2025-10-10T07:18:21.509579Z

I opened my workspace and fired up the editor and first thing I saw was the post project creation command list Which mentions initialising git repo and making first commit 🤦‍♂️ I was too preoccupied with the changes and making sure remote is all setup that I forgot these steps Afterwards biff deploy worked like a charm

2025-10-10T10:28:24.951969Z

nice! next time I'm working on tasks I'll see about maybe adding a quick check/error message for that.

👍🏼 1
2025-10-09T14:23:09.141989Z

hm, I would expect that setting DOMAIN to the ip address as you've done would work. This is the code that runs rsync: https://github.com/jacobobryant/biff/blob/12d4ac6fab14f60cb6091609e0eed886bc168ec1/libs/tasks/src/com/biffweb/tasks.clj#L135 since your output mentions Empty source arg specified., I wonder if files is empty... which seems impossible since at a minimum it should include config.env (via deploy-untracked-files), even if you haven't made a git commit yet. Anyway it would be great to see what exactly is the rsync command that's running. You can put this in your dev/tasks.clj file:

(ns tasks
  (:require
   [babashka.fs :as fs]
   [clojure.java.shell :as sh]
   [clojure.string :as str]
   [com.biffweb.tasks :as tasks]))

(defn- push-files-rsync-command [{:biff.tasks/keys [server deploy-untracked-files]}]
  (let [files (->> (:out (sh/sh "git" "ls-files"))
                   str/split-lines
                   (map #(str/replace % #"/.*" ""))
                   distinct
                   (concat deploy-untracked-files)
                   (filter fs/exists?))]
    (concat ["rsync" "--archive" "--verbose" "--relative" "--include='**.gitignore'"
             "--exclude='/.git'" "--filter=:- .gitignore" "--delete-after" "--protocol=29"]
            files
            [(str "app@" server ":")])))

(defn debug-rsync []
  (let [config @@#'tasks/config]
    (prn (push-files-rsync-command config))))

;; Tasks should be vars (#'hello instead of hello) so that `clj -M:dev help` can
;; print their docstrings.
(def custom-tasks
  {"debug-rsync" #'debug-rsync})

(def tasks (merge tasks/tasks custom-tasks))
Then run biff debug-rsync to see the rsync command that biff deploy will use. e.g. if I set DOMAIN=1.2.3.4 in config.env, I get:
$ clj -M:dev debug-rsync
("rsync" "--archive" "--verbose" "--relative" "--include='**.gitignore'" "--exclude='/.git'" "--filter=:- .gitignore" "--delete-after" "--protocol=29" "target/resources/public/css/main.css" "config.env" ".dockerignore" ".gitignore" "Dockerfile" "README.md" "cljfmt-indents.edn" "deps.edn" "dev" "resources" "server-setup.sh" "src" "test" "app@1.2.3.4:")
If the output you get looks correct, you could try running the rsync command in your terminal and see if you can reproduce the error.