apache / openwhisk

Apache OpenWhisk is an open source serverless cloud platform
https://openwhisk.apache.org/
Apache License 2.0
6.54k stars 1.17k forks source link

Mac local deployment fails during API GW deploy task #1596

Closed sjfink closed 7 years ago

sjfink commented 7 years ago

marking as high priority since they may affect many users on Mac.

Environment details:

Steps to reproduce the issue:

Fresh install of openwhisk on Mac as per instructions on github.

Provide the expected results and outputs:

Successful deployment

Provide the actual results and outputs:

sjfinks-mbp:ansible sjfink$ ansible-playbook -i environments/mac openwhisk.yml 
...
TASK [routemgmt : check if API Gateway database already exists] ****************
Tuesday 06 December 2016  11:49:49 -0500 (0:00:00.342)       0:01:07.287 ****** 
ok: [ansible]

TASK [routemgmt : create immortal API Gateway database] ************************
Tuesday 06 December 2016  11:49:50 -0500 (0:00:01.137)       0:01:08.424 ****** 
skipping: [ansible]

TASK [routemgmt : create the API Gateway query views for the API Gateway database] ***
Tuesday 06 December 2016  11:49:50 -0500 (0:00:00.065)       0:01:08.490 ****** 
skipping: [ansible]

TASK [routemgmt : install route management actions] ****************************
Tuesday 06 December 2016  11:49:50 -0500 (0:00:00.067)       0:01:08.557 ****** 
fatal: [ansible]: FAILED! => {"changed": true, "cmd": "./installRouteMgmt.sh /Users/sjfink/whisk/openwhisk/ansible/files/auth.whisk.system 192.168.99.100 /whisk.system /Users/sjfink/whisk/openwhisk/bin/wsk", "delta": "0:00:00.684664", "end": "2016-12-06 11:49:51.733152", "failed": true, "rc": 247, "start": "2016-12-06 11:49:51.048488", "stderr": "+ '[' 4 -eq 0 ']'\n+ AUTH=/Users/sjfink/whisk/openwhisk/ansible/files/auth.whisk.system\n+ APIHOST=192.168.99.100\n+ NAMESPACE=/whisk.system\n+ WSK_CLI=/Users/sjfink/whisk/openwhisk/bin/wsk\n+ WHISKPROPS_FILE=/Users/sjfink/whisk/openwhisk/whisk.properties\n++ fgrep db.host= /Users/sjfink/whisk/openwhisk/whisk.properties\n++ cut -d= -f2\n+ DB_HOST=xxx\n++ fgrep db.port= /Users/sjfink/whisk/openwhisk/whisk.properties\n++ cut -d= -f2\n+ DB_PORT=443\n++ fgrep db.protocol= /Users/sjfink/whisk/openwhisk/whisk.properties\n++ cut -d= -f2\n+ DB_PROTOCOL=https\n++ fgrep db.username= /Users/sjfink/whisk/openwhisk/whisk.properties\n++ cut -d= -f2\n+ DB_USERNAME=xxx\n++ fgrep db.password= /Users/sjfink/whisk/openwhisk/whisk.properties\n++ cut -d= -f2\n+ DB_PASSWORD=xxx\n++ fgrep db.whisk.apigw= /Users/sjfink/whisk/openwhisk/whisk.properties\n++ cut -d= -f2\n+ DB_APIGW=sjfink_sjfinks-mbp_gwapis\n++ fgrep apigw.auth.user= /Users/sjfink/whisk/openwhisk/whisk.properties\n++ cut -d= -f2\n+ GW_USER=\n++ fgrep apigw.auth.pwd= /Users/sjfink/whisk/openwhisk/whisk.properties\n++ cut -d= -f2-\n+ GW_PWD=\n++ fgrep apigw.host= /Users/sjfink/whisk/openwhisk/whisk.properties\n++ cut -d= -f2\n+ GW_HOST=http://192.168.99.100:9000/v1\n+ '[' -f /Users/sjfink/whisk/openwhisk/ansible/files/auth.whisk.system ']'\n++ cat /Users/sjfink/whisk/openwhisk/ansible/files/auth.whisk.system\n+ AUTH=xxxIwP\n+ export WSK_CONFIG_FILE=\n+ WSK_CONFIG_FILE=\n+ echo Installing routemgmt package.\n+ /Users/sjfink/whisk/openwhisk/bin/wsk -i --apihost 192.168.99.100 package update --auth xxxx--shared no /whisk.system/routemgmt -a description 'This package manages the gateway API configuration.' -p host xxxx -p port 443 -p protocol https -p username xxx -p password xxx -p dbname sjfink_sjfinks-mbp_gwapis -p gwUser '' -p gwPwd '' -p gwUrl http://192.168.99.100:9000/v1\nerror: Package update failed: The server is currently unavailable (because it is overloaded or down for maintenance). (code 4)", "stdout": "Installing routemgmt package.", "stdout_lines": ["Installing routemgmt package."], "warnings": []}
[FAILED]
> ./installRouteMgmt.sh /Users/sjfink/whisk/openwhisk/ansible/files/auth.whisk.system 192.168.99.100 /whisk.system /Users/sjfink/whisk/openwhisk/bin/wsk
Installing routemgmt package.
+ '[' 4 -eq 0 ']'
+ AUTH=/Users/sjfink/whisk/openwhisk/ansible/files/auth.whisk.system
+ APIHOST=192.168.99.100
+ NAMESPACE=/whisk.system
+ WSK_CLI=/Users/sjfink/whisk/openwhisk/bin/wsk
+ WHISKPROPS_FILE=/Users/sjfink/whisk/openwhisk/whisk.properties
++ fgrep db.host= /Users/sjfink/whisk/openwhisk/whisk.properties
++ cut -d= -f2
+ DB_HOST=xxx
++ fgrep db.port= /Users/sjfink/whisk/openwhisk/whisk.properties
++ cut -d= -f2
+ DB_PORT=443
++ fgrep db.protocol= /Users/sjfink/whisk/openwhisk/whisk.properties
++ cut -d= -f2
+ DB_PROTOCOL=https
++ fgrep db.username= /Users/sjfink/whisk/openwhisk/whisk.properties
++ cut -d= -f2
+ DB_USERNAME=xxx
++ fgrep db.password= /Users/sjfink/whisk/openwhisk/whisk.properties
++ cut -d= -f2
+ DB_PASSWORD=xxx
++ fgrep db.whisk.apigw= /Users/sjfink/whisk/openwhisk/whisk.properties
++ cut -d= -f2
+ DB_APIGW=sjfink_sjfinks-mbp_gwapis
++ fgrep apigw.auth.user= /Users/sjfink/whisk/openwhisk/whisk.properties
++ cut -d= -f2
+ GW_USER=
++ fgrep apigw.auth.pwd= /Users/sjfink/whisk/openwhisk/whisk.properties
++ cut -d= -f2-
+ GW_PWD=
++ fgrep apigw.host= /Users/sjfink/whisk/openwhisk/whisk.properties
++ cut -d= -f2
+ GW_HOST=http://192.168.99.100:9000/v1
+ '[' -f /Users/sjfink/whisk/openwhisk/ansible/files/auth.whisk.system ']'
++ cat /Users/sjfink/whisk/openwhisk/ansible/files/auth.whisk.system
+ AUTH=xxxx
+ export WSK_CONFIG_FILE=
+ WSK_CONFIG_FILE=
+ echo Installing routemgmt package.
+ /Users/sjfink/whisk/openwhisk/bin/wsk -i --apihost 192.168.99.100 package update --auth xxx MgRU4VrNZ9lyGVCGuMDGIwP --shared no /whisk.system/routemgmt -a description 'This package manages the gateway API configuration.' -p host xxx -p port 443 -p protocol https -p username 3xxx -p password xxx -p dbname sjfink_sjfinks-mbp_gwapis -p gwUser '' -p gwPwd '' -p gwUrl http://192.168.99.100:9000/v1
error: Package update failed: The server is currently unavailable (because it is overloaded or down for maintenance). (code 4)
csantanapr commented 7 years ago

Should we add a step in the nginx role to check that is up after docker run for nginx?

All the other container roles have a step in their deploy.yml to wait/check that the container is and functional, for example Controller "wait until the Controller in this host is up and running"

In addition we could add a wait/check that wsk api is up (i.e. http get $edge/api/v1) before trying to use the wsk cli to install any package/action.

sjfink commented 7 years ago

my bug was that an index was not created on my subjects database because cloudant returned a 202. pr #1597 fixes.

domdom82 commented 7 years ago

I just tried a fresh install on mac with master:head - works fine for me.

@csantanapr we could do that, however nginx usually starts up in msecs so it should not be a problem.

domdom82 commented 7 years ago

1597 merged. closing for now. pls reopen if problem reoccurs.