Closed netpoe closed 7 years ago
Hi @netpoe and thanks for the report.
As the error message says, it fails to connect because the connection is refused.
What if you uncomment dbms.connectors.default_listen_address=0.0.0.0
in your config file, does that change anything?
It's suggested here: https://github.com/neo4j/docker-neo4j/issues/31
If not I would suggest that you raise the question in our docker repo: https://github.com/neo4j/docker-neo4j because this does not seem to be a Neo4j Browser issue.
Hi @oskarhane, @netpoe
I seem to be facing the same error but I have disabled bolt
and https
because I want to only expose http
, my connectors look like:
dbms.connectors.default_listen_address=0.0.0.0
# individual connectors below.
#dbms.connectors.default_advertised_address=localhost
# HTTPS Connector. There can be zero or one HTTPS connectors.
# Network connector configuration
dbms.connectors.default_listen_address=0.0.0.0
# port for each connector, by setting their individual listen_address.
# individual connectors below.
#dbms.connectors.default_advertised_address=localhost
# configure an advertised port for each connector, by setting their
# Bolt connector
dbms.connector.bolt.enabled=false
#dbms.connector.bolt.tls_level=OPTIONAL
#dbms.connector.bolt.listen_address=:7687
# HTTP Connector. There must be exactly one HTTP connector.
dbms.connector.http.enabled=true
dbms.connector.http.listen_address=0.0.0.0:7474
# HTTPS Connector. There can be zero or one HTTPS connectors.
dbms.connector.https.enabled=false
#dbms.connector.https.listen_address=:7473
I am using neo4j:3.2.1
and neo4j-browser:3.0.4
. I do not see the Do not use Bolt
option.
Thank you
Hello, I have the same issue, but using bolt and https over a secure connection. Both are configured to listen to all ports, and here is what my console says :
I'm having the same issue as well. I'm using neo4j-3.2.5 on CentOS 7 via the neo4j yum repo. The browser version is 3.0.8. I have CA signed certs in the certificates directory. Here is my config:
dbms.directories.certificates=/var/lib/neo4j/certificates
dbms.connector.bolt.enabled=true
dbms.connector.bolt.tls_level=REQUIRED
dbms.connector.bolt.listen_address=0.0.0.0:7687
dbms.connector.http.enabled=true
dbms.connector.https.enabled=true
dbms.connector.https.listen_address=0.0.0.0:7473
When I connect to https://neo4jserver:7473, the initial wss connection works and I am able to login with the default credentials. On the next screen, I am prompted to change the password and get the following error: 18: Failed to construct 'WebSocket': An insecure WebSocket connection may not be initiated from a page loaded over HTTPS.
The error points to the same line of code in neo4j-web.min.js as the picture from @fhureau:
var e = "ws";
if (n.encrypted === !0 || n.encrypted === f.ENCRYPTION_ON) {
if (n.trust && "TRUST_CUSTOM_CA_SIGNED_CERTIFICATES" !== n.trust)
return void (this._error = (0,
a.newError)("The browser version of this driver only supports one trust strategy, 'TRUST_CUSTOM_CA_SIGNED_CERTIFICATES'. " + n.trust + ' is not supported. Please either use TRUST_CUSTOM_CA_SIGNED_CERTIFICATES or disable encryption by setting `encrypted:"' + f.ENCRYPTION_OFF + '"` in the driver configuration.'));
e = "wss"
}
this._url = e + "://" + n.host + ":" + n.port,
this._ws = new WebSocket(this._url),
It appears the change password page is creating a new websocket, but the if statement condition fails, e = "wss"
doesn't get set, and the new websocket is using ws://
causing the Firefox and Chrome to block it due to Mixed Content.
What neo4j setting is required to get either n.encrypted === !0
or n.encrypted === f.ENCRYPTION_ON
to evaluate to True
?
Thanks.
Thank you @giovtorres, that pointed me in the right direction. However, your issue is not the same as there original issue since that's not over https. I found a bug and have opened a PR for it: https://github.com/neo4j/neo4j-browser/pull/650
Thanks @oskarhane !
Closing this due to inactivity, feel free to open if the issue still exists.
@thobalose You need to enable bolt to use Neo4j Browser in Neo4j 3.2 or higher. @fhureau Your issue was fixed in #650 and will be out in the next release.
I have the same problem- though I'm launching using a docker container with the following arguments:
ENV NEO4J_auth=none
ENV NEO4J_dbms_connectors_default__listen__address="0.0.0.0"
ENV NEO4J_dbms_connector_http_listen__address="0.0.0.0:7474"
ENV NEO4J_dbms_connector_https_listen__address="0.0.0.0:7473"
ENV NEO4J_dbms_connector_bolt_listen__address="0.0.0.0:7687"
EXPOSE 7474 7473 7687
It's customized so that I can load test data in the container before starting a dependent process.
I have the same problem. I want to run Neo4j in a Docker container running in an OpenShift environment. I make use of the lates Neo4j Docker image (3.3.0 CE).
In the neo4j.conf file I uncommented the lines dbms.connectors.default_listen_address=0.0.0.0
and dbms.connector.bolt.address=0.0.0.0:7687
. However, I still get the error:
WebSocket connection to 'wss://neo4j.<remote_host>:7687/' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED
Is there another solution to this problem?
I also have the same problem with Neo4j desktop (3.3.0) running on Linux.
I also changed the neo4j.conf file as it was recommended and I get the error:
WebSocket connection to 'ws://localhost:7474/' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED
@Fl0ble and @sfines Is it a self signed certificate or a CA trusted one?
@nemi83 There's no websocket at port 7474
, just http. the default bolt pot is 7687
.
@oskarhane In our case it is a Let's Encrypt certificate.
Hi @oskarhane,
I just upgraded neo4j from 3.0.5 to 3.3.1 and am now getting a similar issue when trying to connect using the browser. I've made the applicable changes to the config file and I'm seeing this in Chrome's dev tools: "neo4j-web.min.js:20 WebSocket connection to 'ws://localhost:7687/' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED".
I've confirmed the port is open and listening, and my web application is still able to connect to the bolt port just fine since the upgrade, so this seems specific to the browser. I've seen a number of comments related to SSL, but should that be an issue if I'm accessing the browser over HTTP and connecting via the bolt port?
Any guidance you could provide would be much appreciated, thank you!!!
I solved this by using the dbms.connector.bolt.advertised_address
setting. This is how you change what the client (browser WS client) uses to connect to bolt. Example server1:7687
@oskarhane Im, having a very similar issue. This is my etc/neo4j/neo4j.conf data
#
dbms.directories.data=/var/lib/neo4j/data dbms.directories.plugins=/var/lib/neo4j/plugins dbms.directories.certificates=/var/lib/neo4j/certificates dbms.directories.logs=/var/log/neo4j dbms.directories.lib=/usr/share/neo4j/lib dbms.directories.run=/var/run/neo4j dbms.directories.metrics=/var/lib/neo4j/metrics
LOAD CSV
import files to be under the import
directory. Remove or comment it out toLOAD CSV
section of the manual for details.dbms.directories.import=/var/lib/neo4j/import
This is the error that i get as soon as i click on connect.
Ok, the Neo4j is installed on a open stack server. And im creating a ssh channel like this
ssh -L :7474:127.0.0.1:7474 ubuntu@208.75.00.001 -v -v
from my mac os terminal.
the firewall on the remote server is off as well.
I have tried many things. Please any help here would be really appreciated.
@chirag912 You have two choices:
localhost
as the bolt host. If you do this you need to set the servers listen address to 0.0.0.0
as well since you're connecting from the outside.HI,
Thank you for the reply. I will try this and post back.
Thanks again
On Thu, Mar 29, 2018 at 11:50 AM, Oskar Hane notifications@github.com wrote:
@chirag912 https://github.com/chirag912 You have two choices:
- You need to tunnel port 7687 as well or
- Use the host/ip of the remote server instead of localhost as the bolt host. If you do this you need to set the servers listen address to 0.0.0.0 as well since you're connecting from the outside.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/neo4j/neo4j-browser/issues/522#issuecomment-377134045, or mute the thread https://github.com/notifications/unsubscribe-auth/AFTlKRSQv2QSf7QQJUqbVPt1yGk0wcuPks5tjH0pgaJpZM4NcgyS .
HI,
I checked and your idea to tunnel port 7867 with 7474 worked.!! So just of rite record i tunnel ported 7474 from one terminal window and opened another window for tunnel porting 7687.
However , would you recommend this as a permanent solution to access neo4j (on cloud) from my localhost. ?
Thank you , Ill really appreciate the help and support.
Thanks
On Tue, Apr 3, 2018 at 4:06 PM, chirag jhumkhawala chirag912@gmail.com wrote:
HI,
Thank you for the reply. I will try this and post back.
Thanks again
On Thu, Mar 29, 2018 at 11:50 AM, Oskar Hane notifications@github.com wrote:
@chirag912 https://github.com/chirag912 You have two choices:
- You need to tunnel port 7687 as well or
- Use the host/ip of the remote server instead of localhost as the bolt host. If you do this you need to set the servers listen address to 0.0.0.0 as well since you're connecting from the outside.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/neo4j/neo4j-browser/issues/522#issuecomment-377134045, or mute the thread https://github.com/notifications/unsubscribe-auth/AFTlKRSQv2QSf7QQJUqbVPt1yGk0wcuPks5tjH0pgaJpZM4NcgyS .
Hi, I did setup Neo4j casual cluster on GKE, and exposed using load balancer service. but when I try to connect from outside GKE(App Engine or local machine) I am getting always below error, but from inside cluster working perfectly fine. `Traceback (most recent call last): File "/usr/local/lib/python3.6/site-packages/neo4j/addressing.py", line 108, in resolve info = getaddrinfo(socket_address[0], socket_address[1], 0, SOCK_STREAM, IPPROTO_TCP) File "/usr/local/lib/python3.6/socket.py", line 745, in getaddrinfo for res in _socket.getaddrinfo(host, port, family, type, proto, flags): socket.gaierror: [Errno -3] Temporary failure in name resolution
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/monsoon-reco/monsoon/models/merchant.py", line 63, in load merchant_id=self.merchant_id File "/usr/local/lib/python3.6/site-packages/neo4j/v1/api.py", line 500, in read_transaction return self._run_transaction(READ_ACCESS, unit_of_work, *args, kwargs) File "/usr/local/lib/python3.6/site-packages/neo4j/v1/api.py", line 467, in _run_transaction self._connect(access_mode) File "/usr/local/lib/python3.6/site-packages/neo4j/v1/api.py", line 260, in _connect self._connection = self._acquirer(access_mode) File "/usr/local/lib/python3.6/site-packages/neo4j/v1/routing.py", line 410, in acquire connection = self.acquire_direct(address) # should always be a resolved address File "/usr/local/lib/python3.6/site-packages/neo4j/bolt/connection.py", line 450, in acquire_direct connection = self.connector(address, self.connection_error_handler) File "/usr/local/lib/python3.6/site-packages/neo4j/v1/routing.py", line 457, in connector return connect(address, security_plan.ssl_context, error_handler, config) File "/usr/local/lib/python3.6/site-packages/neo4j/bolt/connection.py", line 691, in connect for resolved_address in resolve(address): File "/usr/local/lib/python3.6/site-packages/neo4j/addressing.py", line 110, in resolve raise AddressError("Cannot resolve address {!r}".format(socket_address[0])) neo4j.exceptions.AddressError: Cannot resolve address 'neo4j-readreplica-0.neo4j-read.default.svc.cluster.local'
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 2292, in wsgi_app response = self.full_dispatch_request() File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1815, in full_dispatch_request rv = self.handle_user_exception(e) File "/usr/local/lib/python3.6/site-packages/flask_cors/extension.py", line 161, in wrapped_function return cors_after_request(app.make_response(f(*args, kwargs))) File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1718, in handle_user_exception reraise(exc_type, exc_value, tb) File "/usr/local/lib/python3.6/site-packages/flask/_compat.py", line 35, in reraise raise value File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1813, in full_dispatch_request rv = self.dispatch_request() File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1799, in dispatch_request return self.view_functions[rule.endpoint](req.view_args) File "/monsoon-reco/monsoon/corejs/views.py", line 69, in corejs merchant = Merchant(merchant_id=merchant_id).load() File "/monsoon-reco/monsoon/models/merchant.py", line 63, in load merchant_id=self.merchant_id File "/usr/local/lib/python3.6/site-packages/neo4j/v1/api.py", line 251, in exit self.close() File "/usr/local/lib/python3.6/site-packages/neo4j/v1/api.py", line 282, in close self.rollback_transaction() File "/usr/local/lib/python3.6/site-packages/neo4j/v1/api.py", line 450, in rollback_transaction rollback_result = self.rollback() File "/usr/local/lib/python3.6/site-packages/neo4j/v1/api.py", line 537, in rollback return self.run(u"ROLLBACK", {}) File "/usr/local/lib/python3.6/site-packages/neo4j/v1/api.py", line 524, in run return self._run(statement, parameters) File "/usr/local/lib/python3.6/site-packages/neo4j/v1/api.py", line 513, in _run self._last_result = result = BoltStatementResult(self, run_response, pull_all_response) File "/usr/local/lib/python3.6/site-packages/neo4j/v1/result.py", line 44, in init super(BoltStatementResult, self).init(session, PackStreamHydrator(session._connection.protocol_version)) AttributeError: 'NoneType' object has no attribute 'protocol_version'`
Hello everyone.. I am having the same issue. Any solution without having to create a SSH tunnel?
WebSocket connection to 'ws://localhost:7687/' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED
I have an ssh tunnel for port 7687, and I can connect to bolt://localhost:7687
with the web browser, but when I try to connect via py2neo, the connection is terminated (regardless of the secure
setting and proper auth
settings):
E neobolt.exceptions.ServiceUnavailable: Connection to ('127.0.0.1', 7687) closed without handshake response
The problem I had was with py2neo itself; it has a bug where it fails to forward the secure setting over the bolt connection.
I got this problem on Docker version of neo4j:4.0.0 and I had to dump the config file in a volume and then update the configuration from
dbms.connector.bolt.advertised_address=0.0.0.0:7687
to
dbms.connector.bolt.advertised_address=localhost:7687
and it started working.
In a docker-compose file, you can add this option like this :
neo4j:
environment:
NEO4J_dbms_connector_bolt_advertised__address: "localhost:7687"
I had this problem only in firefox on Windows10.
@Maltemo thanks for the pointer! I think that your line is not completely correct. This worked for me:
neo4j:
environment:
- NEO4J_dbms_connector_bolt_advertised__address=myneohost.mydomain.nl:7687
I get the same issue when using JavaScript driver to connect NEO4J Sandbox. There is no way to modify configs for Sandbox, so it looks like a dead-end..
adding to @Maltemo answer, sometimes, you just need to change the host address as is: neo4j://localhost:7687
.
I installed neo4j with Docker and opened the browser window on
localhost:7474
Here's my
docker-compose.yml
file:latest
version is 3.2.0 from docker hubI've added a
neo4j.conf
file with these settings:At last, these commands to be able to open the browser:
However, when I open the browser and run
server connect
as it is suggested, with these settings:host
bolt://localhost:7687username
(empty)password
(empty)I get this:
And the Chrome devTools console: