Open jackbravo opened 4 years ago
I tried to reproduce this on another machine, and was unable to.
Same versions of node, hexa and macos.
But now login doesn't seem to do anything, same for the other commands:
~/D/j/n/nest-azure (master|✔) $ hexa login
██╗ ██╗ ███████╗ ██╗ ██╗ █████╗
██║ ██║ ██╔════╝ ╚██╗██╔╝ ██╔══██╗
███████║ █████╗ ╚███╔╝ ███████║
██╔══██║ ██╔══╝ ██╔██╗ ██╔══██║
██║ ██║ ███████╗ ██╔╝ ██╗ ██║ ██║
╚═╝ ╚═╝ ╚══════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝
✔ Loading subscriptions...
~/D/j/n/nest-azure (master|✔) $ hexa init --just=functions
██╗ ██╗ ███████╗ ██╗ ██╗ █████╗
██║ ██║ ██╔════╝ ╚██╗██╔╝ ██╔══██╗
███████║ █████╗ ╚███╔╝ ███████║
██╔══██║ ██╔══╝ ██╔██╗ ██╔══██║
██║ ██║ ███████╗ ██╔╝ ██╗ ██║ ██║
╚═╝ ╚═╝ ╚══════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝
? Configuration file found. Do you want to override it? false Yes
✔ Loading subscriptions...
~/D/j/n/nest-azure (master|✔) $ hexa deploy
██╗ ██╗ ███████╗ ██╗ ██╗ █████╗
██║ ██║ ██╔════╝ ╚██╗██╔╝ ██╔══██╗
███████║ █████╗ ╚███╔╝ ███████║
██╔══██║ ██╔══╝ ██╔██╗ ██╔══██║
██║ ██║ ███████╗ ██╔╝ ██╗ ██║ ██║
╚═╝ ╚═╝ ╚══════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝
✗ No resources deployed. Run hexa init and try again!
✔ Done in 0 seconds.
Same error pointed by @jackbravo .
OS: Windows 10
@jackbravo and @rajeevbbqq would you guys mind running the same commands in debug mode plz? and share the ouput. thanks.
how do we do this?
nevermind, --debug
It seems that the required Azure CLI isn't installed on your machine. Can you double check that the required tools are installed and available on your machine? Here is the section in the readme https://github.com/manekinekko/hexa#required-tools
Sorry for the trouble. Here is the output now with the dependencies installed:
hexa init --just=functions -d
██╗ ██╗ ███████╗ ██╗ ██╗ █████╗
██║ ██║ ██╔════╝ ╚██╗██╔╝ ██╔══██╗
███████║ █████╗ ╚███╔╝ ███████║
██╔══██║ ██╔══╝ ██╔██╗ ██╔══██║
██║ ██║ ███████╗ ██╔╝ ██╗ ██║ ██║
╚═╝ ╚═╝ ╚══════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝
? Configuration file found. Do you want to override it? false Yes
hexa az login --query "[].{name:name, state:state, id:id}" --output json --verbose +0ms
/usr/local/Cellar/azure-cli/2.0.79_1/libexec/lib/python3.8/site-packages/jmespath/visitor.py:32: SyntaxWarning: "is" with a literal. Did you mean "=="?
if x is 0 or x is 1:
/usr/local/Cellar/azure-cli/2.0.79_1/libexec/lib/python3.8/site-packages/jmespath/visitor.py:32: SyntaxWarning: "is" with a literal. Did you mean "=="?
if x is 0 or x is 1:
/usr/local/Cellar/azure-cli/2.0.79_1/libexec/lib/python3.8/site-packages/jmespath/visitor.py:34: SyntaxWarning: "is" with a literal. Did you mean "=="?
elif y is 0 or y is 1:
/usr/local/Cellar/azure-cli/2.0.79_1/libexec/lib/python3.8/site-packages/jmespath/visitor.py:34: SyntaxWarning: "is" with a literal. Did you mean "=="?
elif y is 0 or y is 1:
/usr/local/Cellar/azure-cli/2.0.79_1/libexec/lib/python3.8/site-packages/jmespath/visitor.py:260: SyntaxWarning: "is" with a literal. Did you mean "=="?
if original_result is 0:
INFO: Open browser with url: https://login.microsoftonline.com/common/oauth2/authorize?response_type=code&client_id=04b07795-8ddb-461a-bbee-02f9e1bf7b46&redirect_uri=http://localhost:8400&state=dbb7h1rstl0jh6f74i2l&resource=https://management.core.windows.net/&prompt=select_account
WARNING: You have logged in. Now let us find all the subscriptions to which you have access...
INFO: command ran in 43.329 seconds.
[
{
"id": "5a3beddb-4144-43e8-9da9-1f0fc61f97bb",
"name": "Free Trial",
"state": "Enabled"
}
]
? Choose a subscription: Free Trial
? Enter a name for the project: nestazure
hexa az group exists --name nestazure --output json --verbose +58s
INFO: command ran in 0.805 seconds.
false
hexa az group create -l westeurope -n nestazure --tag "x-created-by=hexa" --query "{name:name, id:id, location:location}" --output json --verbose +1s
INFO: command ran in 4.120 seconds.
{
"id": "/subscriptions/5a3beddb-4144-43e8-9da9-1f0fc61f97bb/resourceGroups/nestazure",
"location": "westeurope",
"name": "nestazure"
}
hexa az ad sp create-for-rbac --name="http://nestazure" --role Contributor --output json --verbose +5s
WARNING: Creating a role assignment under the scope of "/subscriptions/5a3beddb-4144-43e8-9da9-1f0fc61f97bb"
WARNING: Retrying role assignment creation: 1/36
WARNING: Retrying role assignment creation: 2/36
WARNING: Retrying role assignment creation: 3/36
WARNING: Retrying role assignment creation: 4/36
WARNING: Retrying role assignment creation: 5/36
WARNING: Retrying role assignment creation: 6/36
WARNING: Retrying role assignment creation: 7/36
WARNING: Retrying role assignment creation: 8/36
WARNING: Retrying role assignment creation: 9/36
WARNING: Retrying role assignment creation: 10/36
INFO: command ran in 71.587 seconds.
{
"appId": "a7f9e99e-d8f3-4f5b-9023-b63d800d8610",
"displayName": "nestazure",
"name": "http://nestazure",
"password": "a3960577-c370-4d9d-94ac-5eb0883602e9",
"tenant": "a17c6b6a-1c34-4236-8036-8f960eba4937"
}
hexa az storage account list --resource-group "nestazure" --subscription "5a3beddb-4144-43e8-9da9-1f0fc61f97bb" --query "[].{name:name, id:id, location:location, tags:tags}" --output json --verbose +1m
/usr/local/Cellar/azure-cli/2.0.79_1/libexec/lib/python3.8/site-packages/azure/multiapi/storage/v2018_11_09/blob/_upload_chunking.py:403: SyntaxWarning: "is" with a literal. Did you mean "=="?
if n is 0 or self._buffer.closed:
/usr/local/Cellar/azure-cli/2.0.79_1/libexec/lib/python3.8/site-packages/azure/multiapi/storage/v2018_11_09/blob/baseblobservice.py:1063: SyntaxWarning: "is not" with a literal. Did you mean "!="?
if lease_duration is not -1 and \
/usr/local/Cellar/azure-cli/2.0.79_1/libexec/lib/python3.8/site-packages/azure/multiapi/storage/v2018_11_09/blob/baseblobservice.py:2719: SyntaxWarning: "is not" with a literal. Did you mean "!="?
if lease_duration is not -1 and \
/usr/local/Cellar/azure-cli/2.0.79_1/libexec/lib/python3.8/site-packages/azure/multiapi/storage/v2018_11_09/common/_connection.py:82: SyntaxWarning: "is" with a literal. Did you mean "=="?
self.protocol = self.protocol if parsed_url.scheme is '' else parsed_url.scheme
/usr/local/Cellar/azure-cli/2.0.79_1/libexec/lib/python3.8/site-packages/azure/multiapi/cosmosdb/v2017_04_17/common/_connection.py:91: SyntaxWarning: "is" with a literal. Did you mean "=="?
self.protocol = self.protocol if parsed_url.scheme is '' else parsed_url.scheme
INFO: command ran in 1.253 seconds.
[]
hexa az storage account create --location "westeurope" --name "nestazure8849" --subscription "5a3beddb-4144-43e8-9da9-1f0fc61f97bb" --resource-group "nestazure" --kind StorageV2 --tag "x-created-by=hexa" --query "{name:name, id:id, location:location}" --output json --verbose +2s
INFO: command ran in 27.514 seconds.
{
"id": "/subscriptions/5a3beddb-4144-43e8-9da9-1f0fc61f97bb/resourceGroups/nestazure/providers/Microsoft.Storage/storageAccounts/nestazure8849",
"location": "westeurope",
"name": "nestazure8849"
}
hexa az storage account show-connection-string --name "nestazure8849" --resource-group "nestazure" --subscription "Free Trial" --query "connectionString" --output json --verbose +28s
INFO: command ran in 0.873 seconds.
"DefaultEndpointsProtocol=https;EndpointSuffix=core.windows.net;AccountName=nestazure8849;AccountKey=sYmqsPu2pYM1NQoxV5v4AmZQsTzf5++z4UEdYv/0GMamdWxUrY4BFCplNIAcqKEjO2JyEUKuPH8v7cU43kWpwA=="
✗ TypeError: Cannot convert undefined or null to object
at Object.saveWorkspace (/Users/joaquin.bravo/.nvm/versions/node/v10.18.1/lib/node_modules/@manekinekko/hexa/build/core/utils.js:283:22)
at /Users/joaquin.bravo/.nvm/versions/node/v10.18.1/lib/node_modules/@manekinekko/hexa/build/features/storage/index.js:123:29
at step (/Users/joaquin.bravo/.nvm/versions/node/v10.18.1/lib/node_modules/@manekinekko/hexa/build/features/storage/index.js:33:23)
at Object.next (/Users/joaquin.bravo/.nvm/versions/node/v10.18.1/lib/node_modules/@manekinekko/hexa/build/features/storage/index.js:14:53)
at fulfilled (/Users/joaquin.bravo/.nvm/versions/node/v10.18.1/lib/node_modules/@manekinekko/hexa/build/features/storage/index.js:5:58)
at process._tickCallback (internal/process/next_tick.js:68:7)
✗ Abort.
✗ TypeError: Cannot read property 'name' of undefined
at /Users/joaquin.bravo/.nvm/versions/node/v10.18.1/lib/node_modules/@manekinekko/hexa/build/features/functions/index.js:63:76
at step (/Users/joaquin.bravo/.nvm/versions/node/v10.18.1/lib/node_modules/@manekinekko/hexa/build/features/functions/index.js:44:23)
at Object.next (/Users/joaquin.bravo/.nvm/versions/node/v10.18.1/lib/node_modules/@manekinekko/hexa/build/features/functions/index.js:25:53)
at /Users/joaquin.bravo/.nvm/versions/node/v10.18.1/lib/node_modules/@manekinekko/hexa/build/features/functions/index.js:19:71
at new Promise (<anonymous>)
at __awaiter (/Users/joaquin.bravo/.nvm/versions/node/v10.18.1/lib/node_modules/@manekinekko/hexa/build/features/functions/index.js:15:12)
at module.exports (/Users/joaquin.bravo/.nvm/versions/node/v10.18.1/lib/node_modules/@manekinekko/hexa/build/features/functions/index.js:57:12)
at /Users/joaquin.bravo/.nvm/versions/node/v10.18.1/lib/node_modules/@manekinekko/hexa/build/commands/init.js:139:42
at step (/Users/joaquin.bravo/.nvm/versions/node/v10.18.1/lib/node_modules/@manekinekko/hexa/build/commands/init.js:33:23)
at Object.next (/Users/joaquin.bravo/.nvm/versions/node/v10.18.1/lib/node_modules/@manekinekko/hexa/build/commands/init.js:14:53)
✗ Abort.
✔ Configuration saved to /Users/joaquin.bravo/Documents/js/nest/nest-azure/hexa.json
✔ Done in 168 seconds.
@jackbravo please let me know if v1.3.3 solved your issue.
Hi @manekinekko . It did changed the error to something else :-p:
✗ TypeError: Cannot read property 'name' of undefined at /Users/joaquin.bravo/.nvm/versions/node/v10.18.1/lib/node_modules/@manekinekko/hexa/build/features/functions/init.js:56:84
This is the complete log with --debug
.
hexa init --just=functions -d
██╗ ██╗ ███████╗ ██╗ ██╗ █████╗
██║ ██║ ██╔════╝ ╚██╗██╔╝ ██╔══██╗
███████║ █████╗ ╚███╔╝ ███████║
██╔══██║ ██╔══╝ ██╔██╗ ██╔══██║
██║ ██║ ███████╗ ██╔╝ ██╗ ██║ ██║
╚═╝ ╚═╝ ╚══════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝
? Configuration file found. Do you want to override it? false Yes
? Enter a name for the project: nestazure
hexa az group exists --name nestazure --output json --verbose +0ms
INFO: command ran in 2.563 seconds.
true
hexa az group show -n nestazure --query "{name:name, id:id, location:location}" --output json --verbose +4s
INFO: command ran in 1.088 seconds.
{
"id": "/subscriptions/5a3beddb-4144-43e8-9da9-1f0fc61f97bb/resourceGroups/nestazure",
"location": "westeurope",
"name": "nestazure"
}
hexa az ad sp create-for-rbac --name="http://nestazure" --role Contributor --output json --verbose +2s
WARNING: Found an existing application instance of "a7f9e99e-d8f3-4f5b-9023-b63d800d8610". We will patch it
WARNING: Creating a role assignment under the scope of "/subscriptions/5a3beddb-4144-43e8-9da9-1f0fc61f97bb"
WARNING: Role assignment already exits.
INFO: command ran in 8.562 seconds.
{
"appId": "a7f9e99e-d8f3-4f5b-9023-b63d800d8610",
"displayName": "nestazure",
"name": "http://nestazure",
"password": "81ea31b8-8327-47b3-bf0f-1b45fad45425",
"tenant": "a17c6b6a-1c34-4236-8036-8f960eba4937"
}
hexa az storage account list --resource-group "nestazure" --subscription "5a3beddb-4144-43e8-9da9-1f0fc61f97bb" --query "[].{name:name, id:id, location:location, tags:tags}" --output json --verbose +9s
INFO: command ran in 1.449 seconds.
[
{
"id": "/subscriptions/5a3beddb-4144-43e8-9da9-1f0fc61f97bb/resourceGroups/nestazure/providers/Microsoft.Storage/storageAccounts/nestazure8849",
"location": "westeurope",
"name": "nestazure8849",
"tags": {
"x-created-by": "hexa"
}
}
]
hexa az storage account show-connection-string --name "nestazure8849" --resource-group "nestazure" --subscription "Free Trial" --query "connectionString" --output tsv --verbose +2s
INFO: command ran in 1.139 seconds.
DefaultEndpointsProtocol=https;EndpointSuffix=core.windows.net;AccountName=nestazure8849;AccountKey=sYmqsPu2pYM1NQoxV5v4AmZQsTzf5++z4UEdYv/0GMamdWxUrY4BFCplNIAcqKEjO2JyEUKuPH8v7cU43kWpwA==
hexa az functionapp list --resource-group "nestazure" --subscription "5a3beddb-4144-43e8-9da9-1f0fc61f97bb" --query "[].{id: id, name: name, appServicePlanId: appServicePlanId, hostName: defaultHostName, state: state, tags: tags}" --output json --verbose +2s
/usr/local/Cellar/azure-cli/2.0.79_1/libexec/lib/python3.8/site-packages/azure/storage/blob/_upload_chunking.py:403: SyntaxWarning: "is" with a literal. Did you mean "=="?
if n is 0 or self._buffer.closed:
/usr/local/Cellar/azure-cli/2.0.79_1/libexec/lib/python3.8/site-packages/azure/storage/blob/baseblobservice.py:1009: SyntaxWarning: "is not" with a literal. Did you mean "!="?
if lease_duration is not -1 and \
/usr/local/Cellar/azure-cli/2.0.79_1/libexec/lib/python3.8/site-packages/azure/storage/blob/baseblobservice.py:2660: SyntaxWarning: "is not" with a literal. Did you mean "!="?
if lease_duration is not -1 and \
/usr/local/Cellar/azure-cli/2.0.79_1/libexec/lib/python3.8/site-packages/azure/storage/common/_connection.py:82: SyntaxWarning: "is" with a literal. Did you mean "=="?
self.protocol = self.protocol if parsed_url.scheme is '' else parsed_url.scheme
INFO: command ran in 4.273 seconds.
[]
hexa az functionapp create --resource-group nestazure --consumption-plan-location westeurope --name nestazure-61661 --storage-account nestazure8849 --runtime node --disable-app-insights --tag 'x-created-by=hexa' --query "{id: id, name: name, appServicePlanId: appServicePlanId, hostName: defaultHostName, state: state, tags: tags}" --output json --verbose +5s
INFO: command ran in 177.001 seconds.
{
"appServicePlanId": null,
"hostName": "nestazure-61661.azurewebsites.net",
"id": "/subscriptions/5a3beddb-4144-43e8-9da9-1f0fc61f97bb/resourceGroups/nestazure/providers/Microsoft.Web/sites/nestazure-61661",
"name": "nestazure-61661",
"state": "Running",
"tags": {
"x-created-by": "hexa"
}
}
✗ TypeError: Cannot read property 'name' of undefined
at /Users/joaquin.bravo/.nvm/versions/node/v10.18.1/lib/node_modules/@manekinekko/hexa/build/features/functions/init.js:56:84
at step (/Users/joaquin.bravo/.nvm/versions/node/v10.18.1/lib/node_modules/@manekinekko/hexa/build/features/functions/init.js:33:23)
at Object.next (/Users/joaquin.bravo/.nvm/versions/node/v10.18.1/lib/node_modules/@manekinekko/hexa/build/features/functions/init.js:14:53)
at /Users/joaquin.bravo/.nvm/versions/node/v10.18.1/lib/node_modules/@manekinekko/hexa/build/features/functions/init.js:8:71
at new Promise (<anonymous>)
at __awaiter (/Users/joaquin.bravo/.nvm/versions/node/v10.18.1/lib/node_modules/@manekinekko/hexa/build/features/functions/init.js:4:12)
at module.exports (/Users/joaquin.bravo/.nvm/versions/node/v10.18.1/lib/node_modules/@manekinekko/hexa/build/features/functions/init.js:47:12)
at /Users/joaquin.bravo/.nvm/versions/node/v10.18.1/lib/node_modules/@manekinekko/hexa/build/features/functions/index.js:94:61
at step (/Users/joaquin.bravo/.nvm/versions/node/v10.18.1/lib/node_modules/@manekinekko/hexa/build/features/functions/index.js:44:23)
at Object.next (/Users/joaquin.bravo/.nvm/versions/node/v10.18.1/lib/node_modules/@manekinekko/hexa/build/features/functions/index.js:25:53)
✗ Abort.
✔ Configuration saved to /Users/joaquin.bravo/Documents/js/nest/nest-azure/hexa.json
✔ Done in 210 seconds.
~/D/j/n/nest-azure (master|✚1…) $ hexa --version
██╗ ██╗ ███████╗ ██╗ ██╗ █████╗
██║ ██║ ██╔════╝ ╚██╗██╔╝ ██╔══██╗
███████║ █████╗ ╚███╔╝ ███████║
██╔══██║ ██╔══╝ ██╔██╗ ██╔══██║
██║ ██║ ███████╗ ██╔╝ ██╗ ██║ ██║
╚═╝ ╚═╝ ╚══════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝
1.3.3
Thanks @jackbravo for trying out 1.3.3. Let me investigate what is causing this new error.
Hi @jackbravo, unfortunately, I did not manage to reproduce the issue. So here are a couple of things to try, if you will:
hexa init --just=functions --debug --verbose
(this will give more logs)2.0.81
2.7.2100
Let's hope to find out what's causing this issue. Thank you for your help!
@manekinekko getting the same exception along with other errors. Please find the screenshots.
This error encountered first
Then this happened.
Note: I updated Azure Function Core tools to 2.7.2100
and updated Azure CLI as well to 2.0.81
Thanks for your feedback. I will do more investigations and let you know.
Describe the bug I'm following the nitro guide. Everything worked ok until the
hexa init --just=functions
command which failed with:To Reproduce Just follow the nitro guide until the same step
Expected behavior A clear and concise description of what you expected to happen.
Screenshots
This is the full dump of the command:
Desktop (please complete the following information):
Additional context Repo with all the code here: https://github.com/jackbravo/nest-azure