-
Notifications
You must be signed in to change notification settings - Fork 51
Problem running test #28
Comments
Just a suggestion... no idea if it will work, but try https://cs8.salesforce.com in place of https://your-domain.cs8.my.salesforce.com. And does the cs8 really belong there? In other orgs where I have "my domain" activated, the URLs look like https://my-domain.my.salesforce.com. The pod identifier isn't part of the URL. If my first suggestion doesn't work, try https://your-domain.my.salesforce.com. |
I changed the hostname as you said and now I got the following exception:
|
@focadizUCSF The error indicates that the OAuth setup is incorrect. Please try out the curl command : curl -v (Salesforce_Org_URL)/services/oauth2/token -d "grant_type=password" -d "client_id=" -d "client_secret= ***_" -d "username=_" -d "password= ***" as mentioned in the README file and check if you are able to get Access token successfully. If you do get issues , please follow the links in the README file : http://salesforce.stackexchange.com/questions/40346/where-do-i-find-the-client-id-and-client-secret-of-an-existing-connected-app |
Hi @adarsh-ramakrishna-sfdc and @tfuda, thanks for your support and help, I truly appreciate it. After we ran curl we were able to get the access token and after we ran maven we saw the test started running in Salesforce, however, looks like something breaks in the middle because we don't get response back from Salesforce. In the stacktrace I attached you can see some entries like:
But after some tests running we got:
|
@focadizUCSF This is interesting .. Because, this step in the execution should proceed if the curl command is returning access token for you. Can you please confirm if you are using the exact same combination of username, password, client id and client secret while executing the ApexUnit ? Once you confirm, do you mind sharing the command you are using to execute the tool? Of course, please mask the sensitive login credentials before you share it here.. |
Hello again, This is what I got after running curl:
The only weird thing I can see is that curl returned a different hostname in the instance_url property. I also changed the log level to DEBUG but still see the same results. I also checked the client_id and client_secret and they are the same. I'm wondering if it's because the Salesforce org has a custom domain that uses a double dash. Thanks. |
Yes.. That might be the reason; not sure though.. Can you try providing the url that you got from the curl command, for executing the ApexUnit? I assume that you are trying both the operations: executing curl command and executing ApexUnit from the same system and network configuration; just making sure that there is no firewall/reachability issue.. |
When I run curl and mvn using my custom domain I get the following messages:
Actually that error was the reason I opened the ticket and @tfuda recommended to use the other url convention (cs8.calesforce.com). I'm also wondering if the message: |
Since the command runs using arguments that are denoted by Is that true? |
@focadizUCSF Having - in the command wouldn't cause any problem. Space is used as delimiter . I verified the same by providing a - in command line parameters "-regex.for.selecting.source.classes.for.code.coverage.computation Sample,Mobile,-Wrapper" ; it didnt cause any issues for me |
Hi Adarsh, thank you for your prompt responses. I'm working with Felipe to roll it out. We were also wondering if the message: WARNING: Going to buffer response body of large or unknown size. Using getResponseBodyAsStream instead is recommended. might be related to the root cause. |
Hello @milters I don't see 200 OK status message printed in the console output shared by @focadizUCSF . This indicates that the authentication for OAuth is most likely to be the issue. But the fact that curl command returns access token but the same parameters doesn't work for executing the tool is baffling .. Also the below warning message in the console output shared by @focadizUCSF caught my attention(I don't get this warning message): Few of the suggested solutions in these posts :
Can you guys try playing around with Domain value? |
@focadizUCSF @milters Any update on this issue? We haven't heard back from you guys since a couple of weeks.. |
Hello @focadizUCSF and @milters |
Hi @adarsh-ramakrishna-sfdc, @milters and I ran the tool using a different Salesforce org and it worked perfectly. We could see the report! However, in the sandbox with custom domain we couldn't make it work and tried changing multiple configurations for the user and the Connected App. A Salesforce engineer said that he would need to check the user and Connected app permissions because everything else looked fine. Seems like you can close the issue. Thanks so much for being supportive with us, your help was very helpful. |
Thanks @focadizUCSF . Glad to be of any help.. |
Hi, we are trying to run the example you provided in the README file as follows:
mvn compile exec:java -Dexec.mainClass="com.sforce.cd.apexUnit.ApexUnitRunner" -Dexec.args="-org.login.url ‘https://medctr-ucsf--stage.cs8.my.salesforce.com’ -org.username user@test.com -org.password xXxXxXxX -org.client.id xXxXxXxXxX -org.client.secret xXxXxXxXxXxX -org.wide.code.coverage.threshold 50 -team.code.coverage.threshold 50 -regex.for.selecting.source.classes.for.code.coverage.computation Test1 -regex.for.selecting.test.classes.to.execute Class1"
However, we got the following exception:
.. WARNING: Cookie rejected: "$Version=0; BrowserId=WoAiW7M7Ru2XYetBKiFLEw; $Path=/; $Domain=.salesforce.com". Domain attribute ".salesforce.com" violates RFC 2109: host minus domain may not contain any dots Feb 18, 2016 4:58:11 PM org.apache.commons.httpclient.HttpMethodBase getResponseBody WARNING: Going to buffer response body of large or unknown size. Using getResponseBodyAsStream instead is recommended. [com.sforce.cd.apexUnit.ApexUnitRunner.main()] ERROR com.sforce.cd.apexUnit.ApexUnitUtils - Unable to get access_token for OAuth authentication and hence unable to establish connection with the web services.Terminating the process.. [com.sforce.cd.apexUnit.ApexUnitRunner.main()] INFO com.sforce.cd.apexUnit.ApexUnitUtils - Shutting down ApexUnit java.lang.Exception: Stack trace ..
I hope you can help us with this issue, probably we are missing something.
Thanks
The text was updated successfully, but these errors were encountered: