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

Error: Source and destination must not be the same. #4637

Closed
kemsky opened this issue Jul 2, 2019 · 16 comments
Closed

Error: Source and destination must not be the same. #4637

kemsky opened this issue Jul 2, 2019 · 16 comments
Labels
pkg/server This is due to an issue in the packages/server directory topic: reporters 📄 type: regression A bug that didn't appear until a specific Cy version release v3.3.2 🐛 Issue present since 3.3.2

Comments

@kemsky
Copy link

kemsky commented Jul 2, 2019

Current behavior:

Random fails on CI server

[00:19:14]	[Step 21/21]   (Video)
[00:19:14]	[Step 21/21] 
[00:19:14]	[Step 21/21]   - Started processing:   Compressing to 32 CRF
[00:19:16]	[Step 21/21]   - Finished processing:  C:\TeamCity\buildAgent\work\89524d52ec0f2109\XXXXXXX\cypress\videos\master.affiliate.plan.name.spec.js.mp4 (1 second)
[00:19:16]	[Step 21/21] 
[00:19:16]	[Step 21/21] { Error: Source and destination must not be the same.
[00:19:16]	[Step 21/21]     at getStats (C:\Users\Administrator\AppData\Local\Cypress\Cache\3.3.2\Cypress\resources\app\packages\server\node_modules\fs-extra\lib\util\stat.js:82:17)
[00:19:16]	[Step 21/21]     at fs.stat (C:\Users\Administrator\AppData\Local\Cypress\Cache\3.3.2\Cypress\resources\app\packages\server\node_modules\fs-extra\lib\util\stat.js:51:16)
[00:19:16]	[Step 21/21]     at C:\Users\Administrator\AppData\Local\Cypress\Cache\3.3.2\Cypress\resources\app\packages\server\node_modules\graceful-fs\polyfills.js:285:20
[00:19:16]	[Step 21/21]     at FSReqWrap.oncomplete (fs.js:153:5)
[00:19:16]	[Step 21/21] 
[00:19:16]	[Step 21/21]   cause: Error: Source and destination must not be the same.
[00:19:16]	[Step 21/21]     at getStats (C:\Users\Administrator\AppData\Local\Cypress\Cache\3.3.2\Cypress\resources\app\packages\server\node_modules\fs-extra\lib\util\stat.js:82:17)
[00:19:16]	[Step 21/21]     at fs.stat (C:\Users\Administrator\AppData\Local\Cypress\Cache\3.3.2\Cypress\resources\app\packages\server\node_modules\fs-extra\lib\util\stat.js:51:16)
[00:19:16]	[Step 21/21]     at C:\Users\Administrator\AppData\Local\Cypress\Cache\3.3.2\Cypress\resources\app\packages\server\node_modules\graceful-fs\polyfills.js:285:20
[00:19:16]	[Step 21/21]     at FSReqWrap.oncomplete (fs.js:153:5)
[00:19:16]	[Step 21/21] ,
[00:19:16]	[Step 21/21]   isOperational: true }
[00:19:16]	[Step 21/21] Error: Source and destination must not be the same.
[00:19:16]	[Step 21/21]     at getStats (C:\Users\Administrator\AppData\Local\Cypress\Cache\3.3.2\Cypress\resources\app\packages\server\node_modules\fs-extra\lib\util\stat.js:82:17)
[00:19:16]	[Step 21/21]     at fs.stat (C:\Users\Administrator\AppData\Local\Cypress\Cache\3.3.2\Cypress\resources\app\packages\server\node_modules\fs-extra\lib\util\stat.js:51:16)
[00:19:16]	[Step 21/21]     at C:\Users\Administrator\AppData\Local\Cypress\Cache\3.3.2\Cypress\resources\app\packages\server\node_modules\graceful-fs\polyfills.js:285:20
[00:19:16]	[Step 21/21]     at FSReqWrap.oncomplete (fs.js:153:5)

Desired behavior:

NO errors.

Steps to reproduce: (app code and test code)

cypress run --reporter teamcity

Versions

"cypress": "3.3.2"

nodejs 12.*

@jennifer-shehane
Copy link
Member

@kemsky Thank you for opening this issue. This is definitely due to our updating fs-extra in version 3.3.2.

I wasn't able to reproduce this by installing mocha-teamcity-reporter npm install mocha-teamcity-reporter --save-dev then running cypress run --reporter teamcity.

I do see that the teamcity reporter was properly found and is logging, but not displaying the error you are seeing.

────────────────────────────────────────────────────────────────────────────────────────────────────

  Running: examples/actions.spec.js...                                                     (1 of 1)
