Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Application provision fails with E_INVALIDARG fabric error #107

Open
venkatnossam opened this issue Jun 14, 2018 · 16 comments
Open

Application provision fails with E_INVALIDARG fabric error #107

venkatnossam opened this issue Jun 14, 2018 · 16 comments

Comments

@venkatnossam
Copy link

venkatnossam commented Jun 14, 2018

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
Copy link
Author

Could anybody have any idea?

@samedder
Copy link
Collaborator

samedder commented Jun 14, 2018

@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?

@venkatnossam
Copy link
Author

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
Copy link
Author

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: sfpythoncli@microsoft.com
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:

@samedder
Copy link
Collaborator

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

@samedder samedder changed the title sfctl application provision --no-wait --application-type-build-path Debug throwing me an error: (E_INVALIDARG) Invalid argument Traceback (most recent call last): File "~\appdata\local\programs\python\python36-32\lib\site-packa ges\knack\cli.py", line 125, in invoke cmd_result = self.invocation.execute(args) ~\appdata\local\programs\python\python36-32\lib\site-packa ges\sfctl\custom_app_type.py", line 119, in provision_application_type Application provision fails with E_INVALIDARG fabric error Jun 14, 2018
@venkatnossam
Copy link
Author

venkatnossam commented Jun 15, 2018

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

@samedder
Copy link
Collaborator

@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

@venkatnossam
Copy link
Author

service fabric version: 6.2.283.9494

@Christina-Kang
Copy link
Contributor

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!

@dnataraj
Copy link

dnataraj commented Sep 20, 2018

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: sfpythoncli@microsoft.com
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.

@Christina-Kang
Copy link
Contributor

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

@dnataraj
Copy link

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.

@Christina-Kang
Copy link
Contributor

Christina-Kang commented Sep 25, 2018

@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
Copy link
Contributor

@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

@MyCADDev
Copy link

MyCADDev commented Mar 2, 2020

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

@Christina-Kang
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants