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

SFDX creating huge log files #1942

Closed
jgrimaldos opened this issue Feb 16, 2023 · 12 comments · Fixed by forcedotcom/sfdx-core#818
Closed

SFDX creating huge log files #1942

jgrimaldos opened this issue Feb 16, 2023 · 12 comments · Fixed by forcedotcom/sfdx-core#818
Labels
bug Issue or pull request that identifies or fixes a bug investigating We're actively investigating this issue

Comments

@jgrimaldos
Copy link

Summary

SFDX seem to be logging excessively

Steps To Reproduce:

  1. Start working on VS Code.
  2. Deploy anything into an org

Expected result

Log files should be handled properly.

Actual result

Overnight, the sf.log file at the $HOME/.sf/ folder grew up tp 190 GB on my local machine

System Information

  • Zsh on VS Code (Mac)

  • SFDX Version:

"cliVersion": "sfdx-cli/7.187.1",
  "architecture": "darwin-x64",
  "nodeVersion": "node-v18.13.0",
  "pluginVersions": [
    "@oclif/plugin-autocomplete 1.4.4 (core)",
    "@oclif/plugin-commands 2.2.5 (core)",
    "@oclif/plugin-help 5.2.2 (core)",
    "@oclif/plugin-not-found 2.3.17 (core)",
    "@oclif/plugin-plugins 2.3.0 (core)",
    "@oclif/plugin-search 0.0.11 (core)",
    "@oclif/plugin-update 3.1.1 (core)",
    "@oclif/plugin-version 1.2.1 (core)",
    "@oclif/plugin-warn-if-update-available 2.0.24 (core)",
    "@oclif/plugin-which 2.2.12 (core)",
    "alias 2.2.0 (core)",
    "apex 1.5.0 (core)",
    "auth 2.4.0 (core)",
    "community 2.2.0 (core)",
    "config 1.5.0 (core)",
    "custom-metadata 2.1.0 (core)",
    "data 2.2.0 (core)",
    "generator 2.0.17 (core)",
    "info 2.4.0 (core)",
    "limits 2.3.0 (core)",
    "org 2.3.0 (core)",
    "packaging 1.14.1 (core)",
    "schema 2.3.0 (core)",
    "signups 1.4.0 (core)",
    "source 2.4.1 (core)",
    "telemetry 2.1.0 (core)",
    "templates 55.3.0 (core)",
    "trust 2.4.0 (core)",
    "user 2.3.0 (core)",
    "@salesforce/sfdx-plugin-lwc-test 1.0.1 (core)",
    "@salesforce/sfdx-scanner 3.9.0 (user)",
    "dependencies-cli 2.0.1 (user)",
    "salesforce-alm 54.8.5 (core)",
    "sfdx-git-delta 5.11.4 (user)"
  ],
  "osVersion": "Darwin 22.2.0",
  "shell": "zsh",
  "rootPath": "/Users/username/.local/share/sfdx/client/7.187.1-09910f2"
}
@jgrimaldos jgrimaldos added the investigating We're actively investigating this issue label Feb 16, 2023
@github-actions
Copy link

Thank you for filing this issue. We appreciate your feedback and will review the issue as soon as possible. Remember, however, that GitHub isn't a mechanism for receiving support under any agreement or SLA. If you require immediate assistance, contact Salesforce Customer Support.

@jgrimaldos
Copy link
Author

This is the result of tail sf.log
image

@mshanemc
Copy link
Contributor

@jgrimaldos Are you using the CLI command from the VSCode terminal, or one of the VSCode command palette or right click actions? If not the CLI, do you get the sam behavior without vscode involved?

@jgrimaldos
Copy link
Author

Neither,... I deleted the files, killed VS Code and stopped working on this laptop yesterday, right after posting the screenshot.

Now (almost 24 hours later), I see this node job still running AND keeping 140 GB in logs.

image

image

@mshanemc
Copy link
Contributor

If you or someone you know is experiencing logger problems, SF_DISABLE_LOG_FILE might be right for you.

@dagreatbrendino
Copy link

Having the same issue. Only been using SFDX wth VSC for < 1 week and my log file already ballooned to 33GB. Was wondering why I was randomly running out of storage space...

@mshanemc
Copy link
Contributor

Does anyone see this happen without vscode being involved?

@gbockus-sf
Copy link

vscode is def in involved in my case. After hearing about this issue yesterday I started paying attention and am seeing the issue currently.

My log file when from around 20Gb around 16 hours ago to 91Gb now ~/github/PDT/salesforcedx-vscode (gbockus/revert-node-bump-2) » du -h ~/.sf/| sort -h 130 ↵ gbockus@gbockus-ltm 91G /Users/gbockus/.sf/

Same odd error message in the log file

{"name":"sf","hostname":"*****.salesforce.com","pid":97200,"level":60,"errno":-32,"code":"EPIPE","syscall":"write","msg":"","time":"2023-02-21T15:29:32.900Z","v":0}

Tracking the pid of the process down I see the following:

~/github/PDT/salesforcedx-vscode (gbockus/revert-node-bump-2) » ps -ef | grep 97200                                                                                                                                                                                gbockus@gbockus-ltm
  502 17156  1204   0  9:30AM ttys000    0:00.01 grep --color=auto --exclude-dir=.bzr --exclude-dir=CVS --exclude-dir=.git --exclude-dir=.hg --exclude-dir=.svn --exclude-dir=.idea --exclude-dir=.tox 97200
  502 97200 97159   0  3:50PM ttys003  953:10.19 /Users/gbockus/.local/share/sfdx/client/7.185.0-9390167/bin/node /Users/gbockus/.local/share/sfdx/client/7.185.0-9390167/bin/run force --help
ansible|----

pstree

-+- 97083 gbockus bash /usr/local/bin/sfdx force --help
 \-+- 97137 gbockus bash /Users/gbockus/.local/share/sfdx/client/bin/sfdx force --help
   \-+- 97159 gbockus bash /Users/gbockus/.local/share/sfdx/client/bin/../7.185.0-9390167/bin/sfdx force --help
     \--- 97200 gbockus /Users/gbockus/.local/share/sfdx/client/7.185.0-9390167/bin/node /Users/gbockus/.local/share/sfdx/client/7.185.0-9390167/bin/run force --help
ansible|------------------------------------------------------------

I can run sfdx force --help from the command line and it completes without issue.

@CristiCanizales
Copy link

CristiCanizales commented Feb 21, 2023

I went from 8 GB 14 hs ago to 73 GB now: 73G /Users/cristina.canizales/.sf/

502 60489     1   0  8Feb23 ??         0:00.22 /Users/cristina.canizales/.local/share/sfdx/client/7.185.0-9390167/bin/node /Users/cristina.canizales/.local/share/sfdx/client/7.185.0-9390167/node_modules/@salesforce/plugin-telemetry/processes/upload /Users/cristina.canizales/Library/Caches/sfdx /var/folders/yw/x__kzfd10lnbykhglftch4xw0000gp/T/sfdx-telemetry/telemetry-7906fcbef2237b802770b9c8f056ee6ade7504b3.log
  502 95230     1   0 10Feb23 ??         0:00.02 bash /usr/local/bin/sfdx force:data:record:delete --sobjecttype TraceFlag --sobjectid 7tf8B0000005nnUQAQ --usetoolingapi
  502 95241 95230   0 10Feb23 ??         0:00.02 bash /Users/cristina.canizales/.local/share/sfdx/client/bin/sfdx force:data:record:delete --sobjecttype TraceFlag --sobjectid 7tf8B0000005nnUQAQ --usetoolingapi
  502 95246 95241   0 10Feb23 ??         0:00.02 bash /Users/cristina.canizales/.local/share/sfdx/client/bin/../7.185.0-9390167/bin/sfdx force:data:record:delete --sobjecttype TraceFlag --sobjectid 7tf8B0000005nnUQAQ --usetoolingapi
  502 95254 95246   0 10Feb23 ??       14864:37.44 /Users/cristina.canizales/.local/share/sfdx/client/7.185.0-9390167/bin/node /Users/cristina.canizales/.local/share/sfdx/client/7.185.0-9390167/bin/run force:data:record:delete --sobjecttype TraceFlag --sobjectid 7tf8B0000005nnUQAQ --usetoolingapi
  502 92595 85457   0 12:36PM ttys007    0:00.01 grep --color=auto --exclude-dir=.bzr --exclude-dir=CVS --exclude-dir=.git --exclude-dir=.hg --exclude-dir=.svn --exclude-dir=.idea --exclude-dir=.tox sfdx

and I get the same message:

{"name":"sf","hostname":"cristin-ltm6uv7.internal.salesforce.com","pid":95254,"level":60,"errno":-32,"code":"EPIPE","syscall":"write","msg":"","time":"2023-02-21T15:44:00.780Z","v":0}

@atsutton
Copy link

If you or someone you know is experiencing logger problems, SF_DISABLE_LOG_FILE might be right for you.

This workaround did the trick. More information here: forcedotcom/sfdx-core#637

@iowillhoit iowillhoit added the bug Issue or pull request that identifies or fixes a bug label Apr 14, 2023
@git2gus
Copy link

git2gus bot commented Apr 14, 2023

This issue has been linked to a new work item: W-13038000

@iowillhoit
Copy link
Contributor

I am seeing this on my machine. Will be digging into this now that we finally have a CLI team member seeing it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue or pull request that identifies or fixes a bug investigating We're actively investigating this issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants