cypress icon indicating copy to clipboard operation
cypress copied to clipboard

12.17.0 new appdata folder can't be configured

Open CSchulz opened this issue 2 years ago • 10 comments
trafficstars

Description

When I start [email protected], I expected existing folders are reused but another unknown folder is used instead.

URL of Issue(s)

None

Steps to replicate

  1. Start [email protected] with an user having a different user path and deny write access on the default profile folder .config.

Browser

No response

Device

  • [X] PC
  • [ ] Mac
  • [ ] iPhone
  • [ ] iPad
  • [ ] Android Phone
  • [ ] Android Tablet

Additional Information

The home folder of our jenkins user is /var/lib/jenkins, but for any reason [email protected] tries to use /home/jenkins/.

The configuration page doesn't state any property to configure this folder.

07.07.2023 10:30:42  2023-07-07T08:30:41.077Z cypress:server:cypress from argv [ '/var/lib/jenkins/.cache/cypress/12.17.0/Cypress/Cypress', '--no-sandbox', '--smoke-test', '--ping=329' ] got options { _: [ '/var/lib/jenkins/.cache/cypress/12.17.0/Cypress/Cypress' ], sandbox: false, smokeTest: true, ping: 329, invokedFromCli: false, cwd: '/var/lib/jenkins/Cypress-Runner@4', config: {}, pong: 329 }
07.07.2023 10:30:42  2023-07-07T08:30:41.212Z cypress:server:appdata path: /home/jenkins/.config/Cypress/cy/production
07.07.2023 10:30:42  [4003337:0707/103041.239804:WARNING:sandbox_linux.cc(380)] InitializeSandbox() called with multiple threads in process gpu-process.
07.07.2023 10:30:42  
07.07.2023 10:30:42  DevTools listening on ws://127.0.0.1:35447/devtools/browser/c4bd6bc4-931c-432d-97b0-23ea93bdf40e
07.07.2023 10:30:42  [4003182:0707/103041.240888:ERROR:devtools_http_handler.cc(293)] Error writing DevTools active port to file
07.07.2023 10:30:42  [4003337:0707/103041.243644:ERROR:gpu_memory_buffer_support_x11.cc(44)] dri3 extension not supported.
07.07.2023 10:30:42  [4003182:0707/103041.246439:WARNING:bluez_dbus_manager.cc(247)] Floss manager not present, cannot set Floss enable/disable.
07.07.2023 10:30:42  2023-07-07T08:30:41.349Z cypress:server:appdata path: /home/jenkins/.config/Cypress/cy/production
07.07.2023 10:30:42  [OperationalError: ENOTDIR: not a directory, mkdir '/home/jenkins/.config/Cypress/cy/production'] {
07.07.2023 10:30:42    cause: [Error: ENOTDIR: not a directory, mkdir '/home/jenkins/.config/Cypress/cy/production'] {

CSchulz avatar Jul 07 '23 11:07 CSchulz

@CSchulz

You can change the cache location. See https://docs.cypress.io/guides/references/advanced-installation#Binary-cache.

Which operating system are you using?

If this is a Linux operating system, the default is ~/.cache/Cypress and it can be changed using CYPRESS_CACHE_FOLDER.

This issue list is actually for documentation issues only.

You might like to connect also to the Cypress technical community on Discord

Discord chat

MikeMcC399 avatar Jul 07 '23 12:07 MikeMcC399

Moving to the Cypress repo as this doesn't appear to be an issue with the docs

elylucas avatar Jul 07 '23 20:07 elylucas

This doesn't work for the appdata folder. We are already using export CYPRESS_CACHE_FOLDER="/var/lib/jenkins/.cache/cypress"

CSchulz avatar Jul 10 '23 14:07 CSchulz

@CSchulz

Can you please let us know which operating system you are using?

MikeMcC399 avatar Jul 10 '23 14:07 MikeMcC399

Platform: linux-x64 (Red Hat Linux - 8.8)
Cypress Version: 12.17.0

CSchulz avatar Jul 10 '23 14:07 CSchulz

@CSchulz

Thanks for your OS (Red Hat Linux - 8.8)! I confirmed that I can reproduce on Ubuntu 22.04.

The App Data is stored in ~/.config/Cypress/cy/production

which is not influenced by the environment variable CYPRESS_CACHE_FOLDER="/var/lib/jenkins/.cache/cypress".

Only the cache data is stored in /var/lib/jenkins/.cache/cypress

Sorry for my previous misleading comments!

  • https://github.com/cypress-io/cypress/issues/20774 relates to a problem viewing that data

MikeMcC399 avatar Jul 10 '23 15:07 MikeMcC399

@CSchulz

The home folder of our jenkins user is /var/lib/jenkins, but for any reason [email protected] tries to use /home/jenkins/.

Cypress will use ~ to find the home folder.

What does

echo ~

show? Is it /var/lib/jenkins or /home/jenkins?

MikeMcC399 avatar Jul 10 '23 15:07 MikeMcC399

On Ubuntu with export HOME='/var/lib/jenkins'

npx cypress info shows

Application Data: /var/lib/jenkins/.config/cypress/cy/development
Browser Profiles: /var/lib/jenkins/.config/cypress/cy/development/browsers
Binary Caches: /var/lib/jenkins/.cache/Cypress

Cypress Version: 12.17.0 (stable)
System Platform: linux (Ubuntu - 22.04)

MikeMcC399 avatar Jul 10 '23 16:07 MikeMcC399

Yes I can confim the paths are based on the HOME variable.

I would like to suggest that there should be also an environment variable to override this behavior because it could be possible that the app data folder gets too big or similar issues.

CSchulz avatar Jul 11 '23 19:07 CSchulz

This sounds like a reasonable feature request. I'll label it as such. I am not sure if this is something that is configurable on every OS, though.

Would you be interested in making a PR by any chance?

lmiller1990 avatar Jul 12 '23 00:07 lmiller1990