Troubleshooting in the shell

 





How to resolve commonly faced issues

The purpose of this guide is to provide some guidance to troubleshooting some recurring issues on the development server.

Possible trouble areas

  • Frontend 

  • Git workflows

  • Voice Telephony

  • Development servers


Everything is logged on a development server so as a general rule of thumb always check logs if there are any to assist in finding a solution. For example, if it is a PHP log, it is likely to be found here:

/usr/local/apache/logs/error_log

Frontend

Let’s say that you’re unable to access the web page due to a “Whoops Error”. There could be a number of reasons. If the stack trace includes [STALE WEBPACK-MIX ASSETS], running 


yarn install --check-files && yarn prod 


on the development server will safely bring the web app back. 


What actually happens

Yarn will fetch and rebuild the web assets and you should be able to use the web application afterwards.

What if you’re still unable to access the web app? Sometimes performing a hard reload by holding 

CTRL + SHIFT + R will remove cached data.


Git workflows

---Does the branch exist on my local? If yes, have I fetched changes onto local repo?

However, there are instances where you could face issues checking out a branch or updating a branch.

If you encounter an error like error: pathspec 'feature/branch-XYZ' did not match any file(s) known to git,

but you are certain the branch exists, you’ll need to track the branch yourself.


git branch -track [branch-name] origin/[branch-name]


There are cases where you are not able to checkout a branch because there may be local changes on the development server. Git recommends you stash those changes, or if you are willing to reset your changes, you can do a forced checkout. 


NB. 1. If you're working on a development server, you are not supposed to be live editing servers but it is still acceptable only when absolutely necessary. In this case you can safely discard the changes on the server and checkout to your branch.

   

Development Servers

Sometimes server issues may come from caching. Removing the cached files will usually resolve the issues.  

Sometimes the logs will give you a hint about the errors that are occurring on the development server, they may not be related to what you're doing at all.

You may encounter this error(check image below) while performing a rollback on a migration. This may due to the app running cached files.


Run the following commands
- php artisan clear-compiled

- composer dump-autoload

- php artisan optimize

Then Rollback again. The error should be gone.

This is all I can think of. For now.



Comments

Popular posts from this blog

Coffee Culture in Ghana

The Nostalgic Resurgence of Shounen Anime

Writing Automated Tests with Kotlin