IBM / watson-assistant-workbench

Framework for maintaining Watson Assistant data in github repository with bundle of tools for generating, testing and uploading. Travis: https://travis-ci.com/IBM/watson-assistant-workbench. Artifactory (will be deleted after 25 Nov 2019): https://na.artifactory.swg-devops.com/artifactory/webapp/#/artifacts/browse/tree/General/iot-waw-trevis-generic-local.
Apache License 2.0
16 stars 25 forks source link

Fix error while uploading function sequence #338

Open Tereza-Pytelova opened 5 years ago

Tereza-Pytelova commented 5 years ago

Last master build failed (https://travis-ci.com/IBM/watson-assistant-workbench/builds/110413797)

==================================== ERRORS ====================================
_ ERROR at teardown of TestMain.test_functionsMissingSequenceComponent[False] __
self = <ci.unit_tests.functions_deploy.main_test.TestMain object at 0x7f7da2ce3860>
function = <function main at 0x7f7da2e65f28>, exceptionType = None
exceptionValue = None, messageType = None, message = None
args = [['-c', '/home/travis/build/IBM/watson-assistant-workbench/ci/unit_tests/functions_deploy/main_data/exampleFunctions.c...W-CI-c906a699-d0ff-4573-aa9f-dea809dd6b0a', '--cloudfunctions_namespace', '[secure]', ...]]
kwargs = {}
    def t_fun_generic(self, function, exceptionType, exceptionValue, messageType, message, args=[], kwargs={}):
        ''' (Generic) Runs function with given arguments and tests if everything is set as should be '''
        exception = None

        try:
>           function(*args, **kwargs)
ci/test_utils.py:157: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
argv = ['-c', '/home/travis/build/IBM/watson-assistant-workbench/ci/unit_tests/functions_deploy/main_data/exampleFunctions.cf...AW-CI-c906a699-d0ff-4573-aa9f-dea809dd6b0a', '--cloudfunctions_namespace', '[secure]', ...]
    def main(argv):
        """Deletes the cloudfunctions package specified in the configuration file or as CLI argument."""
        parser = argparse.ArgumentParser(description="Deletes cloud functions package.",
                                         formatter_class=argparse.ArgumentDefaultsHelpFormatter)
        parser.add_argument('-v', '--verbose', required=False, help='verbosity', action='store_true')
        parser.add_argument('-c', '--common_configFilePaths', help="configuration file", action='append')
        parser.add_argument('--common_functions', required=False, help="directory where the cloud functions are located")
        parser.add_argument('--cloudfunctions_namespace', required=False, help="cloud functions namespace")
        parser.add_argument('--cloudfunctions_apikey', required=False, help="cloud functions apikey")
        parser.add_argument('--cloudfunctions_username', required=False, help="cloud functions user name")
        parser.add_argument('--cloudfunctions_password', required=False, help="cloud functions password")
        parser.add_argument('--cloudfunctions_package', required=False, help="cloud functions package name")
        parser.add_argument('--cloudfunctions_url', required=False, help="url of cloud functions API")
        parser.add_argument('--log', type=str.upper, default=None, choices=list(logging._levelToName.values()))

        args = parser.parse_args(argv)

        if __name__ == '__main__':
            setLoggerConfig(args.log, args.verbose)

        def handleResponse(response):
            """Get response code and show an error if it's not OK"""
            code = response.status_code
            if code != requests.codes.ok:
                if code == 401:
                    logger.error("Authorization error. Check your credentials. (Error code " + str(code) + ")")
                elif code == 403:
                    logger.error("Access is forbidden. Check your credentials and permissions. (Error code " + str(code) + ")")
                elif code == 404:
                    logger.error("The resource could not be found. Check your cloudfunctions url and namespace. (Error code " + str(code) + ")")
                elif code >= 500:
                    logger.error("Internal server error. (Error code " + str(code) + ")")
                else:
                    logger.error("Unexpected error code: " + str(code))

                errorsInResponse(response.json())
                return False
            return True

        def isActionSequence(action):
            for annotation in action['annotations']:
                if 'key' in annotation and annotation['key'] == 'exec':
                    if 'value' in annotation and annotation['value'] == 'sequence':
                        return True;
            return False

        config = Cfg(args)
        logger.info('STARTING: '+ os.path.basename(__file__))

        namespace = getRequiredParameter(config, 'cloudfunctions_namespace')
        urlNamespace = quote(namespace)
        auth = getParametersCombination(config, 'cloudfunctions_apikey', ['cloudfunctions_password', 'cloudfunctions_username'])
        package = getRequiredParameter(config, 'cloudfunctions_package')
        cloudfunctionsUrl = getRequiredParameter(config, 'cloudfunctions_url')
        functionDir = getRequiredParameter(config, 'common_functions')

        if 'cloudfunctions_apikey' in auth:
            username, password = convertApikeyToUsernameAndPassword(auth['cloudfunctions_apikey'])
        else:
            username = auth['cloudfunctions_username']
            password = auth['cloudfunctions_password']

        logger.info("Will delete cloud functions in package '" + package + "'.")

        requests.packages.urllib3.disable_warnings(InsecureRequestWarning)
        packageUrl = cloudfunctionsUrl + '/' + urlNamespace + '/packages/' + package
        response = requests.get(packageUrl, auth=(username, password), headers={'Content-Type': 'application/json'})
        if not handleResponse(response):
            logger.critical("Unable to get information about package '" + package + "'.")
            sys.exit(1)

        actions = response.json()['actions']
        # put the sequences at the beggining
        actions.sort(key=lambda action: isActionSequence(action))

        for action in actions:
            name = action['name']
            actionUrl = cloudfunctionsUrl + '/' + urlNamespace + '/actions/' + package + '/' + name
            logger.verbose("Deleting action '" + name + "' at " + actionUrl)
            response = requests.delete(actionUrl, auth=(username, password), headers={'Content-Type': 'application/json'})
            if not handleResponse(response):
                logger.critical("Unable to delete action " + name + "' at " + actionUrl)
                sys.exit(1)
            logger.verbose("Action deleted.")

        logger.verbose("Deleting package '" + package + "' at " + packageUrl)
        response = requests.delete(packageUrl, auth=(username, password), headers={'Content-Type': 'application/json'})
        if not handleResponse(response):
            logger.critical("Unable to delete package '" + package + "' at " + packageUrl)
>           sys.exit(1)
E           SystemExit: 1
scripts/functions_delete_package.py:116: SystemExit
During handling of the above exception, another exception occurred:
self = <ci.unit_tests.functions_deploy.main_test.TestMain object at 0x7f7da2ce3860>
    def teardown_method(self):
        if self.packageCreated:
            # Delete the package
            params = ['-c', os.path.join(self.dataBasePath, 'exampleFunctions.cfg'),
                '--cloudfunctions_package', self.package, '--cloudfunctions_namespace', self.namespace,
                '--cloudfunctions_url', self.cloudFunctionsUrl,
                '--cloudfunctions_package', self.package,
                '--cloudfunctions_apikey', self.apikey]
>           self.t_fun_noException(functions_delete_package.main, [params])
ci/unit_tests/functions_deploy/main_test.py:73: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
ci/test_utils.py:114: in t_fun_noException
    self.t_fun_noExceptionAndMessage(function, None, None, args, kwargs)
ci/test_utils.py:146: in t_fun_noExceptionAndMessage
    self.t_fun_generic(function, None, None, messageType, message, args, kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
self = <ci.unit_tests.functions_deploy.main_test.TestMain object at 0x7f7da2ce3860>
function = <function main at 0x7f7da2e65f28>, exceptionType = None
exceptionValue = None, messageType = None, message = None
args = [['-c', '/home/travis/build/IBM/watson-assistant-workbench/ci/unit_tests/functions_deploy/main_data/exampleFunctions.c...W-CI-c906a699-d0ff-4573-aa9f-dea809dd6b0a', '--cloudfunctions_namespace', '[secure]', ...]]
kwargs = {}
    def t_fun_generic(self, function, exceptionType, exceptionValue, messageType, message, args=[], kwargs={}):
        ''' (Generic) Runs function with given arguments and tests if everything is set as should be '''
        exception = None

        try:
            function(*args, **kwargs)
        except BaseException as e:
            exception = e
            if not exceptionType:
>               pytest.fail(traceback.format_exc())
E               Failed: Traceback (most recent call last):
E                 File "/home/travis/build/IBM/watson-assistant-workbench/ci/test_utils.py", line 157, in t_fun_generic
E                   function(*args, **kwargs)
E                 File "/home/travis/build/IBM/watson-assistant-workbench/scripts/functions_delete_package.py", line 116, in main
E                   sys.exit(1)
E               SystemExit: 1
ci/test_utils.py:161: Failed
----------------------------- Captured stderr call -----------------------------
2019-05-02 17:08:35,822 functions_deploy.py         INFO     STARTING: functions_deploy.py
2019-05-02 17:08:35,822 cfgCommons.py               INFO     cfg.__init__
2019-05-02 17:08:35,823 cfgCommons.py               INFO     Processing config file:/home/travis/build/IBM/watson-assistant-workbench/ci/unit_tests/functions_deploy/main_data/exampleNonexistentFunctionRef.cfg
2019-05-02 17:08:35,823 functions_deploy.py         INFO     Will create cloudfunctions package Package-for-WAW-CI-c906a699-d0ff-4573-aa9f-dea809dd6b0a.
2019-05-02 17:08:36,048 functions_deploy.py         INFO     Cloud functions package successfully uploaded
2019-05-02 17:08:36,049 functions_deploy.py         INFO     Will deploy functions at paths ['ci/unit_tests/functions_deploy/main_data/example_functions_seq/'].
2019-05-02 17:08:36,865 functions_deploy.py         INFO     Cloudfunctions successfully deployed.
2019-05-02 17:08:36,866 functions_deploy.py         INFO     Will deploy cloudfunction sequences.
2019-05-02 17:08:37,079 functions_deploy.py         ERROR    Unexpected error code: 400
2019-05-02 17:08:37,079 wawCommons.py               ERROR    Error in response: Sequence component does not exist. (WA code f0bab0e8164294888f5efba65888eac8)
2019-05-02 17:08:37,079 functions_deploy.py         CRITICAL Cannot deploy cloudfunctions sequence a
------------------------------ Captured log call -------------------------------
functions_deploy.py         98 INFO     STARTING: functions_deploy.py
cfgCommons.py               30 INFO     cfg.__init__
cfgCommons.py               50 INFO     Processing config file:/home/travis/build/IBM/watson-assistant-workbench/ci/unit_tests/functions_deploy/main_data/exampleNonexistentFunctionRef.cfg
functions_deploy.py        150 INFO     Will create cloudfunctions package Package-for-WAW-CI-c906a699-d0ff-4573-aa9f-dea809dd6b0a.
functions_deploy.py        157 INFO     Cloud functions package successfully uploaded
functions_deploy.py        163 INFO     Will deploy functions at paths ['ci/unit_tests/functions_deploy/main_data/example_functions_seq/'].
functions_deploy.py        205 INFO     Cloudfunctions successfully deployed.
functions_deploy.py        208 INFO     Will deploy cloudfunction sequences.
functions_deploy.py        115 ERROR    Unexpected error code: 400
wawCommons.py              329 ERROR    Error in response: Sequence component does not exist. (WA code f0bab0e8164294888f5efba65888eac8)
functions_deploy.py        219 CRITICAL Cannot deploy cloudfunctions sequence a
--------------------------- Captured stderr teardown ---------------------------
2019-05-02 17:08:37,082 cfgCommons.py               INFO     cfg.__init__
2019-05-02 17:08:37,082 cfgCommons.py               INFO     Processing config file:/home/travis/build/IBM/watson-assistant-workbench/ci/unit_tests/functions_deploy/main_data/exampleFunctions.cfg
2019-05-02 17:08:37,083 functions_delete_package.py INFO     STARTING: functions_delete_package.py
2019-05-02 17:08:37,083 functions_delete_package.py INFO     Will delete cloud functions in package 'Package-for-WAW-CI-c906a699-d0ff-4573-aa9f-dea809dd6b0a'.
2019-05-02 17:08:38,702 functions_delete_package.py ERROR    Unexpected error code: 409
2019-05-02 17:08:38,702 wawCommons.py               ERROR    Error in response: Package not empty (contains 1 entity) (WA code b44fc238c639a2fd5d6b7e7e8ee9334f)
2019-05-02 17:08:38,702 functions_delete_package.py CRITICAL Unable to delete package 'Package-for-WAW-CI-c906a699-d0ff-4573-aa9f-dea809dd6b0a' at [secure]/Prague%20Cognitive%20Services_IoT-Prague/packages/Package-for-WAW-CI-c906a699-d0ff-4573-aa9f-dea809dd6b0a
---------------------------- Captured log teardown -----------------------------
cfgCommons.py               30 INFO     cfg.__init__
cfgCommons.py               50 INFO     Processing config file:/home/travis/build/IBM/watson-assistant-workbench/ci/unit_tests/functions_deploy/main_data/exampleFunctions.cfg
functions_delete_package.py   74 INFO     STARTING: functions_delete_package.py
functions_delete_package.py   89 INFO     Will delete cloud functions in package 'Package-for-WAW-CI-c906a699-d0ff-4573-aa9f-dea809dd6b0a'.
functions_delete_package.py   60 ERROR    Unexpected error code: 409
wawCommons.py              329 ERROR    Error in response: Package not empty (contains 1 entity) (WA code b44fc238c639a2fd5d6b7e7e8ee9334f)
functions_delete_package.py  115 CRITICAL Unable to delete package 'Package-for-WAW-CI-c906a699-d0ff-4573-aa9f-dea809dd6b0a' at [secure]/Prague%20Cognitive%20Services_IoT-Prague/packages/Package-for-WAW-CI-c906a699-d0ff-4573-aa9f-dea809dd6b0a
Kseii commented 5 years ago

The error has not happened after the logging update which is needed to debug this. I will keep the issue open and see if the error occurs in the future.

Tereza-Pytelova commented 5 years ago

It happend again, but logging was not set to verbose. Fixed by #377, waiting for another occurrence of 409 error.

Tereza-Pytelova commented 5 years ago

409 is here again..

==================================== ERRORS ====================================
_______ ERROR at teardown of TestMain.test_functionsUploadSequence[True] _______
ci/test_utils.py:163: in t_fun_generic
    rValue = function(*args, **kwargs)
scripts/functions_delete_package.py:140: in main
    sys.exit(1)
E   SystemExit: 1
During handling of the above exception, another exception occurred:
ci/unit_tests/functions_deploy/main_test.py:79: in teardown_method
    self.t_fun_noException(functions_delete_package.main, [params])
ci/test_utils.py:119: in t_fun_noException
    return self.t_fun_noExceptionAndMessage(function, None, None, args, kwargs)
ci/test_utils.py:151: in t_fun_noExceptionAndMessage
    return self.t_fun_generic(function, None, None, messageType, message, args, kwargs)
ci/test_utils.py:167: in t_fun_generic
    pytest.fail(traceback.format_exc())
E   Failed: Traceback (most recent call last):
E     File "/home/travis/build/IBM/watson-assistant-workbench/ci/test_utils.py", line 163, in t_fun_generic
E       rValue = function(*args, **kwargs)
E     File "/home/travis/build/IBM/watson-assistant-workbench/scripts/functions_delete_package.py", line 140, in main
E       sys.exit(1)
E   SystemExit: 1
----------------------------- Captured stderr call -----------------------------
2019-06-23 17:44:24 functions_deploy.py         INFO     STARTING: functions_deploy.py
2019-06-23 17:44:24 cfgCommons.py               INFO     cfg.__init__
2019-06-23 17:44:24 cfgCommons.py               INFO     Processing config file:/home/travis/build/IBM/watson-assistant-workbench/ci/unit_tests/functions_deploy/main_data/exampleValidSequences.cfg
2019-06-23 17:44:24 functions_deploy.py         INFO     Will create cloudfunctions package Package-for-WAW-CI-1a3a59f8-7ffd-401b-9bf1-94d31048a29d.
2019-06-23 17:44:24 functions_deploy.py         INFO     Cloud functions package successfully uploaded
2019-06-23 17:44:24 functions_deploy.py         INFO     Will deploy functions at paths ['ci/unit_tests/functions_deploy/main_data/example_functions_seq/'].
2019-06-23 17:44:24 wawCommons.py               INFO     Deploying function example1
2019-06-23 17:44:25 wawCommons.py               INFO     Cloud function example1 successfully deployed.
2019-06-23 17:44:25 wawCommons.py               INFO     Deploying function example2
2019-06-23 17:44:25 wawCommons.py               INFO     Cloud function example2 successfully deployed.
2019-06-23 17:44:25 wawCommons.py               INFO     Deploying function example3
2019-06-23 17:44:25 wawCommons.py               INFO     Cloud function example3 successfully deployed.
2019-06-23 17:44:25 functions_deploy.py         INFO     Cloudfunctions successfully deployed.
2019-06-23 17:44:25 functions_deploy.py         INFO     Will deploy cloudfunction sequences.
2019-06-23 17:44:25 wawCommons.py               INFO     Deploying cloudfunctions sequence 'a': ['example1', 'example2', 'example3']
2019-06-23 17:44:26 wawCommons.py               INFO     Sequence 'a' deployed.
2019-06-23 17:44:26 wawCommons.py               INFO     Deploying cloudfunctions sequence 'c': ['example3', 'example1', 'example2']
2019-06-23 17:44:26 wawCommons.py               INFO     Sequence 'c' deployed.
2019-06-23 17:44:26 wawCommons.py               INFO     Deploying cloudfunctions sequence 'b': ['example2', 'example3', 'example1']
2019-06-23 17:44:26 wawCommons.py               INFO     Sequence 'b' deployed.
2019-06-23 17:44:26 functions_deploy.py         INFO     Cloudfunction sequences successfully deployed.
2019-06-23 17:44:26 functions_deploy.py         INFO     FINISHING: functions_deploy.py
2019-06-23 17:44:26 wawCommons.py               INFO     Calling function url '[secure]/Prague%20Cognitive%20Services_IoT-Prague/actions/Package-for-WAW-CI-1a3a59f8-7ffd-401b-9bf1-94d31048a29d/a?result=True&blocking=True'
2019-06-23 17:45:06 wawCommons.py               INFO     Calling function url '[secure]/Prague%20Cognitive%20Services_IoT-Prague/actions/Package-for-WAW-CI-1a3a59f8-7ffd-401b-9bf1-94d31048a29d/c?result=True&blocking=True'
2019-06-23 17:45:06 wawCommons.py               INFO     Calling function url '[secure]/Prague%20Cognitive%20Services_IoT-Prague/actions/Package-for-WAW-CI-1a3a59f8-7ffd-401b-9bf1-94d31048a29d/b?result=True&blocking=True'
--------------------------- Captured stderr teardown ---------------------------
2019-06-23 17:45:07 cfgCommons.py               INFO     cfg.__init__
2019-06-23 17:45:07 cfgCommons.py               INFO     Processing config file:/home/travis/build/IBM/watson-assistant-workbench/ci/unit_tests/functions_deploy/main_data/exampleFunctions.cfg
2019-06-23 17:45:07 functions_delete_package.py INFO     STARTING: functions_delete_package.py
2019-06-23 17:45:07 wawCommons.py               WARNING  'cloudfunctions_package_pattern' parameter not defined
2019-06-23 17:45:07 wawCommons.py               DEBUG    package name: Package-for-WAW-CI-1a3a59f8-7ffd-401b-9bf1-94d31048a29d
2019-06-23 17:45:07 wawCommons.py               INFO     package name match: Package-for-WAW-CI-1a3a59f8-7ffd-401b-9bf1-94d31048a29d
2019-06-23 17:45:07 wawCommons.py               DEBUG    package name: Package-for-WAW-CI-32e6063c-daca-4230-8e86-bbb2c5401c4b
2019-06-23 17:45:07 wawCommons.py               DEBUG    package name: Package-for-WAW-CI-bf7cdce5-449a-4a46-9e9f-797cd329a298
2019-06-23 17:45:07 wawCommons.py               DEBUG    package name: Package-for-WAW-CI-76cae688-0e88-4902-8736-648e8a078bee
2019-06-23 17:45:07 wawCommons.py               DEBUG    package name: Package-for-WAW-CI-4bdbcbf9-1110-4f6a-bcd9-7b7d9d2b324d
2019-06-23 17:45:07 wawCommons.py               DEBUG    package name: Bluemix_stt-lm-am-assessment_Veronika
2019-06-23 17:45:07 wawCommons.py               DEBUG    package name: Bluemix_stt-lm-am-assessment_DataCollection
2019-06-23 17:45:07 wawCommons.py               DEBUG    package name: Bluemix_Speech to Text-DataCollection_Service credentials-App
2019-06-23 17:45:07 wawCommons.py               DEBUG    package name: Bluemix_Speech to Text for Integrations_cred-for-test-integration
2019-06-23 17:45:07 wawCommons.py               DEBUG    package name: Bluemix_Text to Speech for Intergrations_Auto-generated service credentials
2019-06-23 17:45:07 wawCommons.py               DEBUG    package name: Package-for-WAW-CI-f4a98711-68bf-41dd-a0f4-ba165d5e6474
2019-06-23 17:45:07 wawCommons.py               DEBUG    package name: Package-for-WAW-CI-146c1195-b1e2-4cff-8e3a-ec47bdf31ec8
2019-06-23 17:45:07 wawCommons.py               DEBUG    package name: Package-for-WAW-CI-b380173e-a012-402e-ab27-4e374390a161
2019-06-23 17:45:07 wawCommons.py               DEBUG    package name: Package-for-WAW-CI-815f0300-477c-4463-b24b-a1220991ec4b
2019-06-23 17:45:07 wawCommons.py               DEBUG    package name: Package-for-WAW-CI-9249bf39-1173-4b30-a9fd-f0447c6bf589
2019-06-23 17:45:07 wawCommons.py               DEBUG    package name: Package-for-WAW-CI-92233590-1097-40fc-bb1e-4e36b75b7da8
2019-06-23 17:45:07 wawCommons.py               DEBUG    package name: Package-for-WAW-CI-df5dd368-a181-4599-bebe-eea10ab4e036
2019-06-23 17:45:07 wawCommons.py               DEBUG    package name: Package-for-WAW-CI-1b1c73f8-79f3-4b93-b5d9-896145d0cb36
2019-06-23 17:45:07 wawCommons.py               DEBUG    package name: Package-for-WAW-CI-7676cf6a-00b6-4017-924d-985585e73f4f
2019-06-23 17:45:07 wawCommons.py               DEBUG    package name: Package-for-WAW-CI-5a414631-2303-41a4-bd30-87e8356ffbf6
2019-06-23 17:45:07 wawCommons.py               DEBUG    package name: Package-for-WAW-CI-0dce5278-a586-46bf-902d-6833f6d4ef96
2019-06-23 17:45:07 wawCommons.py               DEBUG    package name: Package-for-WAW-CI-bac142c4-0c24-4dde-a8ab-1922b2bd58ec
2019-06-23 17:45:07 wawCommons.py               DEBUG    package name: Package-for-WAW-CI-4384c7fd-03bf-4048-b451-95c0b431b47d
2019-06-23 17:45:07 wawCommons.py               DEBUG    package name: Package-for-WAW-CI-20b47f4d-a405-4781-8712-31a93adce65c
2019-06-23 17:45:07 wawCommons.py               DEBUG    package name: Package-for-WAW-CI-e475fdad-ec62-4878-a4ee-5094f13b3855
2019-06-23 17:45:07 wawCommons.py               DEBUG    package name: Package-for-WAW-CI-e618620c-6f82-4f71-8e4e-20283f851742
2019-06-23 17:45:07 wawCommons.py               DEBUG    package name: Package-for-WAW-CI-d2b65089-dca1-48cb-9965-f5d6a52e79f1
2019-06-23 17:45:07 wawCommons.py               DEBUG    package name: Package-for-WAW-CI-3d0fbd52-3306-4354-8d97-6489780d0b7e
2019-06-23 17:45:07 wawCommons.py               DEBUG    package name: Package-for-WAW-CI-a6c1986a-953f-47aa-930c-44ae2e0727cf
2019-06-23 17:45:07 wawCommons.py               DEBUG    package name: Package-for-WAW-CI-561f72f6-45a3-4cbe-a791-0e5fe738bc23
2019-06-23 17:45:07 functions_delete_package.py INFO     Will delete cloud functions in package 'Package-for-WAW-CI-1a3a59f8-7ffd-401b-9bf1-94d31048a29d'.
2019-06-23 17:45:07 wawCommons.py               INFO     Deleting action 'example3' at [secure]/Prague%20Cognitive%20Services_IoT-Prague/actions/Package-for-WAW-CI-1a3a59f8-7ffd-401b-9bf1-94d31048a29d/example3
2019-06-23 17:45:08 wawCommons.py               INFO     Action deleted.
2019-06-23 17:45:08 wawCommons.py               INFO     Deleting action 'example2' at [secure]/Prague%20Cognitive%20Services_IoT-Prague/actions/Package-for-WAW-CI-1a3a59f8-7ffd-401b-9bf1-94d31048a29d/example2
2019-06-23 17:45:08 wawCommons.py               INFO     Action deleted.
2019-06-23 17:45:08 wawCommons.py               INFO     Deleting action 'example1' at [secure]/Prague%20Cognitive%20Services_IoT-Prague/actions/Package-for-WAW-CI-1a3a59f8-7ffd-401b-9bf1-94d31048a29d/example1
2019-06-23 17:45:08 wawCommons.py               INFO     Action deleted.
2019-06-23 17:45:08 wawCommons.py               INFO     Deleting action 'b' at [secure]/Prague%20Cognitive%20Services_IoT-Prague/actions/Package-for-WAW-CI-1a3a59f8-7ffd-401b-9bf1-94d31048a29d/b
2019-06-23 17:45:09 wawCommons.py               INFO     Action deleted.
2019-06-23 17:45:09 wawCommons.py               INFO     Deleting action 'c' at [secure]/Prague%20Cognitive%20Services_IoT-Prague/actions/Package-for-WAW-CI-1a3a59f8-7ffd-401b-9bf1-94d31048a29d/c
2019-06-23 17:45:09 wawCommons.py               INFO     Action deleted.
2019-06-23 17:45:09 wawCommons.py               INFO     Deleting action 'a' at [secure]/Prague%20Cognitive%20Services_IoT-Prague/actions/Package-for-WAW-CI-1a3a59f8-7ffd-401b-9bf1-94d31048a29d/a
2019-06-23 17:45:09 wawCommons.py               INFO     Action deleted.
2019-06-23 17:45:09 wawCommons.py               INFO     Deleting package 'Package-for-WAW-CI-1a3a59f8-7ffd-401b-9bf1-94d31048a29d' at [secure]/Prague%20Cognitive%20Services_IoT-Prague/packages/Package-for-WAW-CI-1a3a59f8-7ffd-401b-9bf1-94d31048a29d
2019-06-23 17:45:09 functions_delete_package.py ERROR    Unexpected error code: 409
2019-06-23 17:45:09 wawCommons.py               ERROR    Error in response: Package not empty (contains 1 entity) (WA code 652879ed6cedeafaa6d7b1ff849ab588)
2019-06-23 17:45:09 functions_delete_package.py CRITICAL Unable to delete package 'Package-for-WAW-CI-1a3a59f8-7ffd-401b-9bf1-94d31048a29d' at [secure]/Prague%20Cognitive%20Services_IoT-Prague/packages/Package-for-WAW-CI-1a3a59f8-7ffd-401b-9bf1-94d31048a29d
Tereza-Pytelova commented 5 years ago

Again in https://travis-ci.com/IBM/watson-assistant-workbench/builds/117020636

==================================== ERRORS ====================================
__ ERROR at teardown of TestMain.test_functionsMissingSequenceComponent[True] __
ci/test_utils.py:163: in t_fun_generic
    rValue = function(*args, **kwargs)
scripts/functions_delete_package.py:140: in main
    sys.exit(1)
E   SystemExit: 1
During handling of the above exception, another exception occurred:
ci/unit_tests/functions_deploy/main_test.py:79: in teardown_method
    self.t_fun_noException(functions_delete_package.main, [params])
ci/test_utils.py:119: in t_fun_noException
    return self.t_fun_noExceptionAndMessage(function, None, None, args, kwargs)
ci/test_utils.py:151: in t_fun_noExceptionAndMessage
    return self.t_fun_generic(function, None, None, messageType, message, args, kwargs)
ci/test_utils.py:167: in t_fun_generic
    pytest.fail(traceback.format_exc())
E   Failed: Traceback (most recent call last):
E     File "/home/travis/build/IBM/watson-assistant-workbench/ci/test_utils.py", line 163, in t_fun_generic
E       rValue = function(*args, **kwargs)
E     File "/home/travis/build/IBM/watson-assistant-workbench/scripts/functions_delete_package.py", line 140, in main
E       sys.exit(1)
E   SystemExit: 1
----------------------------- Captured stderr call -----------------------------
2019-06-26 17:45:01 functions_deploy.py         INFO     STARTING: functions_deploy.py
2019-06-26 17:45:01 cfgCommons.py               INFO     cfg.__init__
2019-06-26 17:45:01 cfgCommons.py               INFO     Processing config file:/home/travis/build/IBM/watson-assistant-workbench/ci/unit_tests/functions_deploy/main_data/exampleNonexistentFunctionRef.cfg
2019-06-26 17:45:01 functions_deploy.py         INFO     Will create cloudfunctions package Package-for-WAW-CI-19e691dd-4a67-474b-ae10-949bdd19869f.
2019-06-26 17:45:02 functions_deploy.py         INFO     Cloud functions package successfully uploaded
2019-06-26 17:45:02 functions_deploy.py         INFO     Will deploy functions at paths ['ci/unit_tests/functions_deploy/main_data/example_functions_seq/'].
2019-06-26 17:45:02 wawCommons.py               INFO     Deploying function example1
2019-06-26 17:45:02 wawCommons.py               INFO     Cloud function example1 successfully deployed.
2019-06-26 17:45:02 wawCommons.py               INFO     Deploying function example2
2019-06-26 17:45:03 wawCommons.py               INFO     Cloud function example2 successfully deployed.
2019-06-26 17:45:03 wawCommons.py               INFO     Deploying function example3
2019-06-26 17:45:03 wawCommons.py               INFO     Cloud function example3 successfully deployed.
2019-06-26 17:45:03 functions_deploy.py         INFO     Cloudfunctions successfully deployed.
2019-06-26 17:45:03 functions_deploy.py         INFO     Will deploy cloudfunction sequences.
2019-06-26 17:45:03 wawCommons.py               INFO     Deploying cloudfunctions sequence 'a': ['example1', 'example2', 'example3', 'exampleNonexistent']
2019-06-26 17:45:03 functions_deploy.py         ERROR    Unexpected error code: 400
2019-06-26 17:45:03 wawCommons.py               ERROR    Error in response: Sequence component does not exist. (WA code 566221e97ef7e5f66603ec1693d3b875)
2019-06-26 17:45:03 functions_deploy.py         CRITICAL Cannot deploy cloudfunctions sequence a
--------------------------- Captured stderr teardown ---------------------------
2019-06-26 17:45:03 cfgCommons.py               INFO     cfg.__init__
2019-06-26 17:45:03 cfgCommons.py               INFO     Processing config file:/home/travis/build/IBM/watson-assistant-workbench/ci/unit_tests/functions_deploy/main_data/exampleFunctions.cfg
2019-06-26 17:45:03 functions_delete_package.py INFO     STARTING: functions_delete_package.py
2019-06-26 17:45:03 wawCommons.py               WARNING  'cloudfunctions_package_pattern' parameter not defined
2019-06-26 17:45:03 wawCommons.py               DEBUG    package name: Package-for-WAW-CI-19e691dd-4a67-474b-ae10-949bdd19869f
2019-06-26 17:45:03 wawCommons.py               INFO     package name match: Package-for-WAW-CI-19e691dd-4a67-474b-ae10-949bdd19869f
2019-06-26 17:45:03 wawCommons.py               DEBUG    package name: Package-for-WAW-CI-1a3a59f8-7ffd-401b-9bf1-94d31048a29d
2019-06-26 17:45:03 wawCommons.py               DEBUG    package name: Package-for-WAW-CI-32e6063c-daca-4230-8e86-bbb2c5401c4b
2019-06-26 17:45:03 wawCommons.py               DEBUG    package name: Package-for-WAW-CI-bf7cdce5-449a-4a46-9e9f-797cd329a298
2019-06-26 17:45:03 wawCommons.py               DEBUG    package name: Package-for-WAW-CI-76cae688-0e88-4902-8736-648e8a078bee
2019-06-26 17:45:03 wawCommons.py               DEBUG    package name: Package-for-WAW-CI-4bdbcbf9-1110-4f6a-bcd9-7b7d9d2b324d
2019-06-26 17:45:03 wawCommons.py               DEBUG    package name: Bluemix_stt-lm-am-assessment_Veronika
2019-06-26 17:45:03 wawCommons.py               DEBUG    package name: Bluemix_stt-lm-am-assessment_DataCollection
2019-06-26 17:45:03 wawCommons.py               DEBUG    package name: Bluemix_Speech to Text-DataCollection_Service credentials-App
2019-06-26 17:45:03 wawCommons.py               DEBUG    package name: Bluemix_Speech to Text for Integrations_cred-for-test-integration
2019-06-26 17:45:03 wawCommons.py               DEBUG    package name: Bluemix_Text to Speech for Intergrations_Auto-generated service credentials
2019-06-26 17:45:03 wawCommons.py               DEBUG    package name: Package-for-WAW-CI-f4a98711-68bf-41dd-a0f4-ba165d5e6474
2019-06-26 17:45:03 wawCommons.py               DEBUG    package name: Package-for-WAW-CI-146c1195-b1e2-4cff-8e3a-ec47bdf31ec8
2019-06-26 17:45:03 wawCommons.py               DEBUG    package name: Package-for-WAW-CI-b380173e-a012-402e-ab27-4e374390a161
2019-06-26 17:45:03 wawCommons.py               DEBUG    package name: Package-for-WAW-CI-815f0300-477c-4463-b24b-a1220991ec4b
2019-06-26 17:45:03 wawCommons.py               DEBUG    package name: Package-for-WAW-CI-9249bf39-1173-4b30-a9fd-f0447c6bf589
2019-06-26 17:45:03 wawCommons.py               DEBUG    package name: Package-for-WAW-CI-92233590-1097-40fc-bb1e-4e36b75b7da8
2019-06-26 17:45:03 wawCommons.py               DEBUG    package name: Package-for-WAW-CI-df5dd368-a181-4599-bebe-eea10ab4e036
2019-06-26 17:45:03 wawCommons.py               DEBUG    package name: Package-for-WAW-CI-1b1c73f8-79f3-4b93-b5d9-896145d0cb36
2019-06-26 17:45:03 wawCommons.py               DEBUG    package name: Package-for-WAW-CI-7676cf6a-00b6-4017-924d-985585e73f4f
2019-06-26 17:45:03 wawCommons.py               DEBUG    package name: Package-for-WAW-CI-5a414631-2303-41a4-bd30-87e8356ffbf6
2019-06-26 17:45:03 wawCommons.py               DEBUG    package name: Package-for-WAW-CI-0dce5278-a586-46bf-902d-6833f6d4ef96
2019-06-26 17:45:03 wawCommons.py               DEBUG    package name: Package-for-WAW-CI-bac142c4-0c24-4dde-a8ab-1922b2bd58ec
2019-06-26 17:45:03 wawCommons.py               DEBUG    package name: Package-for-WAW-CI-4384c7fd-03bf-4048-b451-95c0b431b47d
2019-06-26 17:45:03 wawCommons.py               DEBUG    package name: Package-for-WAW-CI-20b47f4d-a405-4781-8712-31a93adce65c
2019-06-26 17:45:03 wawCommons.py               DEBUG    package name: Package-for-WAW-CI-e475fdad-ec62-4878-a4ee-5094f13b3855
2019-06-26 17:45:03 wawCommons.py               DEBUG    package name: Package-for-WAW-CI-e618620c-6f82-4f71-8e4e-20283f851742
2019-06-26 17:45:03 wawCommons.py               DEBUG    package name: Package-for-WAW-CI-d2b65089-dca1-48cb-9965-f5d6a52e79f1
2019-06-26 17:45:03 wawCommons.py               DEBUG    package name: Package-for-WAW-CI-3d0fbd52-3306-4354-8d97-6489780d0b7e
2019-06-26 17:45:03 wawCommons.py               DEBUG    package name: Package-for-WAW-CI-a6c1986a-953f-47aa-930c-44ae2e0727cf
2019-06-26 17:45:03 functions_delete_package.py INFO     Will delete cloud functions in package 'Package-for-WAW-CI-19e691dd-4a67-474b-ae10-949bdd19869f'.
2019-06-26 17:45:04 wawCommons.py               INFO     Deleting action 'example3' at [secure]/Prague%20Cognitive%20Services_IoT-Prague/actions/Package-for-WAW-CI-19e691dd-4a67-474b-ae10-949bdd19869f/example3
2019-06-26 17:45:04 wawCommons.py               INFO     Action deleted.
2019-06-26 17:45:04 wawCommons.py               INFO     Deleting action 'example2' at [secure]/Prague%20Cognitive%20Services_IoT-Prague/actions/Package-for-WAW-CI-19e691dd-4a67-474b-ae10-949bdd19869f/example2
2019-06-26 17:45:04 wawCommons.py               INFO     Action deleted.
2019-06-26 17:45:04 wawCommons.py               INFO     Deleting action 'example1' at [secure]/Prague%20Cognitive%20Services_IoT-Prague/actions/Package-for-WAW-CI-19e691dd-4a67-474b-ae10-949bdd19869f/example1
2019-06-26 17:45:05 wawCommons.py               INFO     Action deleted.
2019-06-26 17:45:05 wawCommons.py               INFO     Deleting package 'Package-for-WAW-CI-19e691dd-4a67-474b-ae10-949bdd19869f' at [secure]/Prague%20Cognitive%20Services_IoT-Prague/packages/Package-for-WAW-CI-19e691dd-4a67-474b-ae10-949bdd19869f
2019-06-26 17:45:05 functions_delete_package.py ERROR    Unexpected error code: 409
2019-06-26 17:45:05 wawCommons.py               ERROR    Error in response: Package not empty (contains 1 entity) (WA code bbe94f8eceae89e4720cb22a75b1549a)
2019-06-26 17:45:05 functions_delete_package.py CRITICAL Unable to delete package 'Package-for-WAW-CI-19e691dd-4a67-474b-ae10-949bdd19869f' at [secure]/Prague%20Cognitive%20Services_IoT-Prague/packages/Package-for-WAW-CI-19e691dd-4a67-474b-ae10-949bdd19869f