Xcode Server is unavailable - xcode

I am trying to setup CI on an Xcode Server. I have a Mac running OSX Server with Xcode Services up and running (seems to be working). The Mac is hosted in the cloud.
When I try to add the server to Xcode on my local Mac dev machine, it says "Xcode Server is unavailable". What "server address" do I use. I tried the IP address as well as the machinename.companyname.com address.
Note I have enabled the "file sharing" service and this works fine using machinename.companyname.com.

I configured my router to forward the relevant traffic to the server. This process is called port forwarding.
Opening these ports worked for me
Protocol Port Range ---- Comment
TCP 22 ---- ssh
TCP 80 ---- http
TCP 443 ---- https
TCP+UDP 3690 ---- svn
TCP+UDP 9418 ---- git
TCP+UDP 20300 ---- xcode1
TCP+UDP 20343-20345 ---- xcode2
reference: https://support.apple.com/en-ae/HT202944

I am having the same problem you are. My server is not in the cloud, but it is setup to be accessible outside of my network. I am able to add my server because it is seen by Bonjour. Everything works fine that way. However, I can't add the server by using the IP or the www address.
I've verified that TCP ports 22, 80, and 443 are forwarding correctly. I also have TCP/UDP 3690 and 9418 forwarded correctly.
One thing I wanted to add is that I can add repositories that exist on the server without issue. It is just adding the server that is causing a problem.
I have filed a bug report with Apple and will comment back here as soon as I get a response.

I think I solved my own problem. After upgrading to Xcode6, need to upgrade to Yosemite too. Don't know why but this seemed to fix the issue.

Related

Mac OS local proxy, connect ECONNREFUSED ::1:3000

I have a create-react-app app running on localhost:3000 and a proxy server running on localhost:4000 that redirects some of my request to port 3000.
Requesting localhost:3000/ correctly returns index.html file,
Requesting localhost:4000/ returns connect ECONNREFUSED ::1:3000 with 502 code.
The exact same setup works properly on Ubuntu (returns index.html from localhost:4000) and Windows so I am sure proxy works fine.
Proxy is built using https://www.npmjs.com/package/http-proxy but i was unable to find any solution to this in documentation.
My question is: Does mac require changing some extra settings to allow this kind of traffic?
One solution is to edit /etc/hosts and remove ::1 localhost mapping or change it to ::1 ip6-localhost (default setting on ubuntu)

Laradock + PhpStorm + Xdebug Fails whereas PhpStorm Validation Succeeds

I've setup debug configuration for PhpStorm and it is successfully validated by PhpStorm:
Xdebug helper for Chrome is also installed.
The problem is that nothing happens when I start listening for debug connections and reload the required page with Xdebug helper switched on. Also tried this bookmarklets with no luck.
No errors or something, just nothing.
Also tried to set different IPs as dockerhost: from 192.168.. range (from network settings), from 172.* range (from nginx), from 10.* range (10.0.75.1 is default). Also tried docker.for.mac.internal.host which failed when containers were starting.
Docker 17.02, macOS Sierra, PhpStorm 2017.3
If you're on linux, be sure to create corresponding rules in your firewall.
But to troubleshoot this more effectively you need to gather more info.
Enable xdebug logging xdebug.remote_log=/var/www/xdebug.log in you
xdebug.ini or you can append that in the "Cli Interpreters > Configuration Options" in PHPStorm (xdebug.remote_log, /path/inside/workspace/container/xdebug.log)
Another step you could take is to monitor the incoming connections to your machine. (run this on where you installed docker). It will start listening to all incoming connection attempts on port 9000.
sudo tcpdump -i any port 9000
Now run the debugger once, check the logs inside the container (workspace by default) and see if any incoming connection attempts have gone through from the container.
If you see something like Time-out connecting to client (Waited: 200 ms). :-(, chances are that your firewall is blocking the incoming connections.
To open them up you could add a rule using ufw
sudo ufw allow in from 172.22.0.0/24 to any port 9000 (or write down a specific ip) Be sure to double check that this is the ip trying to connect
this will allow all connections on port 9000 from 172.22.0.* (which is what laradock uses for its virtual networks). Be sure to double check the logs maybe your setup uses different ip range)
My working xdebug.ini (both in php-fpm and workspace containers are the same)
xdebug.remote_host=dockerhost
xdebug.remote_connect_back=0
xdebug.remote_port=9000
xdebug.idekey=PHPSTORM
xdebug.remote_autostart=1
xdebug.remote_enable=1
xdebug.remote_log=/var/www/xdebug.log
xdebug.cli_color=1
xdebug.profiler_enable=0
xdebug.profiler_output_dir="~/path/to/profiler.log"
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.var_display_max_children=-1
xdebug.var_display_max_data=-1
xdebug.var_display_max_depth=-1
If none of the above works, another step would be to also check if you have any containers running on port 9000 already. If so, then you'll need to use another, port, just don't forget to expose it from docker.
(Explanation: docker binds (exposes) ports to the host machine so that any incoming connections get directed to the right container, if 9000 is taken, xdebug won't be able to connect to any IDE on your machine, even if the IDE says it is running the listener)
Hope this helps.

OSX SSH tunnel from remote port to local

I've created SSH tunnels in the past, but I'm having trouble on OSX. I'm looking to take a website's port 80, and direct it to my localhost:8080. When I run this command
ssh -L 8080:<cloud_ip_address>:80 root#<cloud_ip_address> -N
I get the default apache 'it works!' page.
Why am I not getting the port 80 of the remote machine (which is running a web app)?
UPDATE
I still do not have a solution yet, but I have some more information. The page I am getting is the default page in /var/www/html but I am serving a Flask app which does not have static pages.
Because HTTP protocol contains not only the IP address, but also the hostname (the URL you type into your browser), which differs between the <cloud_hostname> and localhost. The easiest way to trick it is to create /etc/hosts (there will be some OSX alternative -- search ...) entry redirecting the hostname of your remote machine to localhost.
127.0.0.1 <cloud_hostname>
But note that in this case you will not be able to access the remote machine using the hostname!

Accessing remote server service via HTTPS

I have a server(AWS) to which I have ssh access.
There is a service(supervisor) running on this service on port 9001 whose web view can be accessed through 127.0.0.1:9001 had it been a local machine.
But since it is not a local machine, how do I access it?
I got the ip address of the machine using ifconfig | grep inet and then tried accessing it through https://172.11.11.1:9001/
Bit dint work.
When I tried wget https://172.11.11.1:9001/ it shows
Connecting to 172.31.19.8:9001... and hangs there.
I have added the following line in my supervisor conf file.
[inet_http_server]
port = *:9001
Can someone please help me with this?
This is more of a server config question. You'll most likely find your AWS access properties allow connections on post 22, 80 and 443 only. In AWS console you'll need to add a new security access group to allow port 9001 to be accessed.

Phpstorm + xdebug : Remote host is configured as "localhost" despite server host is probably not local

I was following this instruction to validate my debugger configuration on Web Server. I uses a remote server whose FTP connection has been tested, but I get this warning message saying
Remote host is configured as 'localhost' despite server host is probably not local
My first question is: what does "remote host" and "server host" refer to respectively?
I know remote host is the setting xdebug.remote_host, and according to the xdebug documentation, it is "the host where the debug client is running".
This makes me confused: Isn't the debug client the IDE I am running on my local machine?
If yes, then shouldn't "the host where the debug client is running" be my local machines's IP address? If yes again, should I configure xdebug.remote_host to be my IP?
I tried setting it to my IP, the warning message does't show but it doesn't feel right because later I tried it with a random IP the message also doesn't show.
Secondly, the xdebug documentation also says that this xdebug.remote_host setting will be ignored if xdebug.remote_connect_back is enabled." Although not quite sure what this setting does, I set it to be "On", as the picture shows:
I was hoping this will eliminate the warning message, but it is still there. So how do I get rid of this message?
In my case, I had several apache virtual hosts setup for different projects. I was able to access projects via different urls, like : http://projectname1, http://anotherproject2 .
I was getting that same error in PhpStorm while doing xdebug validation:
Remote host is configured as “localhost” despite server host is
probably not local
Problem was fixed, once in php.ini xdebug.remote_host matched the URL of the project I was debugging. So, if I was debugging http://project1, I would have this in php.ini:
xdebug.remote_host="project1"
Having values as 127.0.0.1, or localhost didn't fix it.
Hope it helps someone.
Did you try with following?
xdebug.remote_host = "127.0.0.1"

Resources