If your application preview is timing out, giving errors, or just not loading please try the following to diagnose the cause:
Check your application is running
If you run
sudo ps aux in a terminal you'll see all the applications running in your workspace. Make sure you can see your application in the list. When workspaces come out of hibernation all processes are stopped and are not started automatically so you may need to manually start your application.
Also please ensure any relevant databases are also running, as they also do not start automatically when coming out of hibernation. If you're using mysql you should see
mysql in this list and can use
mysql-ctl start to restart it.
Check your application is running on port 8080
If you run the command
sudo netstat -tulpn in a terminal you'll see all the applications that are running in your workspace. You should see your application in this list and in the 4th column (titled
Local Address) you should see the address
If you see the address
127.0.0.1 or another number after the colon your application is configured incorrectly. Your application must be running using the hostname / ip of
0.0.0.0 and port
8080 to work with application preview. Please refer to our Run an application documentation page to fix this.
Check you can use curl to access your application
curl -v 0.0.0.0:8080 in a terminal and note the response code and information. You should get the response code
204 back from your application. If you get a response code of
5XX there is something wrong with your application code and you'll need to fix that.
If your app is private, make sure you're sending authentication headers
If you're trying to curl to your application from an external machine, or connect to it from a 3rd party service (such as an OAuth provider) this will not work when your application is private.
You can fix this by making your application preview public via the share menu in the top right. Or you can pass your cloud9 username and password as the HTTP Authorization header when sending the request.