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

[BUG] Key Error in version.create_documentation #2082

Closed
terrancedejesus opened this issue Jun 20, 2022 · 0 comments · Fixed by #2083
Closed

[BUG] Key Error in version.create_documentation #2082

terrancedejesus opened this issue Jun 20, 2022 · 0 comments · Fixed by #2083
Assignees
Labels
bug Something isn't working

Comments

@terrancedejesus
Copy link
Contributor

terrancedejesus commented Jun 20, 2022

Description:

While doing the security docs update for pre-built detection rules v8.3.0 I received the following error after running python prebuilt-rules-scripts/generate.py generate 8.3.0.

KeyError: 'duplicate_old_file'

Tracing this back, it appears to reference line 543 of generate.py

  if 'pre_name' in i:
      if i['pre_name'] != None:
          file_text = file_text + "* Rule name changed from: " + i['pre_name'] + "\n"
          rule_name_changed = True
          if i['updated'] == package_release:
              rule_link_file = rule_link + ".asciidoc"
              files_with_updated_rule_name[rule_link_file] = i["duplicate_old_file"]

After debugging, it appears we can apply a quick fix as such to attempt this key reference and if not reference pre_name instead which is within the same dictionary object.

Screen Shot 2022-06-20 at 4 08 28 PM

After applying the fix locally, the run was successful.

Screen Shot 2022-06-20 at 4 11 06 PM

In addition to this, I added launch.json to the gitignore file to ignore the python debug configuration file for vscode so it does not get committed.

@terrancedejesus terrancedejesus added the bug Something isn't working label Jun 20, 2022
@terrancedejesus terrancedejesus self-assigned this Jun 20, 2022
@terrancedejesus terrancedejesus linked a pull request Jun 20, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant