Visual Studio Code(vsc) sfdx Command keeps on running - salesforce-cli

Summary
From past few days the SFDX commands are taking way to long to execute, infact I had to cancel them because they are just shown as running for infinite
For Ex: 1.SFDX: Create Project will run infintly,it will create project on system but vsc don't reload/ shows the created project. I observed this for more than 20 min and i have to cancel that.
2.SFDX: Authorize an Org / SFDX: Deploy Source to Org command progress indicator keeps on running.
Steps To Reproduce:
1. execute sfdx command : SFDX: Create Project used Standard standard project template(default)
Expected result
Project should be created and it should open in vsc.
Actual result
The command progress indicator keeps on running. It creates Project folder on system but command do not terminate. Not getting 2nd Output on vsc which contains ended with exit code 0.
2. execute sfdx command : SFDX: Authorize an Org
Expected result
OUTPUT
Starting SFDX: Authorize an Org 14:57:12.152 sfdx force:auth:web:login --setalias gs0Org --setdefaultusername Successfully authorized with org ID You may now close the browser
14:57:45.237 sfdx force:auth:web:login --setalias gs0Org --setdefaultusername ended with exit code 0
Actual result
The command progress indicator keeps on running.
Output: Starting SFDX: Authorize an Org Salesforce CLI 19:15:20.540 sfdx force:auth:web:login --setalias gs0Org --setdefaultusername Successfully authorized with org ID You may now close the browser
Not getting this
sfdx force:auth:web:login --setalias gs0Org --setdefaultusername ended with exit code 0 And Command keeps on running...
Additional information:
VS Code Version: 1.47.3
SFDX CLI Version: sfdx-cli/7.60.0-e2bb2907cb win32-x64 node-v10.15.3
Java Version: 1.8.0_261
System type : 64-bit Operating System,x64-based processor Windows 10

Login into your org and go to my domain and uncheck
Prevent login from https://login.salesforce.com
by this, you'll be able to authenticate your org on VS code.

Related

Google Cloud Run Second Flask Application - requirements.txt issue

I have a google cloud run flask application named "HelloWorld1" already up and running however i need to create a second flask application. I followed the below steps as per documentation:
1- On "Cloud Shell Editor" clicked "<>Cloud Code" --> "New Application" --> "Cloud Run Application Basic Cloud Run Application .."-->"Python (Flask): Cloud Run", provide and new folder and application is created.
2- When i try to run it using "Run on Cloud Run Emulator" i get the following error:
Starting to run the app using configuration 'Cloud Run: Run/Debug Locally' from .vscode/launch.json...
To view more detailed logs, go to Output channel : "Cloud Run: Run/Debug Locally - Detailed"
Dependency check started
Dependency check succeeded
Starting minikube, this may take a while...................................
minikube successfully started
The minikube profile 'cloud-run-dev-internal' has been scheduled to stop automatically after exiting Cloud Code. To disable this on future deployments, set autoStop to false in your launch configuration /home/mian/newapp/.vscode/launch.json
Update initiated
Update failed with error code DEVINIT_REGISTER_BUILD_DEPS
listing files: file pattern [requirements.txt] must match at least one file
Skaffold exited with code 1.
Cleaning up...
Finished clean up.
I tried following:
1- tried to create different type of application e.g django instead of flask however always getting the same error
2- tried to give full path of [requirements.txt] in docker settings, no luck.
Please if someone help me understanding why i am not able to run a second cloud run Flask app due to this error?
It's likely that your Dockerfile references the 'requirements.txt' file, but that file is not in your local directory. So, it gives the error that it's missing:
listing files: file pattern [requirements.txt] must match at least one file

QA Pipeline Run failing in Azure

