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

Crash "TypeError: object null is not iterable" for github/docs #112

Closed
nschonni opened this issue Oct 15, 2020 · 18 comments
Closed

Crash "TypeError: object null is not iterable" for github/docs #112

nschonni opened this issue Oct 15, 2020 · 18 comments

Comments

@nschonni
Copy link
Contributor

Was looking at setting up Markdownlint on the new
Running the 0.24.0 version crashes with the following


Z:\github-docs\node_modules\markdownlint\lib\markdownlint.js:859
      throw error;
      ^

TypeError: object null is not iterable (cannot read property Symbol(Symbol.iterator))
    at Z:\github-docs\node_modules\markdownlint\lib\md031.js:24:30
    at forMetadata (Z:\github-docs\node_modules\markdownlint\helpers\helpers.js:259:5)
    at Array.forEach (<anonymous>)
    at forEachLine (Z:\github-docs\node_modules\markdownlint\helpers\helpers.js:257:16)
    at Object.MD031 [as function] (Z:\github-docs\node_modules\markdownlint\lib\md031.js:18:5)
    at forRule (Z:\github-docs\node_modules\markdownlint\lib\markdownlint.js:595:20)
    at Array.forEach (<anonymous>)
    at lintContent (Z:\github-docs\node_modules\markdownlint\lib\markdownlint.js:641:14)
    at lintContentWrapper (Z:\github-docs\node_modules\markdownlint\lib\markdownlint.js:681:12)
    at lintFile (Z:\github-docs\node_modules\markdownlint\lib\markdownlint.js:687:5)

Rolling back to 0.23.2 runs without issue.

PS: @DavidAnson might be another good repo for the CITGM/CI setup after I get it running

@nschonni nschonni changed the title Crash on 0.24 "TypeError: object null is not iterable" for github/docs Crash "TypeError: object null is not iterable" for github/docs Oct 15, 2020
@nschonni
Copy link
Contributor Author

Sorry, just realized it is crashing on 0.23.2 as well, I had switched to markdown-cli2 after the initial crash. Trying to step back a few versions now to see if it is new issue or if I can find a particular file

@nschonni
Copy link
Contributor Author

OK, one of the files that it's crashing on is https://github.com/github/docs/blob/main/content/admin/enterprise-management/differences-between-clustering-and-high-availability-ha.md

Stepping through the files to trace down to the individual files that are having the issues, the common point is nested codeblocks under ordered lists that have bad indenting. Some have closing backticks that aren't indented enough, or elements inside that are not indented enough. Can't figure out why the same thing is passing in latest CLI2, but failing in this one

@DavidAnson
Copy link
Collaborator

It doesn’t seem to cause an exception when pasted into https://dlaa.me/markdownlint/. Wonder if your install of CLI is somehow outdated?

@nschonni
Copy link
Contributor Author

Same when pushing and running in CI https://github.com/nschonni/github-docs/actions/runs/307710095

@nschonni
Copy link
Contributor Author

The fixes in nschonni/github-docs@f2f6245 did address it, but I found that there was a folder of "translations" masked in VS Code that I need to reapply the same formatting fixes to

@DavidAnson
Copy link
Collaborator

Both CLI and CLI2 are affected - however, CLI2 reports the error and continues linting while CLI aborts immediately. The following is information about affected files - seemingly all with the same issue. This will be an issue with https://github.com/DavidAnson/markdownlint, not either CLI project.

pi@pi:~/docs $ git remote -v
origin	https://github.com/github/docs.git (fetch)
origin	https://github.com/github/docs.git (push)
pi@pi:~/docs $ git rev-parse HEAD
56ffb1f5ed8612c13646e67f0e7144492b855191
pi@pi:~/docs $ cat cli2.txt | grep "threw an exception"
content/admin/enterprise-management/configuring-high-availability-replication-for-a-cluster.md:11
content/admin/installation/installing-github-enterprise-server-on-google-cloud-platform.md:11
content/admin/policies/creating-a-pre-receive-hook-environment.md:11
content/admin/policies/creating-a-pre-receive-hook-script.md:11
content/github/using-git/setting-your-username-in-git.md:11
translations/de-DE/content/admin/developer-workflow/creating-a-pre-receive-hook-environment.md:10
translations/de-DE/content/admin/developer-workflow/creating-a-pre-receive-hook-script.md:10
translations/de-DE/content/admin/enterprise-management/configuring-high-availability-replication-for-a-cluster.md:11
translations/de-DE/content/admin/installation/installing-github-enterprise-server-on-google-cloud-platform.md:11
translations/de-DE/content/admin/policies/creating-a-pre-receive-hook-environment.md:11
translations/de-DE/content/admin/policies/creating-a-pre-receive-hook-script.md:11
translations/de-DE/content/github/using-git/setting-your-username-in-git.md:11
translations/es-XL/content/admin/developer-workflow/creating-a-pre-receive-hook-environment.md:10
translations/es-XL/content/admin/developer-workflow/creating-a-pre-receive-hook-script.md:10
translations/es-XL/content/admin/enterprise-management/configuring-high-availability-replication-for-a-cluster.md:11
translations/es-XL/content/admin/installation/installing-github-enterprise-server-on-google-cloud-platform.md:11
translations/es-XL/content/admin/policies/creating-a-pre-receive-hook-environment.md:11
translations/es-XL/content/admin/policies/creating-a-pre-receive-hook-script.md:11
translations/es-XL/content/github/using-git/setting-your-username-in-git.md:11
translations/ja-JP/content/admin/developer-workflow/creating-a-pre-receive-hook-environment.md:10
translations/ja-JP/content/admin/developer-workflow/creating-a-pre-receive-hook-script.md:10
translations/ja-JP/content/admin/enterprise-management/configuring-high-availability-replication-for-a-cluster.md:11
translations/ja-JP/content/admin/installation/installing-github-enterprise-server-on-google-cloud-platform.md:11
translations/ja-JP/content/admin/policies/creating-a-pre-receive-hook-environment.md:11
translations/ja-JP/content/admin/policies/creating-a-pre-receive-hook-script.md:11
translations/ja-JP/content/github/using-git/setting-your-username-in-git.md:11
translations/ko-KR/content/admin/enterprise-management/configuring-high-availability-replication-for-a-cluster.md:11
translations/ko-KR/content/admin/installation/installing-github-enterprise-server-on-google-cloud-platform.md:11
translations/ko-KR/content/admin/policies/creating-a-pre-receive-hook-environment.md:11
translations/ko-KR/content/admin/policies/creating-a-pre-receive-hook-script.md:11
translations/ko-KR/content/github/using-git/setting-your-username-in-git.md:11
translations/pt-BR/content/admin/developer-workflow/creating-a-pre-receive-hook-environment.md:10
translations/pt-BR/content/admin/developer-workflow/creating-a-pre-receive-hook-script.md:10
translations/pt-BR/content/admin/enterprise-management/configuring-high-availability-replication-for-a-cluster.md:11
translations/pt-BR/content/admin/installation/installing-github-enterprise-server-on-google-cloud-platform.md:11
translations/pt-BR/content/admin/policies/creating-a-pre-receive-hook-environment.md:11
translations/pt-BR/content/admin/policies/creating-a-pre-receive-hook-script.md:11
translations/pt-BR/content/github/using-git/setting-your-username-in-git.md:11
translations/ru-RU/content/admin/enterprise-management/configuring-high-availability-replication-for-a-cluster.md:11
translations/ru-RU/content/admin/installation/installing-github-enterprise-server-on-google-cloud-platform.md:11
translations/ru-RU/content/admin/policies/creating-a-pre-receive-hook-environment.md:11
translations/ru-RU/content/admin/policies/creating-a-pre-receive-hook-script.md:11
translations/ru-RU/content/github/using-git/setting-your-username-in-git.md:11
translations/zh-CN/content/admin/developer-workflow/creating-a-pre-receive-hook-environment.md:10
translations/zh-CN/content/admin/developer-workflow/creating-a-pre-receive-hook-script.md:10
translations/zh-CN/content/admin/enterprise-management/configuring-high-availability-replication-for-a-cluster.md:11
translations/zh-CN/content/admin/installation/installing-github-enterprise-server-on-google-cloud-platform.md:11
translations/zh-CN/content/admin/policies/creating-a-pre-receive-hook-environment.md:11
translations/zh-CN/content/admin/policies/creating-a-pre-receive-hook-script.md:11
translations/zh-CN/content/github/using-git/setting-your-username-in-git.md:11

@nschonni
Copy link
Contributor Author

OK, feel free to transfer the issue

@DavidAnson
Copy link
Collaborator

I can’t transfer because it’s a different organization. :) But don’t worry about it, this item is top of my list now. I may do a patch release for the library since this will be the second fix for a never-before-seen crash.

@nschonni
Copy link
Contributor Author

Ah, right. Too bad the markdownlint org is already taken :(. It would be nice to move them all into one place

@DavidAnson
Copy link
Collaborator

Fixed here: DavidAnson/markdownlint@392cc28

@nschonni
Copy link
Contributor Author

Cool, might want to run it on github/docs, as I seem to recall there might have been a crash with MD039 too. That might have just been bad debugger attaching on my part in VS code 😆

@DavidAnson
Copy link
Collaborator

That was part of my verification - both CLI's now run to completion against the github/docs commit I reference above. :) Let me know when your PR is accepted and I'll add github/docs to the TestRepos action - that's a good idea.

@nschonni
Copy link
Contributor Author

Cool! Chicken/egg thing. If a new release comes out, I may split that PR that includes the fixes to make it easier to land. There triage queue is a little overloaded right now, but here is the PR if you want to subscribe github/docs#541

@DavidAnson
Copy link
Collaborator

I published a patch release of the library yesterday evening. At this point, fresh installs of the CLI should install that release with the fix for this.

@nschonni
Copy link
Contributor Author

I saw that, and had actually fixed that PR yesterday 😄
I split out the content changes to a separate PR, but I'm waiting for their tech writers to review both the PRs
I'll go ahead an close this because it did fix the issue.

@DavidAnson
Copy link
Collaborator

You are too quick!

@nschonni
Copy link
Contributor Author

Ha, I can ping you when that one lands if you aren't already subscribed to that PR

@DavidAnson
Copy link
Collaborator

I'm not subscribed - ping me. I'll add that repo to the tests.

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

No branches or pull requests

2 participants