Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gitstatus failed to initialize #102

Closed
letstakeawalk opened this issue Feb 18, 2020 · 9 comments
Closed

gitstatus failed to initialize #102

letstakeawalk opened this issue Feb 18, 2020 · 9 comments

Comments

@letstakeawalk
Copy link

$ GITSTATUS_LOG_LEVEL=DEBUG GITSTATUS_NUM_THREADS=2 GITSTATUS_DAEMON=/Users/HRB/.oh-my-zsh/custom/themes/powerlevel10k/gitstatus/bin/gitstatusd-- gitstatus_start -s -1 -u -1 -d -1 -c -1 -m -1 -a POWERLEVEL9K
gitstatus_start:201: command not found: rm
[ERROR]: gitstatus failed to initialize.

  Your git prompt may disappear or become slow.

  The content of /var/folders/26/rm7bwnzj6p78hmz2hm5shyth0000gn/T//gitstatus.61448.xtrace.1581999696.2669839859.15817 (gitstatus_start_impl xtrace):

gitstatus_start:218: command not found: awk
                               ^ this command failed

  Your system information:

    zsh:      5.7.1
gitstatus_start:233: command not found: uname
    uname -a: 

  If you need help, open an issue and attach this whole error message to it:

    https://github.com/romkatv/gitstatus/issues/new
$ 

Hi, I started to use powerlevel10k today, and everything was working just fine until I got this error message. For some reason, git status stopped working.
Please help!

@letstakeawalk
Copy link
Author

I found a bug in my newly inserted PATH in my .zshrc, and the git now works. However, following message comes out every time I launch zsh.

[ERROR]: gitstatus failed to initialize.

  Your git prompt may disappear or become slow.

  The content of /var/folders/26/rm7bwnzj6p78hmz2hm5shyth0000gn/T//gitstatus.62450.xtrace.1582000591.9028229713.23161 (gitstatus_start_impl xtrace):

    +gitstatus_start_impl:6> ((  daemon_pid == -1  ))
    +gitstatus_start_impl:7> local os
    +gitstatus_start_impl:8> local daemon=/Users/HRB/.oh-my-zsh/custom/themes/powerlevel10k/gitstatus/bin/gitstatusd--
    +gitstatus_start_impl:9> [[ -n /Users/HRB/.oh-my-zsh/custom/themes/powerlevel10k/gitstatus/bin/gitstatusd-- ]]
    +gitstatus_start_impl:16> [[ -x /Users/HRB/.oh-my-zsh/custom/themes/powerlevel10k/gitstatus/bin/gitstatusd-- ]]
                               ^ this command failed

  Your system information:

    zsh:      5.7.1
    uname -a: Darwin HRBs-MBP.home 19.3.0 Darwin Kernel Version 19.3.0: Thu Jan  9 20:58:23 PST 2020; root:xnu-6153.81.5~1/RELEASE_X86_64 x86_64

  If you need help, open an issue and attach this whole error message to it:

    https://github.com/romkatv/gitstatus/issues/new

@letstakeawalk letstakeawalk changed the title Gitstatus stopped working. (git status_start:218: command not found: awk) gitstatus failed to initialize Feb 18, 2020
@jcgay
Copy link

jcgay commented Feb 18, 2020

Hi, also using powerlevel10k since months, all was fine until I open a new shell yesterday:

[ERROR]: gitstatus failed to initialize.

  Your git prompt may disappear or become slow.

  The content of /var/folders/gr/nnxk8tl55q72v2rhzj5l9vcxz2pqp9/T//gitstatus.8239.xtrace.1582007151.3710100651.4113 (gitstatus_start_impl xtrace):

    +gitstatus_start_impl:6> ((  daemon_pid == -1  ))
    +gitstatus_start_impl:7> local os
    +gitstatus_start_impl:8> local daemon=/Users/jcgay/Library/Caches/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-romkatv-SLASH-powerlevel10k/gitstatus/bin/gitstatusd--
    +gitstatus_start_impl:9> [[ -n /Users/jcgay/Library/Caches/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-romkatv-SLASH-powerlevel10k/gitstatus/bin/gitstatusd-- ]]
    +gitstatus_start_impl:16> [[ -x /Users/jcgay/Library/Caches/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-romkatv-SLASH-powerlevel10k/gitstatus/bin/gitstatusd-- ]]
                               ^ this command failed

  Your system information:

    zsh:      5.7.1
    uname -a: Darwin vid01870.home 19.3.0 Darwin Kernel Version 19.3.0: Thu Jan  9 20:58:23 PST 2020; root:xnu-6153.81.5~1/RELEASE_X86_64 x86_64

@romkatv
Copy link
Owner

romkatv commented Feb 18, 2020

Ouch, that looks bad. Thanks for reporting this!

I'll need a bit more information to figure out what's going on. Please run the following command and attach /tmp/p10k.txt to this issue (you can drag-and-drop files to the end box on github):

() {
  emulate -L zsh -o xtrace
  typeset -pm '__p9k_dump_file|_p9k_uname_*'
  if (( $+__p9k_dump_file )); then
    ls -l $__p9k_dump_file{,.zwc}
    grep '_p9k_uname_' $__p9k_dump_file
    (
      unset -m '_p9k_*'
      unset -fm _p9k_restore_state_impl
      source $__p9k_dump_file
      echo $?
      _p9k_restore_state_impl
      echo $?
      typeset -pm '_p9k_uname_*'
    )
  fi
} &>/tmp/p10k.txt

@letstakeawalk
Copy link
Author

letstakeawalk commented Feb 18, 2020

Thanks for the quick reply!
After googling for a couple of hours for a solution, I decided to comment out plugins=(git) from .zshrc, and vcs from PROMP_ELEMENT list > .p10k.zsh to avoid error message keep popping up.
Now, as I uncomment those two lines to reproduce the error message so that I can get the p10k.txt file, the error message is gone! I really have no idea why/how it went away. It seems like my issue has been solved.
Thank you for your amazing theme + plugin @romkatv!

I will leave this issue open for @jcgay. PEACE!

@romkatv
Copy link
Owner

romkatv commented Feb 18, 2020

@ryanbyon Glad it's working for you now.

@jcgay Please don't change anything in your settings yet. Run the command first. Those logs are vital for fixing this issue.

@jcgay
Copy link

jcgay commented Feb 18, 2020

Sure, here it is: p10k.txt

Thanks for the help 😇

@romkatv
Copy link
Owner

romkatv commented Feb 18, 2020

@jcgay Thanks!

It appears that there was an issue with PATH on your machine that caused all system commands to fail. Things like uname and sysctl didn't work. They work now, but the results of previous calls (all empty) got cached, so powerlevel10k is still broken.

Does this sound plausible? Did you have invalid PATH recently with everything failing?

Please run the following command to wipe powerlevel10k cache and restart Zsh:

rm $__p9k_dump_file{,.zwc} && exec zsh

This should fix your prompt. Please let me know whether it did or didn't.

I'll fix powerlevel10k so that it doesn't cache obviously invalid output of uname.

@jcgay
Copy link

jcgay commented Feb 18, 2020

Oh yes, I have messed up with my PATH one time yesterday :(
Removing the cache solves the problem 👍

Thanks again (and sorry for the noise :p).

@romkatv
Copy link
Owner

romkatv commented Feb 18, 2020

Thanks for the confirmation that wiping the cached fixed the problem.

And thanks again for reporting the bug! Powerlevel10k isn't supposed to fail like that. Working on a fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants