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

Onboarding error with .editorconfig present #18540

Closed
eliashaeussler opened this issue Oct 25, 2022 · 16 comments · Fixed by #18541
Closed

Onboarding error with .editorconfig present #18540

eliashaeussler opened this issue Oct 25, 2022 · 16 comments · Fixed by #18541
Assignees
Labels
priority-2-high Bugs impacting wide number of users or very important features status:requirements Full requirements are not yet known, so implementation should not be started type:bug Bug fix of existing functionality

Comments

@eliashaeussler
Copy link

How are you running Renovate?

Self-hosted

If you're self-hosting Renovate, tell us what version of Renovate you run.

32.241.4

If you're self-hosting Renovate, select which platform you are using.

GitLab self-hosted

If you're self-hosting Renovate, tell us what version of the platform you run.

GitLab 15.4.2 EE

Was this something which used to work for you, and then stopped?

It used to work, and then stopped

Describe the bug

Since Renovate 32.241.4, onboarding a project with the following .editorconfig fails:

#
# .editorconfig
#
# http://editorconfig.org
#
# The EditorConfig project consists of a file format for defining coding styles
# and a collection of text editor plugins that enable editors to read the file
# format and adhere to defined styles.
#

# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
indent_style = space
indent_size = 4
insert_final_newline = true

# package.json specific rules
[package.json]
indent_size = 2

# .yml specific rules
[*.yml]
indent_size = 2

This worked prior to 32.241.4, so it's probably a side-effect of the editorconfig dependency update at #18427.

Relevant debug logs

Logs
DEBUG: Found gitlabci package files (repository=xxx/yyy)
DEBUG: Found npm package files (repository=xxx/yyy)
DEBUG: Found 3 package file(s) (repository=xxx/yyy)
DEBUG: Need to create onboarding PR (repository=xxx/yyy)
DEBUG: createOnboardingBranch() (repository=xxx/yyy)
ERROR: Repository has unknown error (repository=xxx/yyy)
       "err": {
         "message": "unreachable",
         "stack": "RuntimeError: unreachable\n    at null.<anonymous> (wasm://wasm/00051056:1:55953)\n    at null.<anonymous> (wasm://wasm/00051056:1:62171)\n    at null.<anonymous> (wasm://wasm/00051056:1:70209)\n    at null.<anonymous> (wasm://wasm/00051056:1:70338)\n    at null.<anonymous> (wasm://wasm/00051056:1:69214)\n    at null.<anonymous> (wasm://wasm/00051056:1:17561)\n    at null.<anonymous> (wasm://wasm/00051056:1:47453)\n    at null.<anonymous> (wasm://wasm/00051056:1:58421)\n    at null.<anonymous> (wasm://wasm/00051056:1:54915)\n    at module.exports.parse_to_uint32array (/usr/src/app/node_modules/@one-ini/wasm/one_ini.js:235:14)\n    at parseBuffer (/usr/src/app/node_modules/editorconfig/lib/index.js:58:52)\n    at processFileContents (/usr/src/app/node_modules/editorconfig/lib/index.js:234:25)\n    at getConfig (/usr/src/app/node_modules/editorconfig/lib/index.js:272:12)\n    at getAllConfigs (/usr/src/app/node_modules/editorconfig/lib/index.js:310:24)\n    at parse (/usr/src/app/node_modules/editorconfig/lib/index.js:440:21)\n    at Function.getCodeFormat (/usr/src/app/node_modules/renovate/lib/util/json-writer/editor-config.ts:10:24)\n    at getOnboardingConfigContents (/usr/src/app/node_modules/renovate/lib/workers/repository/onboarding/branch/config.ts:89:22)\n    at createOnboardingBranch (/usr/src/app/node_modules/renovate/lib/workers/repository/onboarding/branch/create.ts:21:20)\n    at checkOnboardingBranch (/usr/src/app/node_modules/renovate/lib/workers/repository/onboarding/branch/index.ts:65:20)\n    at getRepoConfig (/usr/src/app/node_modules/renovate/lib/workers/repository/init/config.ts:15:12)"
       }
DEBUG: Unknown res (repository=xxx/yyy)
       "res": "unknown-error"
DEBUG: Repository result: unknown-error, status: unknown, enabled: undefined, onboarded: undefined (repository=xxx/yyy)

Formatted error message with stacktrace:

RuntimeError: unreachable
    at null.<anonymous> (wasm://wasm/00051056:1:55953)
    at null.<anonymous> (wasm://wasm/00051056:1:62171)
    at null.<anonymous> (wasm://wasm/00051056:1:70209)
    at null.<anonymous> (wasm://wasm/00051056:1:70338)
    at null.<anonymous> (wasm://wasm/00051056:1:69214)
    at null.<anonymous> (wasm://wasm/00051056:1:17561)
    at null.<anonymous> (wasm://wasm/00051056:1:47453)
    at null.<anonymous> (wasm://wasm/00051056:1:58421)
    at null.<anonymous> (wasm://wasm/00051056:1:54915)
    at module.exports.parse_to_uint32array (/usr/src/app/node_modules/@one-ini/wasm/one_ini.js:235:14)
    at parseBuffer (/usr/src/app/node_modules/editorconfig/lib/index.js:58:52)
    at processFileContents (/usr/src/app/node_modules/editorconfig/lib/index.js:234:25)
    at getConfig (/usr/src/app/node_modules/editorconfig/lib/index.js:272:12)
    at getAllConfigs (/usr/src/app/node_modules/editorconfig/lib/index.js:310:24)
    at parse (/usr/src/app/node_modules/editorconfig/lib/index.js:440:21)
    at Function.getCodeFormat (/usr/src/app/node_modules/renovate/lib/util/json-writer/editor-config.ts:10:24)
    at getOnboardingConfigContents (/usr/src/app/node_modules/renovate/lib/workers/repository/onboarding/branch/config.ts:89:22)
    at rebaseOnboardingBranch (/usr/src/app/node_modules/renovate/lib/workers/repository/onboarding/branch/rebase.ts:31:20)
    at checkOnboardingBranch (/usr/src/app/node_modules/renovate/lib/workers/repository/onboarding/branch/index.ts:38:20)
    at getRepoConfig (/usr/src/app/node_modules/renovate/lib/workers/repository/init/config.ts:15:12)

Have you created a minimal reproduction repository?

No reproduction repository

@eliashaeussler eliashaeussler added priority-5-triage status:requirements Full requirements are not yet known, so implementation should not be started type:bug Bug fix of existing functionality labels Oct 25, 2022
@PhilipAbed PhilipAbed added the regression Issue about a regression bug, or the PR caused it label Oct 25, 2022
@viceice
Copy link
Member

viceice commented Oct 25, 2022

How are you running renovate? are you using the full docker image? Can you test v34 then?

So maybe node v14 isn't fully compatible with the new wasm version of editorconfig.

@viceice
Copy link
Member

viceice commented Oct 25, 2022

opened an upstream issue

@PhilipAbed PhilipAbed added priority-2-high Bugs impacting wide number of users or very important features and removed priority-5-triage labels Oct 25, 2022
@eliashaeussler
Copy link
Author

eliashaeussler commented Oct 25, 2022

We use the slim Docker image. I already tested this with 33.1 and 33.2 and got the same result. Will test with 34 later and give you feedback then.

@PhilipAbed
Copy link
Collaborator

i tried unit test:

image

@PhilipAbed
Copy link
Collaborator

@viceice i think u need to put the input file too in your upstream issue

@PhilipAbed PhilipAbed added priority-4-low Low priority, unlikely to be done unless it becomes important to more people priority-2-high Bugs impacting wide number of users or very important features and removed priority-2-high Bugs impacting wide number of users or very important features regression Issue about a regression bug, or the PR caused it priority-4-low Low priority, unlikely to be done unless it becomes important to more people labels Oct 25, 2022
@PhilipAbed
Copy link
Collaborator

PhilipAbed commented Oct 25, 2022

this seems to be a problem in the input file, so the problem in the library itself

on the other hand, we should exit gracefully, and not error with null in this case

@viceice
Copy link
Member

viceice commented Oct 25, 2022

@PhilipAbed Can you create a quick fix PR, which ignores that error?

@PhilipAbed PhilipAbed self-assigned this Oct 25, 2022
@PhilipAbed
Copy link
Collaborator

@viceice on it, is it ok if i add a test on this? and once the library is fixed the test will fail? :D that's how we know its fixed?

@rarkins
Copy link
Collaborator

rarkins commented Oct 25, 2022

Yes, add a test which fails on current code and then is fixed by your change

@PhilipAbed
Copy link
Collaborator

PhilipAbed commented Oct 25, 2022

@rarkins
the test will fail at current
Succeed with results UNDEFINED at new fix.
succeeds the functions but fails the test with actual results if the library has fixed the parsing issue ( this will fail the assert in the test because its expecting undefined)

so next time we upload the package editorConfig with the fixed new version, the test will fail and return an actual result instead of undefined and error , then we know the issue is actually fixed

@PhilipAbed
Copy link
Collaborator

@eliashaeussler
I tried finding a workaround, by removing stuff from the file to see where the error is coming from..
apparently they fail at parsing Empty comments
so if you add
#
it will fail.
so i removed the empty comments from your file and it worked fine,

this works fine

# .editorconfig
# http://editorconfig.org
# The EditorConfig project consists of a file format for defining coding styles
# and a collection of text editor plugins that enable editors to read the file
# format and adhere to defined styles.

# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
indent_style = space
indent_size = 4
insert_final_newline = true

# package.json specific rules
[package.json]
indent_size = 2

# .yml specific rules
[*.yml]
indent_size = 2

@viceice
Copy link
Member

viceice commented Oct 25, 2022

@viceice on it, is it ok if i add a test on this? and once the library is fixed the test will fail? :D that's how we know its fixed?

it's ok to let a test fail, when the lib fixed the issue

@viceice
Copy link
Member

viceice commented Oct 25, 2022

opened another upstream issue:

@renovate-release
Copy link
Collaborator

🎉 This issue has been resolved in version 34.1.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@eliashaeussler
Copy link
Author

Thanks guys!

@viceice
Copy link
Member

viceice commented Oct 26, 2022

upstream bug is fixed and released too. 🎉

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 26, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
priority-2-high Bugs impacting wide number of users or very important features status:requirements Full requirements are not yet known, so implementation should not be started type:bug Bug fix of existing functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants