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

Windows 11: [ERROR] Failed to remove temp file at file_utils.go:25 tryRemoveTempFile #2020

Open
eissar opened this issue Apr 25, 2024 · 1 comment
Labels

Comments

@eissar
Copy link

eissar commented Apr 25, 2024

yq (https://github.com/mikefarah/yq/) version v4.43.1
Operating system: Windows 11 24H2
Attempted choco install /exe Install from releases, same error on each.

The command I ran:

yq --front-matter=extract 01.md --verbose

Was trying to get the front matter of a single file so I could try doing more complex things. The yaml front matter is just:

---
date: "2024-04-01"
---

But running

yq --front-matter=extract 01.md

Prints to console:
date: "2024-04-01"
[ERROR] 00:01:07 Failed to remove temp file: C:\Users\USER\AppData\Local\Temp\temp815380285

The function looks like it's literally just calling "os.Remove" so it's pretty strange. Would appreciate any help or quick guidance! Tomorrow will try installing on another windows machine to see if I get the same error.

Verbose command output below:
yq --front-matter=extract 01.md --verbose
[DEBUG] 23:54:22 utils.go:174 maybeFile checking '01.md' is a file
[DEBUG] 23:54:23 utils.go:181 maybeFile error: , dir: false
[DEBUG] 23:54:23 utils.go:183 maybeFile result: true
[DEBUG] 23:54:23 utils.go:236 processArgs processed args: [01.md]
[DEBUG] 23:54:23 utils.go:174 maybeFile checking '01.md' is a file
[DEBUG] 23:54:23 utils.go:181 maybeFile error: , dir: false
[DEBUG] 23:54:23 utils.go:183 maybeFile result: true
[DEBUG] 23:54:23 format.go:112 FormatStringFromFilename checking file extension '01.md' for auto format detection
[DEBUG] 23:54:23 format.go:116 FormatStringFromFilename detected format 'md'
[DEBUG] 23:54:23 utils.go:72 initCommand Unknown file format extension 'md', defaulting to yaml
[DEBUG] 23:54:23 utils.go:97 initCommand Using input format yaml
[DEBUG] 23:54:23 utils.go:98 initCommand Using output format yaml
[DEBUG] 23:54:23 evaluate_sequence_command.go:119 evaluateSequence using front matter handler
[DEBUG] 23:54:23 front_matter.go:61 Split yamlTempFile: C:\Users\USER\AppData\Local\Temp\temp3702331487
[DEBUG] 23:54:23 expression_parser.go:28 ParseExpression Parsing expression: []
[DEBUG] 23:54:23 expression_postfix.go:46 ConvertToPostfix postfix processing currentToken )
[DEBUG] 23:54:23 expression_postfix.go:126 ConvertToPostfix opstackLen: 0
[DEBUG] 23:54:23 expression_postfix.go:137 ConvertToPostfix PostFix Result:
[DEBUG] 23:54:23 candidate_node_yaml.go:109 UnmarshalYAML UnmarshalYAML !!map
[DEBUG] 23:54:23 candidate_node_yaml.go:122 UnmarshalYAML UnmarshalYAML - a mapping node
[DEBUG] 23:54:23 candidate_node_yaml.go:109 UnmarshalYAML UnmarshalYAML !!str
[DEBUG] 23:54:23 candidate_node_yaml.go:117 UnmarshalYAML UnmarshalYAML - a scalar
[DEBUG] 23:54:23 candidate_node_yaml.go:109 UnmarshalYAML UnmarshalYAML !!str
[DEBUG] 23:54:23 candidate_node_yaml.go:117 UnmarshalYAML UnmarshalYAML - a scalar
[DEBUG] 23:54:23 candidate_node_yaml.go:145 UnmarshalYAML UnmarshalYAML - finished mapping node
[DEBUG] 23:54:23 data_tree_navigator.go:54 GetMatchingNodes getMatchingNodes - nothing to do
[DEBUG] 23:54:23 printer.go:73 PrintResults PrintResults for 1 matches
[DEBUG] 23:54:23 printer.go:100 PrintResults print sep logic: p.firstTimePrinting: false, previousDocIndex: 0
[DEBUG] 23:54:23 printer.go:101 PrintResults D0, P, MappingNode (!!map)::2 kids
[DEBUG] 23:54:23 encoder_yaml.go:77 Encode encoderYaml - going to print D0, P, MappingNode (!!map)::2 kids
[DEBUG] 23:54:23 candidate_node_yaml.go:182 MarshalYAML MarshalYAML to yaml: !!map
[DEBUG] 23:54:23 candidate_node_yaml.go:201 MarshalYAML original style: 0
[DEBUG] 23:54:23 candidate_node_yaml.go:202 MarshalYAML original: D0, P, MappingNode (!!map)::2 kids, tag: !!map, style: 0, kind: false
[DEBUG] 23:54:23 candidate_node_yaml.go:182 MarshalYAML MarshalYAML to yaml: !!str
[DEBUG] 23:54:23 candidate_node_yaml.go:190 MarshalYAML MarshalYAML - scalar: date
[DEBUG] 23:54:23 candidate_node_yaml.go:182 MarshalYAML MarshalYAML to yaml: !!str
[DEBUG] 23:54:23 candidate_node_yaml.go:190 MarshalYAML MarshalYAML - scalar: 2024-04-01
date: "2024-04-01"
[DEBUG] 23:54:23 printer.go:150 PrintResults done printing results
[DEBUG] 23:54:23 file_utils.go:25 tryRemoveTempFile Removing temp file: C:\Users\USER\AppData\Local\Temp\temp3702331487
[ERROR] 23:54:23 file_utils.go:28 tryRemoveTempFile Failed to remove temp file: C:\Users\USER\AppData\Local\Temp\temp3702331487

@eissar
Copy link
Author

eissar commented Apr 25, 2024

Getting the same error on a different fresh windows install. yq (https://github.com/mikefarah/yq/) version v4.43.1, windows 11 23H2. Installed from winget.

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

No branches or pull requests

1 participant