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

getting random http response code 500 #2218

Open
ainglese opened this issue Jul 27, 2018 · 27 comments
Open

getting random http response code 500 #2218

ainglese opened this issue Jul 27, 2018 · 27 comments
Labels
stage: needs information Not enough info to reproduce the issue

Comments

@ainglese
Copy link

Current behavior & Steps to reproduce:

This works as expected:

cy.visit('http://localhost:8080/ui/st.bquadro/agent');
cy.get('.login-content input[type=text]')
    .type('admin')
    .should('have.value', 'admin');

cy.get('.login-content input[type=password]')
    .type('xxxx')
    .should('have.value', 'xxxx');

cy.get('.login-content .submit input[name=commit]').click();

cy.visit('http://localhost:8080/ui/st.bquadro/agent#dashboard', {
    auth: { username: 'admin', password: 'xxxx' }
});

but this gives some network errors (status code 500):

cy.visit('http://localhost:8080/ui/st.bquadro/agent#dashboard', {
    auth: { username: 'admin', password: 'xxxx' }
});

i've run our application with a debugger, and i'm almost sure our web server is not returning an error but a 200 OK.

the requests that fails are not always the same:
image
but one of four files, just one of them succeeds. i've run cypress in debug mode and

Desired behavior:

test should not throw random 500.

Versions

windows 10 pro + chrome + cypress 3.0.2

@ainglese
Copy link
Author

addendum, please note that:

  • The requests, consistently runs without errors when simulating requests with postman or other tools. so i think it's not becouse of application specific errors.
  • Those static files, do non require authentication. so i don't think that exeptions are related to our application using basic instead of a cookie for authentication.
  • Since cypress gives no error when using forms authentication, i think i can exclude something in the response content (things like gzip compression, UTF-8 encoding) etc.
  • those assets are all UTF-8 encoded with BOM

please note also that i'm almost new to cypress, so there could be something obvious going on here, but i've tryed asking the community on the gitter channel without success.

@jennifer-shehane jennifer-shehane added the stage: needs investigating Someone from Cypress needs to look at this label Jul 27, 2018
@Francis-Moreau-adsk
Copy link

We get the same type of behavior with the app we are trying to auto-test.
For us, the error 500 is more consistent but still doesn't make sens.
Login in and out twice in the same _specs.js will throw some error 500 on the second attempt to log in.

@mabedan
Copy link

mabedan commented Dec 12, 2018

Same issue here. We know for a fact that the requests are not hitting our server, and we've not been able to find any pattern to it. it's really random...

@jennifer-shehane
Copy link
Member

We'll need a reproducible example in order to begin looking into this issue. Can anyone provide a way to reproduce this?

@ADavisDon
Copy link

I've encountered this error every time with our own website project. It'll occurs shortly after finishing a test. However, the longer that I use Cypress, the shorter the time length before hitting the 500 code, due to building lag in the Cypress browser. If I close out and relaunch Cypress, it'll go back to normal. It is appears to happen whenever ~60 seconds has passed in the test; The website is still responsive (can navigate to a different page within the same test) and does not display a 500 code when going through normal navigation in the Cypress browser.

@jennifer-shehane jennifer-shehane added stage: needs information Not enough info to reproduce the issue and removed stage: needs investigating Someone from Cypress needs to look at this labels Jan 14, 2019
@jennifer-shehane
Copy link
Member

Unfortunately we'll have to close this issue if no reproducible example is provided. Can anyone provide a way to reproduce this?

@mabedan
Copy link

mabedan commented Jan 14, 2019

I strongly advice against brushing this issue under the rug. This is obviously not an isolated case, as there're many who report the same issue, in this and other threads. I think this is also tied to #1039 , #2938 and #2639 . It has to have something to do with the way cypress channels the requests through.

If not solved, this will occur for future users and Cypress can not become a reliable solution for testing large platforms.

@jennifer-shehane
Copy link
Member

@mabedan I agree! We definitely want to fix these issues, especially one as strange sounding as this, but we need a reproducible example to begin tracking it down.

We are also always willing to reopen issues after closing if someone provides an example. We just have to clean up the issues eventually for our sanity. 🙃

@jennifer-shehane jennifer-shehane removed the stage: needs information Not enough info to reproduce the issue label Feb 19, 2019
@Moejoe90
Copy link

Just an advice if you clone your repo again for some reason everything works

Deleting the cypress cache didn't work
Deleting the node_modules didn't work

Cloning a new project worked

@charanyarepo
Copy link

Hi team, was there a resolution for this issue, we are facing the same quiet consistently. Especially in the past week.

@jennifer-shehane
Copy link
Member

If you're experiencing a bug similar to this in Cypress, please comment in the issue with a fully reproducible example that we can run.

@dclowd9901
Copy link

dclowd9901 commented Jun 14, 2021

@jennifer-shehane if we were able to fully and reliably replicate the issue, we wouldn't need the Cypress team to help fix it.

