I’ve been working on a React App for months that connects on localhost port 9000. Recently the app stopped working after an upgrade to Monterey. Turns out the upgrade also required a number of services to be re-installed via brew. One of those services, php-fpm, is now taking over port 9000 automatically on startup despite not having explicitly set the updated PHP version to run at start.
As such, opening http://localhost:9000/ on the browser was routing to PHP apps and not the node app I was looking for.
MacOS Listing Port Usage
The first step to finding what other services might be fighting with the node app is to run the lsof command.
sudo lsof -i :9000
The :9000 should be replaced with whichever port you are investigating. Port 9000 is the default for most node servers.
In my case the results looked like this:
This tells us that php-fpm will first answer any port 9000 queries on IPV4 localhost.
Node server has been relegated to only answer port 9000 on IPV6.
The node server on IPV6 can be verified by pointing the browser to http://[::1]:9000/ and connecting to the app.
[::1] is the IPV6 syntax for localhost.
Listing Homebrew Services
To stop the php-fpm service it needs to be managed via brew since that is where I started the service from in the first place. The service php-fpm does not exist, so what is calling it? Let’s check brew services…
brew services list
Turns out is is the email@example.com service causing the issue.
Stopping Brew Services
Now that we know which service is fighting with node server we can stop it.
brew services stop firstname.lastname@example.org
That stops php-fpm from intercepting port 9000 traffic on localhost and the original http://localhost:9000 access I was running previously is now back in action.
The new MacBook Pro Retina is now shipping with the soon-to-be ubiquitous USB Type-C ports. There are 4 of them on my new 15″ MacBook Pro. The cool thing about these new ports is they are bi-directional and symmetrical. That means the cable is identical on both ends and there is no upside-down. That is a HUGE step up from all previous iterations of cables and connectors.
In addition the new USB Type-C cables and ports can support video, audio, data, and power. That means the ports can be used to connect headphones, monitors, and power to your devices. For smaller devices like phones that means one port can be used to power your device while at home and the same port is your headphone jack when out roaming around the city.
However there are some key things to be aware of especially when you are talking about the USB Type-C ports and charging devices, especially when looking for a new MacBook power adapter. As many people are learning, not all charging devices and cables are created equal. As happens with any new tech peripheral, China has rushed into the USB Type-C market with dozens of low-quality accessories that are not up to the job. Best case, your device doesn’t charge. Worst case, your device is fried and you start a fire.
Despite having spilled a half-quart of apple juice straight into the innards of my Mid 2014 MacBook Pro Retina, the uptime has been astounding. The only notable time that the system has been offline was during a keyboard replacement just over a year ago. Turns out apple juice, no matter how well you think you’ve cleaned it out of the guts of the MacBook, tends to stick around. Literally. A little less than a year after the mishap one of the keys was stuck as always being pressed. Turns out that makes it hard to boot the system. $1200 (yikes! MacBook repairs from an Apple Authorized Repair Center are costly!) and a few days later and evertyhing was back to new.
Until this week. 14 months later my MacBook Pro system freezes with almost no warning. Last week it was getting sluggish after some software updates and I assumed that was it. This week it would stop responding to keyboard input, then a few moments later the trackpad would stop responding. Evenutally the “Spinning Beachball” or “Spinning Pizza Of Death” (SPOD) comes up and I can no longer close apps or get to the Apple system menu to do a clean restart. My only option was to hold down the power button and do a hard restart. That is not good for the system or my productivity.
The problem has quickly gotten worse. I’ve been learning a few things along the way while I struggle through the problem and try to find a solution that costs less than a new MacBook Pro. My “crib notes” are here for both my future self and to possibly help anyone that stumbles across this article.
Did you know your iOS device can extend the keyboard you use to type just about everything? Installing Google from the Apple play store allows you to activate Maps, Drive, and search from Google. What most people don’t realize is that it also allows you to activate the Gboard as another , and in my opinion better keyboard. For all the cool stuff Apple has done with iOS , the default keyboard is not on that list.
Install the Google app, go to general settings as Nd switch to the Google keyboard now you’ll be happy you did. Add emoji, use a Swype keyboard, add images, and yes search Google from a simple keyboard. Sweet!
Yes you can even add gifs with a simple key press…
Ok, that may be overboard! Maybe.
Google’s great iOS keyboard is now on AndroiD
by Adi Robertson@thedextriarchy Dec 12, 2016, 1:11pm EST
If you’ve not yet updated to OS/X Sierra you may want to wait for the 0.1 release.
Many users experience no issues when upgrading but more than a few are finding they need to do some fairly drastic things to get their system working as normal. There are numerous reports of people doing a simple SMC Reset (hold down Ctrl + Shift + Option and press power) to get things back to normal. Others are having to perform full “clean installs” of Sierra to get things back to normal.
Sierra OS/X Issues
In a brief search for OS/X Sierra problems there seems to be numerous issues related to two critical areas of the operating system: Display Management and Thunderbolt I/O.
Dual Thunderbolt External Monitors
Personally I am having an issue working its way through Apple Support related to the use of dual Thunderbolt-port connected external displays. Whenever I connect and turn on two monitors, one connected to each TB port, the FAN 0 speed slowly cranks up to 6,000 RPM (full throttle). Depending on whether or not I’ve recited the proper black-magic incantations I may-or-may-not be able to turn off one of the two displays and make the fan quickly ramp back down to a normal 2500 RPM. It is interesting to have my external HP monitor button act as though it is wired directly to FAN 0 but that 6,000 RPM fan noise is irritating after about 3.5 seconds.
Apparently there are times when I’ve used the wrong tone or maybe mispronounced an ancient Egyptian God’s name and the simple monitor on/off trick doesn’t work. The system will completely hand and deprive me of the use of my keyboard or mouse after I turn off a monitor; Even after disconnecting all peripherals and opening the laptop to use the track pad on on-board keyboard.
I’ve been using the same hardware, same connections, and same applications for 2 years now (other that a myriad of software upgrades). The only thing that has changed since the “fans working normally” days of last week and the 6,000 RPM mode is having upgraded to OS/X Sierra earlier this week. My guess is someone at Apple buggered a register in the TB I/O code and has overflowed some bits to piss all over other elements of the OS. We’ll see if Sierra *.1 fixes the issue. I can only hope it does.
Looks like my MacBook is at it again – time to sign off… and good luck!
Update: October 19th 2016
What I’ve Learned About The Display Problem
The issue I am having with fan 0 hitting full throttle seems to be related to running both TB ports. For the sake of discussion I am calling the port nearest the power input TB0 and the port closest to the USB input TB1.
The problem appears to triggered by TB0 , but it does require the help of TB1.
Case 1: Reproduction
Plugin HP ZR2440w monitors into TB0 and TB1 using display port.
Make sure TB1 is the primary display.
Start firing up apps. Firefox,Terminal,iMessage,iTunes,Siri,Snagit,Slack in my case then start Photos and the fan quickly ramps up.
Turn off the monitor connected to TB0. The ran immediately starts to ramp down.
Case 2: Add HDMI
Running similar scenarios with the HDMI port pushing video to a third HP ZR2440w seems to have no affect. Whether it is connected or not the results are the same as above when TB0 and TB1 are active. Turn off TB0 and the fans ramp down. Turn on TB0 and the fans ramp back up.
Case 3: Drop TB1
An interesting test case, making TB0 the primary monitor and doing the same exact scenarios above and turning TB1 on/off has no impact on the fan RPM. Once the fan is at 6K RPM it stays that way even though the system clearly shows the TB1 display being dropped from the display stack.
Case 4: TB0 As Primary , Off or Discconnect
This one makes perfect sense when you think about it for a moment; though I do believe OS/X needs to address this as a separate issue. If you make TB0 the primary monitor it will NEVER drop from the display stack. If you turn it off OS/X does not make another display the primary display, keeping the TB0 monitor “in memory”. Same thing if you physically disconnect the TB0 cable. It will NEVER drop.
Because of this turning off or physically disconnecting TB0 while the fan is pegged at 6KRPM has not affect.
If you make TB1 the primary display at this point, OS/X will immediately drop TB0 from the display stack and the fan RPM starts to drop.
Update: October 19th 2016
It Is Siri
Of course it is. The biggest change to OS/X Sierra is the addition of Siri.
Through an errant keyboard click I happened to engage Siri and IMMEDIATELY the fan speed dropped from 6K RPM to a normal 2K RPM. As soon as Siri stopped listening the fan went back to full throttle.
Now that is odd. Repeated tests, same results.
Siri code is toggling SMC registers. Sounds like a buffer overrun to me.
Maybe It’s Not Siri
Turns out that Siri turns off the fans in order to better hear the listener. It seems like Siri is only doing something to force the fan speed to 0 and is not directly related to the issue. An a related note, some gamers have fried their MacBooks because of this by enabling Siri and then getting it stuck that way while running a game. Poof… overheated MacBook. But that’s another issue. No word if the MacBook was completely fried or not but I’m guessing it shut down before that happened.
After the Sierra 10.12.1 patch turning on Siri doesn’t prevent the problem like it had previously. Whenever DP0 + DP1 + HDMI are connected the fan is at 6K RPM. DP0 + DP1 it hovers around 5k RPM. DP0 + HDMI seems better (not great). Turn OFF DP0 and DP1 and the fan almost immediately goes 2K or less RPM.
Maybe Apple support will call me back. It’s been a month with no updates.
Back To El Capitan
Apparently after the initial interest in the problem, Apple decided they couldn’t be bothered with this. Sierra constantly runs the left fan at 5K+ RPM any time the HDMI monitor is attached. I never get a call back from Apple Support when I leave messages these days.
I reverted to El Capitan. Under peak load the left fan is maxing out at less than 4K RPM with all 3 monitors going. Not an apps issue, at least not without “assistance” from macOS Sierra and not a hardware issue.
Apple, you’ve finally failed me on the same level as Microsoft. Boo. I’ll take the 3 hours of downtime in 2 years over countless hours lost to Windows over the same period. Still sucks having gone from 5 minutes of downtime in 2 years to 3 hours and 5 minutes because I had to revert my entire system to a 45-day old backup running El Capitan. That HUGELY SUCKS.
Lesson learned: ignore the future macOS updates from Apple. Since Steve Jobs has gone on to better things Apple has slowly been working its way to mediocrity.