3

Got a weird problem, possibly with bash or oh-my-zsh, or possibly Heroku, but I can't tell. In ~/.oh-my-zsh/custom/aliases.zsh I have:

alias work="cd ~/Dropbox/work/firmplay"
alias rmrm="rake db:migrate && rake db:rollback && rake db:migrate"
alias sconsole="heroku run rails c -a staging-firmplay"
alias pconsole="heroku run rails c -a firmplay"
alias slogs="heroku logs -n5000 -t -a staging-firmplay"
alias plogs="heroku logs -n5000 -t -a firmplay"
alias status="git status"

I’ve used the plogs alias a million times to pull up my app’s logs and have never had a problem. Suddenly this afternoon it stopped working. I haven’t installed any updates to iTerm2 or oh-my-zsh. I haven’t even opened the aliases.zsh file in over 2 years. I was just working on something, pushed a change to production, tried to open the logs with plogs, and found it not working. See error below:

➜  firmplay git:(master) plogs
 ▸    Response code 404 (Not Found)

I thought it might be a problem with Heroku, but when I run the command (heroku logs -n5000 -t -a firmplay) itself, it works fine. Additionally and very weirdly, my other aliases still work fine. I've tried restarting my shell session but that makes no difference. I've tried adding source ~/.oh-my-zsh/custom/aliases.zsh to my ~/.zshrc file as well as just moving the aliases themselves into that file, but that had no effect.

Here is what ~/.zshrc looks like:

# Path to your oh-my-zsh installation.
export ZSH=$HOME/.oh-my-zsh

# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="robbyrussell"

# Uncomment the following line to use case-sensitive completion.
# CASE_SENSITIVE="true"

# Uncomment the following line to disable bi-weekly auto-update checks.
# DISABLE_AUTO_UPDATE="true"

# Uncomment the following line to change how often to auto-update (in days).
# export UPDATE_ZSH_DAYS=13

# Uncomment the following line to disable colors in ls.
# DISABLE_LS_COLORS="true"

# Uncomment the following line to disable auto-setting terminal title.
# DISABLE_AUTO_TITLE="true"

# Uncomment the following line to enable command auto-correction.
# ENABLE_CORRECTION="true"

# Uncomment the following line to display red dots whilst waiting for completion.
# COMPLETION_WAITING_DOTS="true"

# Uncomment the following line if you want to disable marking untracked files
# under VCS as dirty. This makes repository status check for large repositories
# much, much faster.
# DISABLE_UNTRACKED_FILES_DIRTY="true"

# Uncomment the following line if you want to change the command execution time
# stamp shown in the history command output.
# The optional three formats: "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
# HIST_STAMPS="mm/dd/yyyy"

# Would you like to use another custom folder than $ZSH/custom?
# ZSH_CUSTOM=/path/to/new-custom-folder

# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(git)

source $ZSH/oh-my-zsh.sh

# User configuration

export PATH="/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/git/bin"
# export MANPATH="/usr/local/man:$MANPATH"

# You may need to manually set your language environment
# export LANG=en_US.UTF-8

# Preferred editor for local and remote sessions
# if [[ -n $SSH_CONNECTION ]]; then
#   export EDITOR='vim'
# else
#   export EDITOR='mvim'
# fi

# Compilation flags
# export ARCHFLAGS="-arch x86_64"

# ssh
# export SSH_KEY_PATH="~/.ssh/dsa_id"

# Set personal aliases, overriding those provided by oh-my-zsh libs,
# plugins, and themes. Aliases can be placed here, though oh-my-zsh
# users are encouraged to define aliases within the ZSH_CUSTOM folder.
# For a full list of active aliases, run `alias`.
#
# Example aliases
# alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"
source /usr/local/share/chruby/chruby.sh
source /usr/local/share/chruby/auto.sh

export PATH="/usr/local/bin:$PATH"
export PATH=$PATH:/Applications/Postgres.app/Contents/Versions/9.6/bin
export EDITOR="/usr/local/bin/atom --wait"
export PATH=$PATH:/usr/local/Library/Formula/
unsetopt nomatch
4
  • Are you using bash or zsh (your first sentence is unfortunately not clear to me)? Check which plogs, which heroku. If this does not give you a clue, start from a clean shell (zsh- f) and try to define the alias manually. If it's working then, load your config line by line and check when the command stops working as expected.
    – mpy
    Aug 11 '17 at 18:41
  • Probably could've worded that better but it seems to have been with zsh. In any case, I rebooted my computer and haven't been able to reproduce the issue since. Aug 13 '17 at 3:50
  • Since you can't reproduce this anymore, can you close this question, please? Jun 27 '20 at 22:34
  • I’m voting to close this question because issue was resolved with a reboot and is no longer reproducible
    – DavidPostill
    Aug 13 '20 at 11:38

Browse other questions tagged or ask your own question.