##teamcity[testSuiteStarted name='My First Test']
##teamcity[testStarted name='Visits slatejs' captureStandardOutput='true']
##teamcity[testFinished name='Visits slatejs' duration='5036']
##teamcity[testSuiteFinished name='My First Test' duration='NaN']
##teamcity[testSuiteFinished name='mocha.suite' duration='8797']

  (Results)

Can you provide ALL of the configuration around your use of the teamcity reporter. I suspect this is bug is only happening with the configuration you specifically set up. Also anything you specifically set up after the run has completed (if using the Module API).

Why this is happening

Effectively in the newer versions of fs-extra that we upgraded to using in the Cypress code, fs-extra is more diligent in checking that we are not copying a file from a source to the exact same destination file (even if symlinked).

Current Workaround

Downgrade to Cypress version 3.3.1 - this will not error in that version.

@jennifer-shehane jennifer-shehane added existing workaround topic: reporters 📄 stage: needs information Not enough info to reproduce the issue type: bug pkg/server This is due to an issue in the packages/server directory type: regression A bug that didn't appear until a specific Cy version release and removed type: bug labels Jul 3, 2019
@kemsky
Copy link
Author

kemsky commented Jul 3, 2019

@jennifer-shehane there is nothing special in our setup:

{
  "projectId": "XXXXXX",
  "baseUrl": "http://localhost:5001",
  "testFiles": "**/*.spec.js",
  "integrationFolder": "cypress/tests/integration",
  "chromeWebSecurity": false,
  "modifyObstructiveCode": false,
  "viewportWidth": 1200
}

We are using builtin teamcity reporter (docs link https://docs.cypress.io/guides/tooling/reporters.html#Reporter-Options)
I'm not sure if this error is related to teamcity reporter.

Exception message does not contain actual resource path, but nothing points to mistake on our end.

@jennifer-shehane
Copy link
Member

Oh, interesting. I actually didn't realize that we package teamcity reporter into Cypress.

We use our own fork of the project here https://github.com/cypress-io/mocha-teamcity-reporter so let me dig into that.

@jvanoostveen
Copy link

I'm seeing these errors as well (not using teamcity reporter). So it might be related to something else. Looks like it is doing some processing with the video?

@jvanoostveen
Copy link

Using Cypress 3.4.0 by the way.

@jvanoostveen
Copy link

Any update on this? It is randomly failing our builds and making Cypress even more flaky than the Selenium we are trying to replace...

@baptistepattyn
Copy link

I have had the same issue as described by @jvanoostveen
I do believe it has something to do with the video compression as he mentions...
image

I got the error right after the video compression started

@hadighattas
Copy link

hadighattas commented Sep 23, 2019

Any updates on this issue as #1906 / #4164 were fixed in 3.3.2 and 3.3.2 has this issue?

@jvanoostveen
Copy link

The label says: existing workaround, which is not really true, as the workaround is not updating. We'll been stuck on 3.3.1 until this bug is fixed...

@joshuakeel
Copy link

This is happening for us on 3.4.0 as well.

@AliceShi789654
Copy link

This is happening on 4.3.1 as well, but it could not reproduce stably.

@kemsky
Copy link
Author

kemsky commented Nov 7, 2019

@jennifer-shehane, can't you simply add some debug information to logs to trace this problem? We can not upgrade since July.

@joshuakeel
Copy link

@jennifer-shehane Will the resolution of this issue involve updating the paths so the source and destination are not the same? I'm not sure exactly what paths those are, but I assume the paths of video files that are being written.

I'm interested in potentially working on this, since this is a blocking issue for my team that prevents us from being able to use the latest Cypress.

@jennifer-shehane jennifer-shehane added the v3.3.2 🐛 Issue present since 3.3.2 label Dec 10, 2019
@adil060606
Copy link

Any news regarding ? Its still happens to us occasionally and fails our build...

@kemsky
Copy link
Author

kemsky commented Feb 27, 2020

@adil060606, version 4.0.1 works for me, but I don't know how stable it will be for you.

@jennifer-shehane
Copy link
Member

I'm not sure this issue is still occurring for anyone in our latest version. We did upgrade fs-extra in 4.0.0, which may have resolved the issue. #5632 Maybe this issue? jprichardson/node-fs-extra#657

Closing as resolved.

If you're experiencing a bug similar to this in Cypress, please open a new issue with a fully reproducible example that we can run. There may be a specific edge case with the issue that we need more detail to fix.

@jennifer-shehane jennifer-shehane removed the stage: needs information Not enough info to reproduce the issue label Jul 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg/server This is due to an issue in the packages/server directory topic: reporters 📄 type: regression A bug that didn't appear until a specific Cy version release v3.3.2 🐛 Issue present since 3.3.2
Projects
None yet
Development

No branches or pull requests

9 participants