{"record":{"id":"aeda396212a4a3d2","repo":"ankane/pgsync","slug":"command-exited-with-non-zero-status-command","errorCode":null,"errorMessage":"Command exited with non-zero status:\n#{command}","messagePattern":"Command exited with non-zero status:\n#(.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"lib/pgsync/sync.rb","lineNumber":159,"sourceCode":"    def destination\n      @destination ||= data_source(@options[:to], \"to\")\n    end\n\n    def data_source(url, name)\n      ds = DataSource.new(url, name: name, debug: @options[:debug])\n      ObjectSpace.define_finalizer(self, self.class.finalize(ds))\n      ds\n    end\n\n    # ideally aliases would work, but haven't found a nice way to do this\n    def resolve_source(source)\n      if source\n        source = source.dup\n        source.gsub!(/\\$\\([^)]+\\)/) do |m|\n          command = m[2..-2]\n          result = `#{command}`.chomp\n          unless $?.success?\n            raise Error, \"Command exited with non-zero status:\\n#{command}\"\n          end\n          result\n        end\n      end\n      source\n    end\n\n    def self.finalize(ds)\n      # must use proc instead of stabby lambda\n      proc { ds.close }\n    end\n  end\nend\n","sourceCodeStart":141,"sourceCodeEnd":173,"githubUrl":"https://github.com/ankane/pgsync/blob/57bdddf5db506d329b51cb3376379dc3a2559010/lib/pgsync/sync.rb#L141-L173","documentation":"Error \"Command exited with non-zero status:\n#{command}\" thrown in ankane/pgsync.","triggerScenarios":"Thrown at lib/pgsync/sync.rb:159 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"57bdddf5db506d329b51cb3376379dc3a2559010","analyzedAt":"2026-08-23T11:18:48.887Z","schemaVersion":2},"datasetVersion":"2026-08-23T16:17:53.355Z"}