Pivotal Knowledge Base

Follow

Smoke Test errand fails in MySQL v2 due to port 80 (optional) being closed

Environment

MySQL for Pivotal Cloud Foundry: 2.x

Symptom

The smoke-test tries to reach the endpoint <appname>.<appdomain>/ping but it seems like the app is not reachable from the errand VM.

  • The errand performs a cf push then cf start app 
  • The smoke tests issue a curl against the app url MYSQL-1-APP-128f9de6-6ef1-4332-7.apps.solengha01pcf.customer.local/ping
    • Expected result: OK response within 10 seconds
    • Actual result: The response returns in under 10 seconds and is empty

Error Message

Note: There is no response to the curl command

[2017-07-06 07:52:49.51 (UTC)] curl -k -H Expect: -s MYSQL-1-APP-128f9de6-6ef1-4332-7.apps.solengha01pcf.customer.local/ping

[2017-07-06 07:52:49.57 (UTC)] cf delete MYSQL-1-APP-128f9de6-6ef1-4332-7 -f
Deleting app MYSQL-1-APP-128f9de6-6ef1-4332-7 in org system / space MYSQL-1-SPACE-a471ca96-6f14-4064-7 as MYSQL-USER-1-2017_07_06-07h49m01.799s...
OK

Response error

Expected
      <string>: 
  to equal
      <string>: OK

Cause 

Port 80 on the customers firewall/load balancer is closed as its an optional port but the smoke test errand uses it instead of 443. 

RCA 

Smoke-test errand uses port 80 instead of 443. This will be fixed in a future release.

Resolution

Follow the steps to replicate the issue and try to determine if its a network/firewall issue:

  1. Create a new instance of the service

    cf create-service p.mysql db-small MYSQL-1-DED-05e0ec2b-c60f-4b36-5
  2. Wait for the service to report - 'Status: create succeeded'

    cf service MYSQL-1-DED-05e0ec2b-c60f-4b36-5
  3. Next clone the following to desktop (where you are running cf commands)

    git clone: https://github.com/cloudfoundry-incubator/cf-mysql-acceptance-tests.git
  4. Go to the sinatra_app directory

    cd cf-mysql-acceptance-tests/assets/sinatra_app/
  5. Push the app

    cf push MYSQL-1-APP-128f9de6-6ef1-4332-7 --no-start -b ruby_buildpack -m 128M -k 128M
  6. Bind the app to the service instance

    cf bind-service MYSQL-1-APP-128f9de6-6ef1-4332-7 MYSQL-1-DED-05e0ec2b-c60f-4b36-5
  7. Confirm the app is now bound to the service - 'Bound apps: MYSQL-1-APP-128f9de6-6ef1-4332-7'

    cf service MYSQL-1-DED-05e0ec2b-c60f-4b36-5
  8. Start the app

    cf start MYSQL-1-APP-128f9de6-6ef1-4332-7
  9. Now try to curl the /ping endpoint and confirm it returns OK

    curl -k -H Expect: -s mysql-1-app-128f9de6-6ef1-4332-7.cfapps-21.haas-59.pez.pivotal.io/ping
  10. Perform a run time and -vvv in the command to gather more information about the possible cause

If port 80 is blocked in the environment then you can temporarily open the port and re-run the smoke-tests to confirm it passes. The test can be disabled until a fix is released for the issue. 

 

Comments

Powered by Zendesk