Skip to content
This repository has been archived by the owner on Jan 15, 2025. It is now read-only.

Microsoft telemetry Y/N prompt breaking azure pipeline #517

Closed
davidmcgowan opened this issue Feb 4, 2020 · 9 comments · Fixed by #551
Closed

Microsoft telemetry Y/N prompt breaking azure pipeline #517

davidmcgowan opened this issue Feb 4, 2020 · 9 comments · Fixed by #551
Assignees
Labels
Bot Services Required for internal Azure reporting. Do not delete. Do not change color. customer-replied-to Indicates that the team has replied to the issue reported by the customer. Do not delete. customer-reported Issue is created by anyone that is not a collaborator in the repository. R8 Release 8 - March 16th, 2020

Comments

@davidmcgowan
Copy link

I have been setting up azure pipeline where after installing the various dependencies on the build agent (botframework-cli etc) and running command bf luis:convert in the script appears to display the following prompt -

Help us improve products by allowing Microsoft to collect anonymous command and flags usage: (Y/N):

Is there a workaround for this to supress on azure hosted agents?

@munozemilio
Copy link
Contributor

Hello @davidmcgowan, you can do this to bypass the telemetry prompt.

Add this json

{
  "telemetry": true,
}

The file should be placed in the following path:

Unix: ~/.config/@microsoft/botframework-cli/config.json
Windows: %LOCALAPPDATA%@microsoft\botframework-cli\config.json

@daveta daveta added Bot Services Required for internal Azure reporting. Do not delete. Do not change color. customer-replied-to Indicates that the team has replied to the issue reported by the customer. Do not delete. customer-reported Issue is created by anyone that is not a collaborator in the repository. labels Feb 4, 2020
@VladPapacostea-SM
Copy link

Hi @munozemilio, has this workaround that you have suggested been successfully tested on a Window-2019 Agent from the Azure hosted pool??

From what we've tried, the LOCALAPPDATA environment variable is not actually populated on those, and even if you hard code it, it does look like the path doesn't exist/we don't have access to it. With those in mind, this is clearly not a viable workaround. That makes me think that the answer to my previous quesiton is "no".

With that in mind, I'd appreciate if the issue would be reopened and properly addressed. I understand there's no support at the moment for the automation of some of the processes using the botframework sdk and tools, but it feels like we are fighting against the tools.

For example, this is the "workaorund" that we had to put in place to get this to actually work, and it's bloody ridiculous and should not be considered a solution:

image

@munozemilio munozemilio reopened this Feb 5, 2020
@munozemilio munozemilio self-assigned this Feb 7, 2020
@munozemilio munozemilio added the R8 Release 8 - March 16th, 2020 label Feb 7, 2020
@ericchansen
Copy link

ericchansen commented Nov 9, 2020

The echo "Y" | npm install -g @microsoft/botframework-cli" trick doesn't work for me. How are we supposed to use this from Azure Pipelines?

@VladPapacostea-SM, did you find a way?

@munozemilio, you closed this. What's the solution?

@VladPapacostea-SM
Copy link

VladPapacostea-SM commented Nov 9, 2020

@ericchansen which dependencies are you still having issues installing ?
We've ended up separating some of the dependencies into a power shell file that we call in the pipelines, that seems to have solved some of the issues.

image

Edit1: That's because I've spent a lot of time trying to figure out how to get around this issue, and have noticed a difference on how scripts are ran when provided inline in a PowerShell task vs how they are referenced and ran when done through a script file refrence in the PowerShell task

@ericchansen
Copy link

ericchansen commented Nov 9, 2020

@VladPapacostea-SM I am trying to install @microsoft/botframework-cli via inline PowerShell. You don't get anything helpful for debugging. This problem seems to occur on Windows and Linux pools.

