Ember serve: every port is in use - ember.js

When I specify no port or set the port explicitly, I always see:
ember serve --port 4207
Port 4207 is already in use.
It doesn't seem to matter which port I pick.
When I start with port 0 (let the cli pick an available port) it starts on on something around 30000~40000.
I am on a Mac. I just upgraded my ember-cli to 3.12.0
Also: If I start another ember app I have locally, it will run on port 4200. But then I stop it and start the above app and it won't start on that port.
What is wrong here?

portfinder, which is a subdependency of Ember CLI, released a new version 1.0.22 a few hours ago (August 17, 2019). That one breaks ember serve. You will see a port in use error for all ports.
If you are unsure which version of portfinder is used in your project, you could run yarn why portfinder or npm list | grep portfinder.
Update: portfinder#1.0.23 was released today (August, 19 2019). It rolls back to 1.0.21 and therefore fixes the issue. You should upgrade to that new release.
The following work-a-rounds are outdated by new release of portfinder.
There are two work-a-round known so far:
1. Downgrading portfinder to 1.0.21.
You could use yarn's resolutions feature to do so. Add this to your package.json:
"resolutions": {
"ember-cli/portfinder": "1.0.21"
}
Don't forget to run yarn install afterwards.
If using npm, you could enforce installing dependencies released before today using the --before option: npm install --before 2019-08-16
2. Using ember serve --port 0
You could start ember serve with --port 0 argument. In that case portfinder picks up a random port. This seems to work. The port used is reported in terminal, e.g.
Build successful (1911ms) – Serving on http://localhost:18780/
The bug is reported here. Hopefully it will be resolved soon.

Related

Get err_connection_refused accessing django running on wsl2 from Windows but can curl from Windows terminal

I got the err_connection_refused when trying to accessing django running on wsl2 (http://localhost:8000) from Windows but when I use curl http://localhost:8000 from Windows terminal bash, it's working fine. I have tried to add a new firewall inbound rule for port 8000 but it's still not working. Is there anything else I need to take care of.
Thanks a lot
Seems like a forwarding problem. WSL2's interface is NAT'd, whereas WSL1 was bridged by default. WSL seems to do some "auto-forwarding" of ports, but only on localhost. However, sometimes this auto-forwarding mechanism seems to "break down". The main culprit seems to be hibernation or Windows Fast Startup (which are both closely-related features).
Does the problem resolve if you do a wsl --shutdown and then restart the WSL2 session? If so, try disabling Windows' Fast Startup. I already had Fast Startup disabled due to a different (non-WSL issue) on my system, so that could be related to why I am not able to reproduce.
Along the same lines, do you Hibernate instead of powering off? In that case, a wsl --shutdown might resolve as well.
For future readers, note that the above two points seem to resolve the issue for most people who have upvoted and responded in the comments. However, if that does not work for you, the following were my original "additional suggestions":
For some additional ideas, see this github issue. There are some suggestions on services that might be needed. (Side question - Are you running Windows Home or Professional?)
Is there any chance that your Windows hosts file (e.g. c:\windows\system32\drivers\etc\hosts) points localhost to an IP other than 127.0.0.1? If I attempt to access via my local Windows IP address, rather than 127.0.0.1 or localhost, I get an ERR_CONNECTION_REFUSED as well.
Since you were looking at the firewall rules, maybe look at a forwarding rule instead of just an inbound allow?
If all else fails, try exporting/backing up the WSL2 session (see wsl --export), then import it in as a new WSL1 session. See if it works there.
On my WSL2/Ubuntu 20.04 system, I attempted to reproduce (but haven't been able to yet) with the following steps:
mkdir -p ~/src/dj-test
cd ~/src/dj-test
python3 -m venv dj
source dj/bin/activate
pip install Django
django-admin startproject config .
python manage.py runserver
(although I used activate.fish since I'm running the fish shell)
From Vivaldi web browser in Windows, accessed localhost:8000, which returned "The install worked successfully! Congratulations! ..."
curl under Powershell Core worked as well.

Ambari-agent "CERTIFICATE_VERIFY_FAILED", Is it safe to disable the certificate verification in Python?

Ambari version: 2.2.2.18
HDP stack: 2.4.3
OS: centos 7.3
Issue description:
Ambari-server can't communicate with Ambari agent. I can see below error in the ambari-agent logs:
ERROR 2017-09-18 06:35:34,684 NetUtil.py:84 - [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:579)
ERROR 2017-09-18 06:35:34,684 NetUtil.py:85 - SSLError: Failed to connect. Please check openssl library versions.
I am facing this issue recently and it appears this can be replicated consistently after the instances are restarted. (I am using EC2 instances).
I am able to register agent nodes successfully, install HDP cluster, run yarn jobs etc.. no problem at all. Once i restart my instances, I see this problem.
There are some solutions already posted for this problem like:
Downgrade the Python from 2.7 to lower. This is a known problem of
Ambari with Python 2.7
Control the certificate verification by disabling it.
Set "verify = disable"; under /etc/python/cert-verification.cfg
I don't want to play with Python as it can disrupt lot many things like Cassandra, yum package manager etc...
Second work around is very much easy and it works well!
Now comes my question :- Is it safe to disable the certificate verification in Python ? i.e. by setting property verify = disable
Generally, it's a bad idea. If somebody has access to port on server that is used for agent-server communication (8443 if I'm not mistaken), he can register as agent and get all your cluster configs&passwords. Or classic man-in-the-middle attack would allow to do the same by reading your unencrypted traffic. A bit more difficult attack would allow to send commands to agents (probably with root permissions).
Your issue sounds like you reprovisioned your ambari-server host, and left old ambari-agent instances running, or maybe your certificates became outdated? At first connection to ambari-server, agents generate certificates and send to server. Server signs these certificates with it's own key, so now server-agent connection is encrypted. Did you try to remove old certificates and restart server&agents as suggested here?
How did we investigate this issue and What solution we adopted:
Investigation Details:
Downgrading to Python 2.6 is not feasible as there are OS dependencies and as per Suggestion from 'Dmitriusan' in the previous comment, it's not a good idea to disable certificate verification in Python.
We use AWS EC2
With Python 2.7, JDK 1.8 and Cent OS 7.2 there is no issue. Everything is smooth.
With Python 2.7, JDK 1.8 and Cent OS 7.3 and Centos 7.4 we are seeing this issue.
Issue which I have reported here, is with respect to Centos 7.3 and with Centos 7.4 Issue is slightly different. Certificate verification fails while adding nodes to the cluster itself.
Downgrading from centos 7.3 to 7.2 is not straight forward. And AWS EC2 market place provides Centos 7.0 Image and when we create instance from this image, it applies security and patch updates resulting in Centos 7.3.
We can create our own Image of Centos 7.2 from existing servers but, It's always good to be with the latest update for the OS for security reasons.
To describe it shortly, we had workarounds but not a solution.
Solution which we adopted:
After series of tests, we decided to upgrade to Centos 7.4, HDP-2.6.3.0, and Ambari 2.6.0.0
With Centos 7.4 and Ambari Version 2.6.0.0, we don't see this issue even though I have 'Python 2.7.5' installed.
So this looks to be an Issue with Ambari
Older version of Ambari (2.4.2) does not recognize the force TLS configuration. We upgraded Ambari to 2.6.2 and heart beat started working.

Docker with tcp:// and --tls in WebStorm IDE

I'd like to use the WebStorm IDE (Windows) to manage my Docker images. For the local installation it works perfectly fine, but I have problems with my secured instance.
I can connect with the following command:
docker -H tcp://<<URL>>:<<PORT>> --tls --tlskey <<path_to_key>>/key.pem --tlscert <<path_to_cert>>/cert.pem info
so I guess I just need the option to enable tls.
Does WebStorm or IntelliJ have this option?
As of 2019.1 (maybe earlier), it is possible (but appearently undocumented) to connect to a TLS-enabled docker daemon. Simply use https://<host>:2376 instead of tcp://<host>:2376 and make sure you either set the certificate directory or have your certificates in ~/docker/. The files must be named ca.pem, cert.pem and key.pem.
Update: As I also just found out, in 2019.1 remote docker interpreters only work with Dockerfiles, not with docker-compose.
There is no such option in PhpStorm 2017.3 EAP #PS-173.3415.21 (which should be pretty much the same), and also the docs for 2017.2 state, that you need to either use Unix socket or tpc without tls (https://www.jetbrains.com/help/phpstorm/docker.html#docker_settings).

Ember CLI livereload does not detect changes

Livereload
I'm having problems getting Ember CLI (1.13.15) to detect changes. When I create a new application with
ember init
And run the development server with
ember serve
The project compiles and I see the page. When I change something, the server detects changes in the console, but nothing happens even if I refresh page. The changes become visible only after I rerun the ember serve
Slow build
Also on an empty app it takes 30 sec to build app on Samsung 850 Pro SSD & i7 2600k with admin rights and after ember-cli-windows run. (the build on half slower MacBook Air is almost instantaneous).
Versions
Windows 10 with all the updates
ember-cli: 1.13.15
node: 4.2.6
npm: 2.14.10
I just encountered this as well -- seemingly out of nowhere, at once, on several different projects. Making sure I had this in .ember-cli was a winning fix:
"liveReload": true,
"watcher": "polling"
[Update]
I already had liveReload: true, so adding the watcher setting seems to be what was needed. Furthermore the projects that I implemented this for were using ember-cli at 1.13.13, 2.2.0-beta.6 and 2.3.0-beta.1, with the following system config:
node: 4.2.4
npm: 2.14.10
os: darwin x64
There's currently a known issue in ember-cli where the open port for livereload isn't detected correctly (https://github.com/ember-cli/ember-cli/pull/5391). You should be able to get around this for now by running ember serve --host 0.0.0.0.
For now, the best solution seems to be sticking to the old versions. Also there seems to be an issue with latest sass plugin not recognizing changes so I recommend downgrading both to:
ember-cli: 1.13.8,
ember-cli-sass: 4.2.1

How do I install Jetty WTP Server Adapter for Eclipse 3.5?

Currently I am attempting to install the Jetty WTP Server Adapter for Eclipse 3.5 and get the following errors:
An error occurred while collecting items to be installed session context was:(profile=epp.package.jee,phase=org.eclipse.equinox.internal.provisional.p2.engine.phases.Collect, operand=, action=).
No repository found containing: osgi.bundle,org.mortbay.jetty.serveradaptor,1.0.4
No repository found containing: org.eclipse.update.feature,org.mortbay.jetty.serveradaptor,1.0.4
To install, I attempt to add a new server runtime, click 'Install Additional Server Adapters' and follow the wizard I get when I click on the Generic Jetty Server Adapter that eventually loads. I've had this error in all the RCs up to this point, but currently the active RC is RC4.
I also found the 'Download additional server adapters" route to adding the Jetty (and Glassfish) server adapters failed, with the same dependency issues as the Original Poster.
Downloading the .jar and copying it into the 'plugins' dir of my Eclipse install idd not work. The Jetty server adapter was still not a recognised installed plugin.
I had to go to "Help->Install New Software->Add..." and enter the http://www.webtide.com/eclipse site manually. Then I could see the Jetty adapter, and install it successfully. It seems to have installed into the eclipse/plugins/ rather than copied a .jar file into eclipse/plugins.
This may be what the poster on 2 Jul was trying to say, but it wasn't very clear.
I don't know why, but the "download additional server adapters" dialog hasn't worked for me once with Eclipse 3.5, the install always fails with dependency issues.
I also found I had to manually install all the WST Adapter items to get around failed dependencies, for example:
"Web, XML and Java EE Development->JST Server Adapters", "WST Server Adapters"
and also the "Database Development" items. I'm not sure which were required.. when I'd installed everything that looked likely, all my dependency issues were resolved when installing the Glassfish and Jetty server adapters from their update sites.
There's a new (official!) Jetty WTP Plugin to support Jetty 7.x and 8.x: http://wiki.eclipse.org/Jetty_WTP_Plugin
The problem could be resolved installing the JST Server UI before the Jetty Server Adapter. It is a current bug (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=321663).
That way you can install it either as a plugin or in the servers view.
I think you need org.mortbay.jetty.serveradaptor.1.0.4.jar to install jetty adapter, download from http://www.webtide.com/eclipse , put it in plugins of eclipse.
Hope the answer could help you.