Sweet Patience

When one thing breaks and another, it's important to stay focused and not let your frustration cloud your ability to think and keep persisting towards a resolution!

Sweet Patience

Something I have come to realize pretty late about working in Engineering, is that patience is very sweet. What do I mean by this? For many people, patience is something that many people undervalue. For example, you can have the technical knowledge of an area in Engineering, but if you don't have patience then it will be difficult to continue working on something, especially if that something you are working on has not been resolved over a lengthy period of time. Persistent being a synonym of patient, is something that I consider one of the most difficult traits to develop. I myself still struggle with this trait till this day and I even consider it being one of my most dominant traits! However, being one my strongest traits does not necessarily make me immune to getting frustrated or anxious about something that is broken. Unfortunately I had this happen to me just this past weekend.

Downtime Funtime

Over the weekend, I had restarted my local computer to finish applying some Windows Updates. I then went directly to manage my site and my login credentials were not working. I tried to input a few passwords I last remembered I used to set up Ghost without locking myself out, and still nothing was working. So instead I clicked on the reset my password button by inputting my email, and received a vague error saying my request to the server took too long. I googled how to reset my Ghost password and came across this guide and this one too. I used both guides and included them because although they accomplish the same thing, I am the type of person that likes to cross check and not just go by one guide especially if a guide is outdated! I do feel that the latter guide is more thorough and detailed which I am a fan of. However everyone is different and so they prefer information to be presented differently. After resetting my Ghost admin password, I was able to successfully login to the admin panel of my site. And to just keep calm, I logged out and logged back in to make sure no strange occurrences were to occur. Everything was working as expected. No issues whatsoever. For now.

Can't Host a Website If Your Nginx Is Broken

The next day I came across this error. The day before I had run:

sudo apt-get update

as well as restarted my Ubuntu Server instance. The output from running the command did not prompt for a restart. However I'm a fan of restarting at least once a week or every 2 weeks at most. I came across numerous forums for help with the error and ultimately came across someone else who experienced the same exact issue as me! However they mentioned they had updated Ghost which I DID NOT do since there is a specific command in the Ghost CLI for it which is:

Ghost Update

Upon checking the error logs for Nginx located in /var/log/nginx, I saw an incorrect port number the same one the post listed 2368 tied to my upstream server. When I ran:

sudo lsof -i -P -n | grep LISTEN

the output showed that both node and ghost were listening on a different port which was 2369.

Right away I got excited. However I had not made any changes right away as it was pretty late into the night early morning that I needed to take some rest. Upon getting some rest and back into the action, another issue occurred that thankfully I was able to resolve within 15 minutes. The issue was that I accidentally enabled ufw which stands for uncomplicated firewall which is available by default in all Ubuntu installations after 8.04 LTS. I did not know why I ended up enabling ufw but what happened was that I was unable to access my Ubuntu Server instance. Luckily I came across this post in Stack Overflow which helped me gain back access!

Making the Changes in Nginx Sites-Available Conf

In the directory /etc/nginx/sites-available, you should see two files named after your site. So it will be something like example.com-ssl.conf, and example.com.conf respectively. Open whichever file first using either vi or nano and make sure to change the port number to the correct one in both files. Save your changes and MAKE SURE TO REBOOT your instance!!

Make sure you correctly make changes to BOTH files, SAVE changes, and lastly REBOOT your instance! 

Patience is Well Rewarding

I hope not only was this post helpful, but most importantly a wake up call for many including myself. Patience is something we all struggle with. However the reward of being patient is something very valuable to me and many. As I said in the beginning I consider it one of the most difficult traits to develop. It's fine to get frustrated and anxious about something you've tried dozens of times, numerous forums and posts you've read, and nothing works. Just remember that everything you do in troubleshooting you gain experience. I knew I was going to come across issues such as these when deciding to host my own site. However I do not regret it at all! I am learning which is very important despite the struggle. That is why patience is very sweet and well rewarding.