Starting: CmdLine
==============================================================================
Task         : Command line
Description  : Run a command line script using Bash on Linux and macOS and cmd.exe on Windows
Version      : 2.177.3
Author       : Microsoft Corporation
Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/command-line
==============================================================================
Generating script.
Script contents:
echo "Y" | npm install -g microsoft/botframework-cli
========================== Starting Command Output ===========================
"C:\windows\system32\cmd.exe" /D /E:ON /V:OFF /S /C "CALL "D:\a\_temp\119fd393-315f-49c5-b792-37549dc32546.cmd""
npm ERR! premature close

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\npm\cache\_logs\2020-11-09T17_12_53_624Z-debug.log
##[error]Cmd.exe exited with code '1'.
Finishing: CmdLine

Here are the contents of the log, which I had to retrieve using a publish task---talk about inconvenience. This also isn't helpful.

0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli   'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'install',
1 verbose cli   '-g',
1 verbose cli   'microsoft/botframework-cli'
1 verbose cli ]
2 info using [email protected]
3 info using [email protected]
4 verbose npm-session 3183fa4857da6df6
5 silly install loadCurrentTree
6 silly install readGlobalPackageData
7 silly fetchPackageMetaData error for github:microsoft/botframework-cli premature close
8 timing stage:rollbackFailedOptional Completed in 1ms
9 timing stage:runTopLevelLifecycles Completed in 27682ms
10 verbose stack Error: premature close
10 verbose stack     at PassThrough.onclose (C:\Program Files\nodejs\node_modules\npm\node_modules\end-of-stream\index.js:47:67)
10 verbose stack     at PassThrough.emit (events.js:326:22)
10 verbose stack     at emitCloseNT (internal/streams/destroy.js:69:8)
10 verbose stack     at processTicksAndRejections (internal/process/task_queues.js:83:21)
11 verbose cwd D:\a\1\s
12 verbose Windows_NT 10.0.17763
13 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "microsoft/botframework-cli"
14 verbose node v12.19.0
15 verbose npm  v6.14.8
16 error premature close
17 verbose exit [ 1, true ]

I'll try it with a PowerShell script like you mentioned.

@VladPapacostea-SM
Copy link

@ericchansen yep we had to publish our logs as well as using debug mode/verbose logs on the powershell inline task to figure this out .. it really wasn't pretty.. but calling it from a ps file rather than inline should fix your issue.

I would also strongly suggest keeping in the try catches as we did ... that was quite helpful at times where the installation was actually successful but the npm task was returning a success message with the wrong code, which was being picked up as an exception/error

@ericchansen
Copy link

Doing npm install inside a *.ps1 file worked---I almost copied your script line for line. The task itself looks like this.

- task: PowerShell@2
  displayName: Install Microsoft Bot Framework CLI, botdispatch, luis-apis and botskills
  inputs:
    targetType: filepath
    filePath: 'pipelines/powershell-scripts/npm-install-bot-framework.ps1'

@microsoftopensource I personally don't think this is an acceptable solution. Why does this particular npm package behave this way? I haven't encountered this issue with any other npm packages. I think issue should be re-opened or a new issue should be created.

@VladPapacostea-SM
Copy link

@ericchansen this package has a post-install script that runs when the installation is finished. It looks for a value in a config file, that cannot be set on an agent from the Azure pool, be it Linux or Windows, due to that path not being accessible to the user.

The whole ecosystem was really not well planned for a CD environment, as I am sure you will discover soon, if you are just the start of your journey with something like the Virtual Assistant.

For now, that's the cleanest workaround that we could find for this issue.

@munozemilio
Copy link
Contributor

Hello @ericchansen @VladPapacostea-SM it is of my interest to provide you the best experience using the tool. We add a few sprints ago a component to detect CI environments. Even if the environment variables are not set, the message prompt should be bypassed if CICD environment is detected. It is also specified in our docs. Please feel free to open a new bug on this not working and I will be more than happy to make it work for you

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bot Services Required for internal Azure reporting. Do not delete. Do not change color. customer-replied-to Indicates that the team has replied to the issue reported by the customer. Do not delete. customer-reported Issue is created by anyone that is not a collaborator in the repository. R8 Release 8 - March 16th, 2020
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants