                                     if x.host == '' # special case - the server hosting the project
                                         s = server_id
                                     else
-                                        s = @global_client.servers.by_host[x.host].server_id
+                                        s = targets[x.host]
                                     if not x.error?
                                         last_save[s] = r.timestamp*1000
                                     else

                    dbg("project not running anywhere, so start it somewhere")
                    @start(opts)


    save: (opts) =>
        opts = defaults opts,
            cb : undefined
        # if we just saved this project, return immediately -- note: THIS IS "CLIENT" side, but there is a similar guard on the actual compute node
        if @_last_save? and misc.walltime() - @_last_save < MIN_SAVE_INTERVAL_S
            opts.cb?(undefined)
            return

        # put this here -- we don't even want to *try* more frequently than MIN_SAVE_INTERVAL_S, in case of save bup repo being broken (?)
        @_last_save = misc.walltime()

        dbg = (m) => winston.debug("GlobalProject.save(#{@project_id}): #{m}")

        need_to_save = false
        project      = undefined
        dc           = undefined   # data center where project currently running
        targets      = []          # ['address:port', ...] of replication targets
        server_id    = undefined   # id of the server on which the project is currently running
        errors       = []
        async.series([
            (cb) =>
                dbg("figure out where/if project is running")
                @get_host_where_running
                    cb : (err, s) =>
                        server_id = s
                        if err
                            cb(err)
                        else if not server_id?
                            dbg("not running anywhere -- nothing to save")
                            cb()
                        else if @state?[server_id] == 'saving'
                            dbg("already saving -- nothing to do")
                            cb()
                        else
                            need_to_save = true
                            cb()
            (cb) =>
                if not need_to_save
                    cb(); return
                dbg("get the project itself")
                @project
                    server_id : server_id
                    cb        : (err, p) =>

            (cb) =>
                if not need_to_save
                    cb(); return
                dbg("save the project and sync")
                project.save
                    targets : misc.keys(targets)
                    cb      : (err, result) =>
                        r = result?.result
                        dbg("RESULT = #{misc.to_json(result)}")
