@@ -93,7 +93,7 @@ func main() {
9393 var err error
9494 cfg , err = config .New ()
9595 if err != nil {
96- multilog .Error ("Could not set up configuration handler: " + errs .JoinMessage (err ))
96+ multilog .Critical ("Could not set up configuration handler: " + errs .JoinMessage (err ))
9797 fmt .Fprintln (os .Stderr , err .Error ())
9898 exitCode = 1
9999 }
@@ -108,7 +108,7 @@ func main() {
108108 Interactive : false ,
109109 })
110110 if err != nil {
111- multilog .Error ("Could not set up output handler: " + errs .JoinMessage (err ))
111+ multilog .Critical ("Could not set up output handler: " + errs .JoinMessage (err ))
112112 fmt .Fprintln (os .Stderr , err .Error ())
113113 exitCode = 1
114114 return
@@ -148,7 +148,7 @@ func main() {
148148 "state-installer" ,
149149 "" ,
150150 "Installs or updates the State Tool" ,
151- primer .New (nil , out , nil , nil , nil , nil , cfg , nil , nil , an ),
151+ primer .New (out , cfg , an ),
152152 []* captain.Flag { // The naming of these flags is slightly inconsistent due to backwards compatibility requirements
153153 {
154154 Name : "command" ,
@@ -251,6 +251,8 @@ func execute(out output.Outputer, cfg *config.Instance, an analytics.Dispatcher,
251251
252252 an .Event (anaConst .CatInstallerFunnel , "exec" )
253253
254+ usingDefaultInstallPath := params .path == ""
255+
254256 if params .path == "" {
255257 var err error
256258 params .path , err = installation .InstallPathForChannel (constants .ChannelName )
@@ -296,6 +298,17 @@ func execute(out output.Outputer, cfg *config.Instance, an analytics.Dispatcher,
296298 return errs .Wrap (err , "Could not check if install path is empty" )
297299 }
298300 if ! empty {
301+ if usingDefaultInstallPath {
302+ // We're having trouble pinning down why these errors are occurring, so report the list of
303+ // existing files to Rollbar to help diagnose.
304+ if files , err := os .ReadDir (params .path ); err == nil {
305+ fileList := []string {}
306+ for _ , file := range files {
307+ fileList = append (fileList , filepath .Join (params .path , file .Name ()))
308+ }
309+ rollbar .Critical ("Installation path must be an empty directory: %s\n Existing files:\n %s" , params .path , strings .Join (fileList , "\n " ))
310+ }
311+ }
299312 return locale .NewInputError ("err_install_nonempty_dir" , "Installation path must be an empty directory: {{.V0}}" , params .path )
300313 }
301314 }
0 commit comments