I'm using Testcomplete as my automation tool. Our pipeline is in Azure and its newly created for QA runs. The test VM was set up in VMSS in Azure. I'm using TestExecute as my test runner. Testexecute is already installed in the VM. When i run the pipeline, I'm getting an error which says
</RunSettings>
**************** Starting test execution *********************
C:\a\_tool\VsTest\17.4.0-preview-20220726-02\x64\tools\net462\Common7\IDE\Extensions\TestPlatform\vstest.console.exe "#C:\a\_temp\4hdijfnknda.tmp"
Microsoft (R) Test Execution Command Line Tool Version 17.4.0-preview-20220726-02 (x64)
Copyright (c) Microsoft Corporation. All rights reserved.
vstest.console.exe "C:\a\1\s\GrizzlyMatters.pjs"
/Settings:"C:\a\_temp\ro5un5cn0ip.tmp.runsettings"
/Logger:"trx"
/TestAdapterPath:"C:\a\1\s\TestCompleteAdapter"
Starting test execution, please wait...
A total of 1 test files matched the specified pattern.
##[error]Failed to get a list of tests from the "C:\a\1\s\GrizzlyMatters.pjs" file due to the following error: Unable to connect to TestExecute: it is running with different rights, or its state is incorrect. Please close it and try again.
No test is available in C:\a\1\s\GrizzlyMatters.pjs. Make sure that test discoverer & executors are registered and platform & framework version settings are appropriate and try again.
Results File: C:\a\_temp\TestResults\AzDevOps_vmliaqa000008_2022-09-01_14_51_35.trx
##[error]Test Run Failed.
Vstest.console.exe exited with code 1.
**************** Completed test execution *********************
Test results files: C:\a\_temp\TestResults\AzDevOps_vmliaqa000008_2022-09-01_14_51_35.trx
No Result Found to Publish 'C:\a\_temp\TestResults\AzDevOps_vmliaqa000008_2022-09-01_14_51_35.trx'.
Created test run: 2724386
Publishing test results: 0
Publishing test results to test run '2724386'.
TestResults To Publish 0, Test run id:2724386
Published test results: 0
Publishing Attachments: 1
Execution Result Code 1 is non zero, checking for failed results
Completed TestExecution Model...
##[warning]Vstest failed with error. Check logs for failures. There might be failed tests.
##[error]Error: The process 'C:\a\_tasks\VSTest_ef087383-ee5e-42c7-9a53-ab56c98420f9\2.205.0\Modules\DTAExecutionHost.exe' failed with exit code 1
##[error]Vstest failed with error. Check logs for failures. There might be failed tests.
Finishing: VsTest - testAssemblies
I've researched everything possible to get a solution. I'm not sure what I need to do. I'm attaching the screenshot of the pipeline config and the error.
Screenshots
Pipeline config 1:
Pipeline config 2:
Pipeline config 3:
Pipeline Run Error:

App in React Native after won't open in device after build successfull

It will show like this after build successful
Error ScreenShot
Installed on 1 device.
BUILD SUCCESSFUL in 22s 27 actionable tasks: 1 executed, 26 up-to-date
The system cannot find the path specified. info Starting the app
(C:\Users\admin\AppData\Local\Android\Sdk\platform-tools/platform-tools/adb
shell am start -n com.sae/com.sae.MainActivity...
But what is "The system cannot find the path specified" ?
How can I fix it ?
thanks in advance

VSTS - Build a Docker Image

I have a .NET Core repo in VSTS. I'm trying to create a Build pipeline that builds a Docker image and adds it to my Azure Container Registry. My Build pipeline has a Docker task. This task has the "Build an image" action selected. This action relies on my Dockerfile, which looks like this:
FROM microsoft/dotnet:2.1.2-runtime-nanoserver-1803
# Install .NET Core
ENV DOTNET_VERSION 2.1.2
When my Build pipeline runs, I get an error that says:
failed to register layer: re-exec error: exit status 1: output: ProcessUtilityVMImage \\?\C:\ProgramData\docker\windowsfilter\82aba535faccd8bf0e5ce3c122247672fa671214000a12c5481972212c5e2ca0\UtilityVM: The system cannot find the path specified.
##[error]C:\Program Files\Docker\docker.exe failed with return code: 1
Why am I getting this error? How do I fix it?
It should be the same issue with this one : https://github.com/Microsoft/vsts-tasks/issues/6510
Seems it still have some issues with nanoserver-1803
Just try to setup and host a custom agent on Azure VM, then check it again.
https://github.com/Microsoft/vsts-tasks/issues/6510#issuecomment-370152300
I found maybe an explication about this error: VSTS agents seem not
support nanoserver-1709 actually. Maybe this will change with the next
version 1803.
See details here: Microsoft/vsts-agent#1393
When I setup and host a custom agent on a machine on Azure, it's
working. So it's not a bug with this task. I close this issue. Thanks!

TeamCity ".Net Process Runner" hangs

We have started migrating our one of several projects to team city as part of CI. Below is how we have setup teamcity build. We are trying to deploy WebSite.
1) Build Step 1 (Package installation)
Using "command line " runner type install required package.
2) Build Step 2 (Build)
Using Runner type "Visual Studio (sln)" (Visual Studio 2010) build website.
3) Build Step 3 (Deploy Web Site)
Using ".Net Process Runner", deployer.exe (x86 built with .Net Framework 4) deploy site.
Deployer.exe reads config file. Config file contains "BuildId", "Environment" and "Servers" where we want build to be pushed.
<buildType id="bt52">
<env name="Debug">
<server path="SERVER1" />
</env>
<env name="QA">
<server path="SERVER2" />
<server path="SERVER3" />
</env>
<env name="UAT">
<server path="SERVER4" />
<server path="SERVER5" />
</env>
</buildType>
Deployer.exe is called with required parameters as below. Which reads config and deploys site to Server2 and Server3.
Deployer.exe "bt52" "QA" "siteQA" "E:\BuildAgent\work\2483052e33e5e1e8\src\diy\" msdeploy.exe
Problem area is step #3.
When we run deployer.exe using .Net process runner as part of team city we see its hanging and not responsind sometime even for 45 minutes. When we try to execute same deployer.exe from build server using command line script executes within couple of seconds.
E:\TeamCity_custom_applications\deployer>Deployer.exe farm1-1 QA siteQA E:\BuildAgent\work\2483052e33e5e1e8\src\diy\ msdeploy.exe
Info
: Processing batch run ... Info : Processing command ...msdeploy.exe
-verb:sync -source:contentPath="E:\BuildAgent\work\2483052e33e5e1e8\src\diy\" -dest:contentPath="siteQA",wmsvc="SERVER2",userName="*****",password="******",authType="Basic"-skip:objectName=filePath,absolutePath=web.config -skip:objectName=dirPath,absolutePath="bin" -enableRule:DoNotDeleteRule -allowUntrusted Info : output >>Total changes: 0 (0 added, 0 deleted, 0 updated, 0 parameters changed, 0
bytes copied) Info : error >>(none) Info : ExitCode >> 0 Info :
Processing command ...msdeploy.exe -verb:sync
-source:contentPath="E:\BuildAgent\work\2483052e33e5e1e8\src\diy\" -dest:contentPath="siteQA",wmsvc="SERVER3",userName="******",password="******",authType="Basic"
-skip:objectName=filePath,absolutePath=web.config -skip:objectName=dirPath,absolutePath="bin" -enableRule:DoNotDeleteRule -allowUntrusted Info : output >>Total changes: 0 (0 added, 0 deleted, 0 updated, 0 parameters ch anged, 0
bytes copied) Info : error >>(none) Info : ExitCode >> 0
Info: Deploy Script Complete.
One more thing we observed is running deployer.exe through teamcity I see that site content gets copied but only for 1 server and teamcity build status stays in "Running" mode. I am wondering if someone can please put little bit of insight on how can I look into this issue.
Update 1:
Thanks for your time looking into it !! What we ended up doing is, Instead of running command "msdeploy.exe" from "cmd.exe" we added "msdeploy.exe" location as Environment variable and executed "msdeploy.exe" in loop for # of servers. This has resolved issue of hanging. Now I am just curious to know why would it behave in such manner where if you execute "msdeploy.exe" from "cmd.exe" it would hang while running directly "msdeploy.exe" it would execute successfully. Any insight into same would be greatly appreciated.
Update 2:
I have added image which explains behavior using process explorer. If we kill msdeploy.exe from process explorer than for next all deployments to that server will not have the issue of build hanging. Please see below image
To be honest, it sounds like you're running into issues with redirecting input/output streams. TeamCity is running your application in a totally headless environment and then you, in turn, are attempting to redirect and parse the output of msdeploy.exe
If that's the case, I'd recommend looking into using the MSDeploy API instead of msdeploy.exe. The latter is just a command line wrapper for the former, so all the functionality is available to you. There's a sample deployment application available on the IIS blog if you need help getting started.
It seems you have NUnit build step configured in TeamCity and invoke cmd.exe from your test. This looks like an issue with the test code then. Most probably it will reproduce without TeamCity if you run the test in question with NUnit directly.
As Richard noted, most probably the issue root cause is related to stdin/stdout processing.
If you want to fix it in your code, you can try to experiment by explicitly closing stdin or the other way around, try writing something into it, etc.
Work around we did is, we observed msdeploy doesn't take more than 3-5 seconds to execute and deploy (Even for our biggest project which is almost 300mb website). So we set timeout of 20 seconds. So far since last 1 weeks we have not seen any issue with it and hopefully it will not cause more trouble but still we are not sure why such behavior.

Resources