service-fabric-cli icon indicating copy to clipboard operation
service-fabric-cli copied to clipboard

Application provision fails with E_INVALIDARG fabric error

Open venkatnossam opened this issue 7 years ago • 16 comments

After running sfctl application upload --path ~\Application\pkg\Debug --show-progress

The upload completes successfully, but then when running

sfctl application provision --no-wait --application-type-build-path Debug

I am getting this error

(E_INVALIDARG) Invalid argument Traceback (most recent call last): File "c:\users\venoss\appdata\local\programs\python\python36-32\lib\site-packa ges\knack\cli.py", line 125, in invoke cmd_result = self.invocation.execute(args) File "c:\users\venoss\appdata\local\programs\python\python36-32\lib\site-packa ges\knack\invocation.py", line 85, in execute cmd_result = parsed_args.func(params) File "c:\users\venoss\appdata\local\programs\python\python36-32\lib\site-packa ges\knack\commands.py", line 67, in call return self.handler(*args, **kwargs) File "c:\users\venoss\appdata\local\programs\python\python36-32\lib\site-packa ges\knack\commands.py", line 123, in _command_handler result = op(client, **command_args) if client else op(**command_args) File "c:\users\venoss\appdata\local\programs\python\python36-32\lib\site-packa ges\sfctl\custom_app_type.py", line 119, in provision_application_type raise FabricErrorException(client._deserialize, response) azure.servicefabric.models.fabric_error.FabricErrorException: (E_INVALIDARG) Inv alid argument

sfctl version 5.0.0

venkatnossam avatar Jun 14 '18 02:06 venkatnossam

Could anybody have any idea?

venkatnossam avatar Jun 14 '18 02:06 venkatnossam

@venkatnossam can you edit the title and body of your issue to include the debug logs, as it stands it's difficult to identify what your issue is. Can you please actually fill out the issue template?

samedder avatar Jun 14 '18 02:06 samedder

i ran the following command successfully:

sfctl application upload --path ~\Application\pkg\Debug --show-progress

Upload complete

when i run the following command:

sfctl application provision --no-wait --application-type-build-path Debug

I am getting this error (E_INVALIDARG) Invalid argument Traceback (most recent call last): File "c:\users\venoss\appdata\local\programs\python\python36-32\lib\site-packa ges\knack\cli.py", line 125, in invoke cmd_result = self.invocation.execute(args) File "c:\users\venoss\appdata\local\programs\python\python36-32\lib\site-packa ges\knack\invocation.py", line 85, in execute cmd_result = parsed_args.func(params) File "c:\users\venoss\appdata\local\programs\python\python36-32\lib\site-packa ges\knack\commands.py", line 67, in call return self.handler(*args, **kwargs) File "c:\users\venoss\appdata\local\programs\python\python36-32\lib\site-packa ges\knack\commands.py", line 123, in _command_handler result = op(client, **command_args) if client else op(**command_args) File "c:\users\venoss\appdata\local\programs\python\python36-32\lib\site-packa ges\sfctl\custom_app_type.py", line 119, in provision_application_type raise FabricErrorException(client._deserialize, response) azure.servicefabric.models.fabric_error.FabricErrorException: (E_INVALIDARG) Inv alid argument

venkatnossam avatar Jun 14 '18 10:06 venkatnossam

pip show sfctl Name: sfctl Version: 5.0.0 Summary: Azure Service Fabric command line Home-page: https://github.com/Azure/service-fabric-cli Author: Microsoft Corporation Author-email: [email protected] License: MIT Location: c:\users\venoss\appdata\local\programs\python\python36-32\lib\site-packages Requires: adal, jsonpickle, requests, knack, msrestazure, future, msrest, azure-servicefabric Required-by:

venkatnossam avatar Jun 14 '18 10:06 venkatnossam

@venkatnossam what is the runtime version of you Service Fabric cluster?

samedder avatar Jun 14 '18 18:06 samedder

This is what i see: Version SupportExpiryDate


6.1.456.9494 7/15/2018 12:00:00 AM 6.1.467.9494 7/15/2018 12:00:00 AM 6.1.472.9494 7/15/2018 12:00:00 AM 6.1.480.9494 7/15/2018 12:00:00 AM 6.2.274.9494 6.2.283.9494

venkatnossam avatar Jun 15 '18 20:06 venkatnossam

@venkatnossam it should be a property of the cluster, if you look at your Service Fabric cluster in the Azure Portal, it should have an entry for Service Fabric Version

samedder avatar Jun 15 '18 20:06 samedder

service fabric version: 6.2.283.9494

venkatnossam avatar Jun 17 '18 14:06 venkatnossam

I suspect that this might be an issue with the way that we are serializing the body parameters. Would it be possible for you to provide a capture of the outgoing HTTP POST request from calling the sfctl command? Could you also share the version of msrest you have installed?

In the meantime, to unblock you, you can provision with the REST API for provision application or if you have PowerShell installed, you can use the PowerShell command Register-ServiceFabricApplicationType

Thank you!

Christina-Kang avatar Jun 18 '18 18:06 Christina-Kang

I have the same issue

`sfctl application provision --application-type-build-path app

(E_INVALIDARG) Invalid argument Traceback (most recent call last): File "/home/dnataraj/.local/lib/python3.5/site-packages/knack/cli.py", line 125, in invoke cmd_result = self.invocation.execute(args) File "/home/dnataraj/.local/lib/python3.5/site-packages/knack/invocation.py", line 85, in execute cmd_result = parsed_args.func(params) File "/home/dnataraj/.local/lib/python3.5/site-packages/knack/commands.py", line 67, in call return self.handler(*args, **kwargs) File "/home/dnataraj/.local/lib/python3.5/site-packages/knack/commands.py", line 123, in _command_handler result = op(client, **command_args) if client else op(**command_args) File "/home/dnataraj/.local/lib/python3.5/site-packages/sfctl/custom_app_type.py", line 119, in provision_application_type raise FabricErrorException(client._deserialize, response) azure.servicefabric.models.fabric_error.FabricErrorException: (E_INVALIDARG) Invalid argument

` Ubuntu 16.04 LTS

