ankane/pgsync · error · Error

Schema sync returned non-zero exit code

Error message

Schema sync returned non-zero exit code

What it means

Error "Schema sync returned non-zero exit code" thrown in ankane/pgsync.

Source

Thrown at lib/pgsync/schema_sync.rb:54

      success =
        run_command(dump_command, restore_command) do |line|
          if show_spinner
            lines << line
          else
            log line
          end
        end

      if show_spinner
        if success
          spinner.success
        else
          spinner.error
          log lines.join
        end
      end

      raise Error, "Schema sync returned non-zero exit code" unless success
    end

    private

    def run_command(dump_command, restore_command)
      err_r, err_w = IO.pipe
      Open3.pipeline_start(dump_command, restore_command, err: err_w) do |wait_thrs|
        err_w.close
        err_r.each do |line|
          yield line
        end
        wait_thrs.all? { |t| t.value.success? }
      end
    end

    # --if-exists introduced in Postgres 9.4
    # not ideal, but simpler than trying to parse version
    def supports_if_exists?

View on GitHub (pinned to 57bdddf5db)

When it happens

Trigger: Thrown at lib/pgsync/schema_sync.rb:54 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of ankane/pgsync@57bdddf5db (2026-08-23). Data as JSON: /api/errors/dabfb20b01f2d533. Report an issue: GitHub.