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

E2E configuration hangs forever at 'initializing config' after migration #21920

Closed
sync-by-unito bot opened this issue May 30, 2022 · 20 comments
Closed

E2E configuration hangs forever at 'initializing config' after migration #21920

sync-by-unito bot opened this issue May 30, 2022 · 20 comments
Assignees

Comments

@sync-by-unito
Copy link

sync-by-unito bot commented May 30, 2022

Current Behavior

running the migration on todomvc project, when running the first time e2e it hangs there forever until I refresh it

Loom

Cypress.-.19.May.2022.1.mp4

These are the only logs on the terminal

Screen Shot 2022-05-19 at 2 13 44 PM

Maybe related in DEBUG logs

image (15)

this seems to be only happening in the binary

https://cypressio.slack.com/archives/C02MW5QBD4K/p1652987265272569

Reproducible Steps

  1. Migrate this repo: https://github.com/cypress-io/cypress-example-todomvc

┆Issue is synchronized with this Jira Bug by Unito
┆Attachments: image (15).png | image-20220519-194702.png | Screen Shot 2022-05-19 at 2.13.44 PM.png | Screen Shot 2022-05-25 at 1.09.57 PM.png
┆author: Alejandro Estrada
┆epic: Edge Cases
┆friendlyId: UNIFY-1794
┆priority: Highest
┆sprint: Backlog
┆taskType: Bug

@sync-by-unito
Copy link
Author

sync-by-unito bot commented May 30, 2022

➤ Alejandro Estrada commented:

Maybe related based on the logs

image-20220519-194702

@sync-by-unito
Copy link
Author

sync-by-unito bot commented May 30, 2022

➤ Mark Noonan commented:

Moving to blocked as I’ve been unable to reproduce this at all, even in the build from May 19 that was used for the last walkthrough.

@sync-by-unito
Copy link
Author

sync-by-unito bot commented May 30, 2022

➤ Mark Noonan commented:

From the screenshots, it looks like is line is where the error in the video happened:

const result = await execa(cmd, { shell: process.env.SHELL || '/bin/bash', cwd: this.#gitBaseDir })

Decided to log this and document the typical output of that stdout for git info. To my surprise, even though the actual failure is not present (nothing hangs) I still saw the error logged:

Screen Shot 2022-05-25 at 1 09 57 PM

Confirmed I see this error logged even in the newest binary.

@sync-by-unito
Copy link
Author

sync-by-unito bot commented May 30, 2022

➤ Mark Noonan commented:

The error is always logged because the result has no status code,

if (result.exitCode !== 0) {
- it is undefined, not 0.

@sync-by-unito
Copy link
Author

sync-by-unito bot commented May 30, 2022

➤ Mark Noonan commented:

Hi Muaz Othman just curious what you make of this, the return value for const result = await execa(cmd, { shell: process.env.SHELL || '/bin/bash', cwd: this.#gitBaseDir }) does not appear to have an exitCode , result.exitCode logs as undefined. It does have a code property of 0. This does not seem to be the cause of the issue but wanted to get your thoughts, does the absence of any exit code mean something? We get a full payload of git data.

@sync-by-unito
Copy link
Author

sync-by-unito bot commented May 30, 2022

➤ Muaz Othman commented:

This is weird. I can reproduce getting undefined for result.exitCode which looks weird, and the typing bundled with execa doesn't declare a code field. I found that execa is now at version 6.1.0 and we’re using a 4 years old v 1.0.0. I think we’re using execa to address a few issues with nativechild_process on Windows.
I guess we can consider:

  • Upgrading to a more recent version of execa can potentially address this and see if this would potentially have any other consequences.
  • Override the TS compiler to force the use of code as in the snippet below. This solution works fine but it feels like a hack
    // while the typings include a field named `exitCode`, the actual field is `code`
    // overriding typing to correct
    const r = result as any as (Omit<typeof result, 'exitCode'> & {code: number})

    debugVerbose('command execution exit code is %d', r.code)
    if (r.code !== 0) {
      debug(`command execution error: %o`, result)
    }

Which way do you think we should do it, Mark Noonan and Tim Griesser ?

@marktnoonan marktnoonan removed their assignment Jun 21, 2022
@marktnoonan
Copy link
Contributor

@rockhold @baus I think we should go on and close this ticket. The error we are seeing that Muaz discusses here is not actually affecting anything (though it would be nice to clean it up) and the main issue reported here could not be reproduced.

@steveolotu
Copy link

Not sure if it helps, but just fyi: I had a similar issue and was able to solve it by switching my console from Cmdr to GitBash.

@yktoo
Copy link

yktoo commented Feb 28, 2023

I'm having the same situation with 12.7 after a fresh install (Cypress was never used in this project).
Peek 2023-02-28 15-05

It just hangs forever, no message in DevTools or console.

I'm on Ubuntu 22.10, Node 18.14.2. I use Cypress a lot in other projects without issue.

@marktnoonan
Copy link
Contributor

Thanks, @yktoo it's clearly the same presentation (config just spinning), but seems to be different situation. The issue above is one related to a problem after migrating an existing project from pre-10.0 Cypress, which wouldn't be a factor in a new project.

I've opened a fresh issue (#25974) to track.

@zinaemilian
Copy link

Hi, I am installing the first-time cypress on my machine and config spinning over 5 minutes and not lunch Cypress 🤯

@zinaemilian
Copy link

image will it be launched at the end?

@marktnoonan
Copy link
Contributor

@zinaemilian what command are you using to open Cypress? Can you share the project?

@AndreiMocirean
Copy link

Hello,
@marktnoonan I have the same problem. I am running on a MacOS and I have installed Cypress for the first time as I want to learn how to use it. I do open it by ./cypress open command.
I tried closing it and now the E2E seems to be configured, but when I do click on it, the following error is generated.
image

@marktnoonan
Copy link
Contributor

Hmm @AndreiMocirean from the screenshot it appears you have opened the./bin folder as a project, which could be causing problems.

Could I suggest the following to explore Cypress:

  1. Make a directory called test-project or something
  2. Inside that directory, run npm install Cypress
  3. Then run npx cypress open

If you follow the setup steps again, Cypress should do its setup and scaffolding in that test-project folder.

@zinaemilian
Copy link

I solve this problem with run this command “cypress open --e2e” after installing cypress, I didn't launch with “npx cypress open --config-file cypress/cypress.json” thx a lot

@zinaemilian
Copy link

In my case “npm cypress open” did not work. I used the command “npx cypress open --config-file cypress/cypress.json” instead of it. But I faced the spinning issue then I delete and create again my demo-project than I run ““cypress open --e2e” after finishing the installation and it is working as we expected. Many thanks for your quick response @marktnoonan

@mike-plummer mike-plummer closed this as not planned Won't fix, can't repro, duplicate, stale Mar 9, 2023
@dplong
Copy link

dplong commented Feb 29, 2024

I'm also getting the spinning "cy" on the "Initializing config..." screen after running ./node_modules/.bin/cypress open then selecting E2E Testing. Cypress v13.6.6 and Rocky 9.3. Haven't tried any of the fixes/workarounds yet.

@mikegwhit
Copy link

mikegwhit commented Sep 6, 2024

also getting this nothing local changed at all seemed to just happen between my last run EoD yesterday and this a.m.
tried:

  • rm -rf node_modules && npm i
  • npx cypress cache clear && cypress install

in my / our case it was a preflight test that was failing and not logging that it was failing (our API server inaccessible)

@marktnoonan
Copy link
Contributor

marktnoonan commented Sep 6, 2024

@mikegwhit Thanks for reporting - I'd suggest opening a brand new issue and describe in detail what you're experiencing. This issue was related to a specific problem that used to occur after automated migration of projects from earlier versions of Cypress into Cypress 10 and was since solved. Even if the presentation is the same (stuck on "initializing config...") - if you weren't migrating an old project, then you have a different issue that could be investigated on its own.

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

No branches or pull requests

8 participants