` pip3 show sfctl

Name: sfctl Version: 6.0.0 Summary: Azure Service Fabric command line Home-page: https://github.com/Azure/service-fabric-cli Author: Microsoft Corporation Author-email: [email protected] Installer: pip License: MIT Location: /home/dnataraj/.local/lib/python3.5/site-packages Classifiers: Development Status :: 5 - Production/Stable Intended Audience :: Developers Topic :: Software Development :: Build Tools Environment :: Console License :: OSI Approved :: MIT License Natural Language :: English Programming Language :: Python :: 2.7 Programming Language :: Python :: 3.5 Programming Language :: Python :: 3.6 Programming Language :: Python :: 3.7 Entry-points: [console_scripts] sfctl = sfctl:launch ` Service Fabric Cluster (Azure Portal) 6.3.124.1 / Ubuntu 16.04 LTS

Deploying ASP.NET Core 2.0 Application.

dnataraj avatar Sep 20 '18 10:09 dnataraj

Thank you for reporting this, @dnataraj , and apologies that you're running into this issue.

Does the mitigation provided above work for you? (using REST or PowerShell)

In the mean time, we would very much appreciate your help in getting to the bottom of this issue. Can you provide the output / version from pip3 show msrest? Additionally, can you provide a capture of the outgoing HTTP request from this sfctl call? If not, I can provide a modified version of sfctl to print out the data we need.

Thank you! Christina

Christina-Kang avatar Sep 20 '18 18:09 Christina-Kang

Hi @Christina-Kang, I'm on Ubuntu 16.04, and Powershell for Linux does not have the SF SDK, so I can't use that work around (or does it?). I haven't tried hitting the REST API, would you have an example of the provisioning payload at hand?

Here is the output from msrest :

` Metadata-Version: 2.1 Name: msrest Version: 0.5.5 Summary: AutoRest swagger generator Python client runtime. Home-page: https://github.com/Azure/msrest-for-python Author: Microsoft Corporation Author-email: UNKNOWN Installer: pip License: MIT License Location: /home/dnataraj/.local/lib/python3.5/site-packages Requires: requests, certifi, requests-oauthlib, isodate Classifiers: Development Status :: 4 - Beta Programming Language :: Python Programming Language :: Python :: 2 Programming Language :: Python :: 2.7 Programming Language :: Python :: 3 Programming Language :: Python :: 3.4 Programming Language :: Python :: 3.5 Programming Language :: Python :: 3.6 License :: OSI Approved :: MIT License Topic :: Software Development

` I believe the request from sfctl is over HTTPS? In which case I probably cannot get a cleartext dump of it with standard tooling (tcpdump etc.). If you can help me here, let me know.

Thanks.

dnataraj avatar Sep 21 '18 07:09 dnataraj

@dnataraj to make the REST call, I use either Postman or Advanced REST Client.

The URL of the HTTPS POST request will look like this:

https://<your-URL>:<your-port-usually-19080>/ApplicationTypes/$/Provision?api-version=6.2

The body will look like:

{
"Kind": "ImageStorePath",
"ApplicationTypeBuildPath": "app"
}

For Advanced Rest Client (a Chrome extension), you can get XHR Extension for authenticating the request. It will allow you to use certs installed in Chrome. You will then have an option near the request URL in the UI to select "Use XHR extension".

For Postman authentication, under "Settings" in the top bar, there is a tab "Certificates" with an option "Add Certificate". If you are using a .pem file, the host will be <your-URL>:<your-port-usually-19080> and the CRT file and Key file can both be the pem file. There are other ways of authenticating the cluster available on the app as well.

Please let me know if this workaround works for you. If not, I'd love to set up a call and see if we can fix the issue. We are working on making our error messages return more meaning error messages in the future.

I am looking into the best way to get the request body, and will update later.

Thanks again, Christina

Christina-Kang avatar Sep 25 '18 21:09 Christina-Kang

@dnataraj I have attached a whl for sfctl which will create a file called application_provision_request.json at the file location you run sfctl application provision --application-type-build-path app.

There should be a portion which looks like "body": "{\"Kind\": \"ImageStorePath\", \"Async\": false, \"ApplicationTypeBuildPath\": \"app\"}". Can you share that? Can you also share the uri portion above that? Specifically, the part after the host name and port which should be similar to ApplicationTypes/$/Provision?api-version=6.2&timeout=60

If this doesn't turn anything up, we can take a look at your traces to find the issue, and fix it on our end to make the issue clearer in the future.

Thanks!

sfctl-6.0.0-record-app-provision.zip

Christina-Kang avatar Sep 25 '18 22:09 Christina-Kang

Hi @Christina-Kang We are getting the same error in CentOS 7 using a standalone cluster. Here is my application_provision_request.json attached.

In this URL there is a note saying "Standalone clusters aren't supported in Linux."

Does this mean that provision will not work or merely Microsoft will not actively support Standalone Linux clusters.

thanks

application_provision_request.zip

MyCADDev avatar Mar 02 '20 19:03 MyCADDev

@jeffj6123 Can you answer MyCADDev's question? Thanks!

Christina-Kang avatar Mar 02 '20 19:03 Christina-Kang