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

ngrok, error 6022, and Teams scaffolding #6855

Closed
elthombre opened this issue Sep 5, 2022 · 22 comments
Closed

ngrok, error 6022, and Teams scaffolding #6855

elthombre opened this issue Sep 5, 2022 · 22 comments
Labels
teams-developer-support Question related to extensibility (Bot, ME, Tab) would be marked under this label

Comments

@elthombre
Copy link

I have been trying to run some samples. Localhost shows in the browser OK as does the default URL that ngrok provides when started on the cmd.

In VS Code, the solution starts & runs. When the URL provided is browsed, it throws the ERR_NGROK_6022 exception.

Initially, I noted an ngrok.yml discrepancy in the utils.js: join(homedir(), ".ngrok2", "ngrok.yml") vs. "C:\Users[username]\AppData\Local/ngrok/ngrok.yml" - the latter being my ngrok location.

I then hardcoded the local path in the function and I've also updated ngrok, node, npm, etc. to latest stable versions. I continue to receive that exception.

In the dashboard, there was a 404 Not Found exception associated with GET /favicon.ico. I updated the index.html files as follows:

https://stackoverflow.com/questions/31075893/im-getting-favicon-ico-error/

https://stackoverflow.com/questions/1321878/how-to-prevent-favicon-ico-requests#

the ERR_NGROK_6022 exception persists. I have found the following:

https://stackoverflow.com/questions/71900716/im-getting-ngrok-error-6022-after-doing-everything-properly

It was my initial understanding that ngrok could not find the .yml file & associated authtoken.

Please advise.

Thanks

@ghost
Copy link

ghost commented Sep 5, 2022

Hi elthombre! Thank you for bringing this issue to our attention. We will investigate and if we require further information we will reach out in one business day. Please use this link to escalate if you don't get replies.

Best regards, Teams Platform

@ghost ghost added the needs-triage 🔍 label Sep 5, 2022
@ghost ghost added this to Needs triage in Teams App Development Sep 5, 2022
@ghost ghost added the teams-developer-support Question related to extensibility (Bot, ME, Tab) would be marked under this label label Sep 5, 2022
@ChetanSharma-msft
Copy link
Collaborator

Hello @elthombre - Can you please the repro steps and sample code link if any ?
We will further investigate your issue accordingly.

@elthombre
Copy link
Author

Try the chapter 3 source:

https://github.com/Apress/pro-microsoft-teams-dev

and when I see the following:

https://docs.microsoft.com/en-us/microsoftteams/platform/tabs/how-to/create-personal-tab?pivots=node-java-script

it doesn't appear to reference any installation or versioning of 3rd party tools such as node, ngrok, etc. How might this affect the scaffolding created by the Yeoman generator?

Are there versioning considerations?

@elthombre
Copy link
Author

Looking a bit further, in the top-level folder, there is .env file with configuration settings:

NGROK configuration for development

NGROK authentication token (leave empty for anonymous)

NGROK_AUTH=

NGROK sub domain. ex "myapp" or (leave empty for random)

NGROK_SUBDOMAIN=

NGROK region. (us, eu, au, ap - default is us)

NGROK_REGION=

@elthombre
Copy link
Author

I did not create or set these.

@elthombre
Copy link
Author

@sayali-MSFT , and if Azure is not in play?

Teams App Development automation moved this from Needs triage to Closed Sep 20, 2022
@ghost
Copy link

ghost commented Sep 20, 2022

Tell us about your experience!

Hi elthombre! This issue is closed in our system. We would like your feedback on your experience with our support team and Platform.

Best regards,
Teams Platform

@sayali-MSFT sayali-MSFT reopened this Sep 20, 2022
Teams App Development automation moved this from Closed to Needs triage Sep 20, 2022
@ghost
Copy link

ghost commented Sep 20, 2022

Hi elthombre! Thank you for bringing this issue to our attention. We will investigate and if we require further information we will reach out in one business day. Please use this link to escalate if you don't get replies.

Best regards, Teams Platform

@sayali-MSFT
Copy link

@sayali-MSFT , and if Azure is not in play?

@elthombre -Could you please elaborate more on your requirement?

@sayali-MSFT sayali-MSFT added the needs-author-feedback Needs more info from the customer. label Sep 26, 2022
@ghost ghost moved this from Needs triage to Waiting For User Response in Teams App Development Sep 26, 2022
@ghost
Copy link

ghost commented Sep 29, 2022

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 3 days. It will be closed if no further activity occurs within 3 days of this comment.

@elthombre
Copy link
Author

#4249

And note the above is locked for further commentary even though it is not clear if the issue is fixed. Apparently not as I am experiencing this.

Then there are the issues as described above with ngrok along with the Microsoft tutorial referenced. There was an Azure-related article cited but it isn't clear how that fits into the documentation previously listed and the URLs shown in the article are not those as offered up from within Visual Studio code.

@ghost ghost added needs-attention and removed needs-author-feedback Needs more info from the customer. labels Sep 30, 2022
@ghost ghost moved this from Waiting For User Response to Active in Teams App Development Sep 30, 2022
@sayali-MSFT
Copy link

@elthombre - If you want to get the ngrok Authtoken you need to run the below command-
ngrok authtoken BDZIXnhJt2HNWLXyQ5PM_qCaBq0W2sNFcCa0rXXXX

The default location of the ngrok agent's configuration file varies based on your operating system. The easiest way to find the configuration file location is to run:

ngrok config check

which will validate and print the location of the configuration file.
ngrokcmd

Reference document- https://ngrok.com/docs/ngrok-agent/config

@elthombre
Copy link
Author

@sayali-MSFT - the problem is not with ngrok directly. ngrok, itself, is running fine. It has to do with the scaffolding. The ngrok URLs that are presented from the actual project do not browse as expected. And ngrok support noted the .env file with ngrok settings which may be the culprit.

On top of that, there is issue #4249

which has been locked but it is not clear if it has been resolved. I am not able to correctly reach the app even though it checks out as OK from within my tenant.

@ChetanSharma-msft
Copy link
Collaborator

Hello @elthombre - As per my understanding, you are following the Readme for below samples and trying to run it and getting the scaffolding error?
https://github.com/Apress/pro-microsoft-teams-dev/tree/main/Chapter%203/nodejs/firstTeamsAppTeamsGenerator

We will test it from our end and get back to you.

If you have any other specific steps, please do share.

@elthombre
Copy link
Author

Hi @ChetanSharma-msft ,

There are more details here:

pnp/generator-teams#335

also, working through the following and getting to Step 3:

https://learn.microsoft.com/en-us/microsoftteams/platform/sbs-gs-javascript?tabs=vscode%2Cvsc%2Cviscode&tutorial-step=3

and it fails with:

× Development certificate for localhost
Command failed: powershell.exe -NoProfile -ExecutionPolicy unrestricted -Command "(Import-Certificate -FilePath 'C:/Users/Owner/.fx/certificate/localhost.crt' -CertStoreLocation Cert:\CurrentUser\Root)[0].Thumbprint"
Import-Certificate : Cannot find object or property. (Exception from HRESULT: 0x80092004)
At line:1 char:2

  • (Import-Certificate -FilePath 'C:/Users/Owner/.fx/certificate/localho ...
  •  + CategoryInfo          : NotSpecified: (:) [Import-Certificate], COMException
     + FullyQualifiedErrorId : System.Runtime.InteropServices.COMException,Microsoft.CertificateServices.Commands.Impor 
    tCertificateCommand
    
    
    

Visit https://aka.ms/teamsfx-check-prerequisites-task to learn more about 'Validate & install prerequisites' task.

[2022-11-02T14:29:35.816Z] [Error] - code:Ext.PrerequisitesValidationError, message: Validate & install prerequisites failed. Please check the output panel to see the details.

Note in the above link:

https://aka.ms/teamsfx-check-prerequisites-task

That ngrok is, yet again, referenced. However, apparently, when installed separately / globally outside of Yo Teams, it can create conflict. Issue #335 from the above link offers more details.

Meanwhile, in other Microsoft documentation, it appears that ngrok is not required.

I will add that the above exception is on my personal machine wherein ngrok was not installed and has other tools that are not installed (i.e. just as the tutorial suggests: VS Code, the Teams extension, etc.)

The book:

https://link.springer.com/book/10.1007/978-1-4842-6364-8

https://github.com/Apress/pro-microsoft-teams-dev

and on pg. 14 it suggests installing ngrok. If one installs ngrok, it installs globally, if you will.

Hope the above helps.

Perhaps the cert error should be a new & separate incident? Nonetheless, there are issues with these simple samples...

Thanks

@elthombre
Copy link
Author

@ChetanSharma-msft , I got this running on my machine that does not have ngrok. I manually imported the cert via the Control Panel management tool. I placed the cert in the 'Trusted Root Certification Authorities'.

Then the solution ran.

@sayali-MSFT
Copy link

@elthombre -We also tried the sample from our end and it's working properly.
Have you check the Prerequisites?
If required we will update the document accordingly?

cert.mp4

@elthombre
Copy link
Author

@sayali-MSFT The problem was that clicking the 'Install' button failed with the message that I provided. It should be added to the documentation how to use the cert manager to install the cert manually should the automatic method fail.

@elthombre
Copy link
Author

@sayali-MSFT - I have opened the following ticket specifically related to the cert installation:

#7412

@sayali-MSFT
Copy link

@elthombre - Thanks for your feedback. We will look into this issue as well and resolve it quickly. Thank you for your patience.

We are closing this issue for now, Please feel free to reopen it, if required.

Teams App Development automation moved this from Active to Closed Nov 8, 2022
@ghost
Copy link

ghost commented Nov 8, 2022

Tell us about your experience!

Hi elthombre! This issue is closed in our system. We would like your feedback on your experience with our support team and Platform.

Best regards,
Teams Platform

@ghost ghost locked as resolved and limited conversation to collaborators Dec 8, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
teams-developer-support Question related to extensibility (Bot, ME, Tab) would be marked under this label
Projects
Development

No branches or pull requests

3 participants