Could you provide maybe some possible places to look or log? We're seeing the issue, and it seems to be originating from Cypress. The 500 error message page is a cypress-owned and presented page, not one of ours.

@jennifer-shehane
Copy link
Member

The 500 error message page is a cypress-owned and presented page, not one of ours.

Could you explain what you mean by this? Are you visiting one of Cypress's domains? We don't present any 500 error messages within the application under test itself.

We do proxy requests and there is logic behind that - so it is definitely possible there is a bug in Cypress. If we can't reproduce it, we have no idea where it could be originating from or how to fix it.

@dclowd9901
Copy link

#2218 (comment)

It appears to be expressed by the cypress application itself. Here's a screen shot:

cypress-screenshot

That isn't one of our 500 pages. Where in the code does the proxy logic live?

@jennifer-shehane
Copy link
Member

@dclowd9901 Yah the state of this error is a bit unusual. Usually an error would be shown in the visit command on the left and the url is not blank within the application under test. It looks like it's still in a loading state.

Is this a screenshot from a video? It may be cutting off the final moments where it shows the error. If you can recreate this locally, is there anything shown in the DevTools console? Or an error printed to stdout? Or do you have any code overwriting Cypress listeners/commands?

@TasnimZuhod
Copy link

This happens with me frequently, I usually need to restart Cypress several times in order to proceed with execution

@albertmir
Copy link

This randomly happens to us as well:
cypress-random-500-error

We've never experienced those 500 errors while using the site we're testing or running the tests locally. It only happens on the CI server.

@MaaikeFox
Copy link

We have the same issue
I have a video recording of it
Does this help @jennifer-shehane ?

500-error-example.mp4

@burkedavid
Copy link

Exactly the same issue is happening in my tests near every time now. Is there a workaround The odd occasion it will pass.

image

@finnef
Copy link

finnef commented May 24, 2022

I have the same problem running my tests. It mostly occurs after a few longer tests have been run (in Gitlab CI). At some point cy.visit() will return a 500 error.

@alectrocute
Copy link

@jennifer-shehane It's very difficult to provide a sample of this bug since it only occurs on CI. I can attest that this bug is still present and seemingly random.

@ckifer
Copy link

ckifer commented Oct 11, 2023

Can also confirm this still happens and only in CI

Haven't seen anyone else post the stack so:

      at <unknown> ({url}/__cypress/runner/cypress_runner.js:138231:84)
      at visitFailedByErr ({url}/__cypress/runner/cypress_runner.js:137639:12)
      at <unknown> ({url}/__cypress/runner/cypress_runner.js:138214:13)
      at tryCatcher ({url}v/__cypress/runner/cypress_runner.js:8914:23)
      at Promise._settlePromiseFromHandler ({url}/__cypress/runner/cypress_runner.js:6849:31)
      at Promise._settlePromise ({url}/__cypress/runner/cypress_runner.js:6906:18)
      at Promise._settlePromise0 ({url}/__cypress/runner/cypress_runner.js:6951:10)
      at Promise._settlePromises ({url}/__cypress/runner/cypress_runner.js:7027:18)
      at _drainQueueStep ({url}/__cypress/runner/cypress_runner.js:3621:12)
      at _drainQueue ({url}/__cypress/runner/cypress_runner.js:3614:9)
      at ../../node_modules/bluebird/js/release/async.js.Async._drainQueues ({url}/__cypress/runner/cypress_runner.js:3630:5)
      at Async.drainQueues ({url}/__cypress/runner/cypress_runner.js:3500:14)

@gauthierm
Copy link

This is happening in CI for us as well. I see this issue is closed but it does not appear to be fixed.

Screen Shot 2023-11-29 at 10 53 42

@jennifer-shehane
Copy link
Member

@gauthierm It likely isn't fixed. We need a reproducible example in order to investigate.

@jennifer-shehane jennifer-shehane added the stage: needs information Not enough info to reproduce the issue label Nov 29, 2023
@markhermano
Copy link

I got the same issue and I'm running the command below in Github Actions.

docker run -i -v $PWD:/e2e -w /e2e --network=host --ipc=host cypress/included:13.6.2

@agusbrand
Copy link

agusbrand commented Mar 29, 2024

I started to experience this issue after upgrading Rails from v7.0 to v7.1. It only happens on Github Actions, specs pass locally

@shwetakanchanv788344
Copy link

shwetakanchanv788344 commented Aug 18, 2024

Have we got a resolution for this issue yet?
Even I have been experiencing this on my CI platform and it does not occur locally.
I am quite sure this has something to do with proxy.

Also I do see this error in the logs:
Failed to call method: org.freedesktop.portal.Settings.Read: object_path= /org/freedesktop/portal/desktop: unknown error type

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stage: needs information Not enough info to reproduce the issue
Projects
None yet
Development

No branches or pull requests