Azure / batch-shipyard

Simplify HPC and Batch workloads on Azure
MIT License
277 stars 121 forks source link

KeyError: account_key on cli-latest #59

Closed lediur closed 7 years ago

lediur commented 7 years ago

I'm running into this blocking issue running the cli-latest docker container.

Traceback:

2017-03-18T00:05:26.9865110Z Digest: sha256:31fc61d165291b4c5a186ceb74827226397e32c04d8df349bb197ef67e5ccd4e
2017-03-18T00:05:27.0034980Z Status: Downloaded newer image for alfpark/batch-shipyard:cli-latest
2017-03-18T00:05:27.9223690Z Traceback (most recent call last):
2017-03-18T00:05:27.9238610Z   File "/opt/batch-shipyard/shipyard.py", line 1452, in <module>
2017-03-18T00:05:27.9254630Z     cli()
2017-03-18T00:05:27.9268580Z   File "/usr/lib/python3.5/site-packages/click/core.py", line 722, in __call__
2017-03-18T00:05:27.9280400Z     return self.main(*args, **kwargs)
2017-03-18T00:05:27.9292230Z   File "/usr/lib/python3.5/site-packages/click/core.py", line 697, in main
2017-03-18T00:05:27.9303840Z     rv = self.invoke(ctx)
2017-03-18T00:05:27.9316070Z   File "/usr/lib/python3.5/site-packages/click/core.py", line 1066, in invoke
2017-03-18T00:05:27.9328400Z     return _process_result(sub_ctx.command.invoke(sub_ctx))
2017-03-18T00:05:27.9340310Z   File "/usr/lib/python3.5/site-packages/click/core.py", line 1066, in invoke
2017-03-18T00:05:27.9352410Z     return _process_result(sub_ctx.command.invoke(sub_ctx))
2017-03-18T00:05:27.9364450Z   File "/usr/lib/python3.5/site-packages/click/core.py", line 895, in invoke
2017-03-18T00:05:27.9376980Z     return ctx.invoke(self.callback, **ctx.params)
2017-03-18T00:05:27.9388590Z   File "/usr/lib/python3.5/site-packages/click/core.py", line 535, in invoke
2017-03-18T00:05:27.9400430Z     return callback(*args, **kwargs)
2017-03-18T00:05:27.9412260Z   File "/usr/lib/python3.5/site-packages/click/decorators.py", line 64, in new_func
2017-03-18T00:05:27.9424690Z     return ctx.invoke(f, obj, *args[1:], **kwargs)
2017-03-18T00:05:27.9436310Z   File "/usr/lib/python3.5/site-packages/click/core.py", line 535, in invoke
2017-03-18T00:05:27.9448360Z     return callback(*args, **kwargs)
2017-03-18T00:05:27.9461250Z   File "/opt/batch-shipyard/shipyard.py", line 1038, in pool_add
2017-03-18T00:05:27.9473730Z     ctx.initialize_for_batch()
2017-03-18T00:05:27.9486240Z   File "/opt/batch-shipyard/shipyard.py", line 124, in initialize_for_batch
2017-03-18T00:05:27.9498770Z     skip_global_config=False, skip_pool_config=False, fs_storage=False)
2017-03-18T00:05:27.9511520Z   File "/opt/batch-shipyard/shipyard.py", line 321, in _init_config
2017-03-18T00:05:27.9524240Z     convoy.fleet.populate_global_settings(self.config, fs_storage)
2017-03-18T00:05:27.9537360Z   File "/opt/batch-shipyard/convoy/fleet.py", line 209, in populate_global_settings
2017-03-18T00:05:27.9550490Z     sc = settings.credentials_storage(config, bs.storage_account_settings)
2017-03-18T00:05:27.9563550Z   File "/opt/batch-shipyard/convoy/settings.py", line 837, in credentials_storage
2017-03-18T00:05:27.9576550Z     account_key=conf['account_key'],
2017-03-18T00:05:27.9589290Z KeyError: 'account_key'

This started happening today with my scheduled task just a few hours ago, and doesn't seem to be transient (I reran the scheduled task and it failed the second time).

Yesterday's run worked fine, and cli 2.5.4 seems to work fine as well. I haven't tried 2.6.0b1 yet. If you'd like, I can try that as well.

My credentials.json:

{
    "credentials": {
        "batch": {
            "account": "mybatchaccount",
            "account_key_keyvault_secret_id": "https://myvault.vault.azure.net/secrets/batch",
            "account_service_url": "https://mybatchaccount.westus.batch.azure.com"
        },
        "storage": {
            "batch": {
                "account": "mybatchstorage",
                "account_key_keyvault_secret_id": "https://myvault.vault.azure.net/secrets/storage-batch"
            },
            "data": {
                "account": "storage",
                "account_key_keyvault_secret_id": "https://myvault.vault.azure.net/secrets/storage"
            }
        },
        "docker_registry": {
            "myregistry-on.azurecr.io": {
                "username": "myuser",
                "password_keyvault_secret_id": "https://myvault.vault.azure.net/secrets/acr-myregistry-reader"
            }
        }
    }
}
alfpark commented 7 years ago

@lediur There's an issue with KeyVault imported secret ids and the latest / 2.6.0b1 cli images that is causing this behavior. As a temporary workaround until this is fixed, please use cli-2.5.4 if you don't need the new 2.6.0 features.

alfpark commented 7 years ago

@lediur Please let me know if 2.6.0b2 solves your issue and re-open issue if not.