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

Error: 'NoneType' object has no attribute 'group' #7730

Open
nikitasius opened this issue Nov 22, 2024 · 2 comments
Open

Error: 'NoneType' object has no attribute 'group' #7730

nikitasius opened this issue Nov 22, 2024 · 2 comments
Labels
stage/waiting-for-release Fix has been merged to develop and is waiting for a release type/bug

Comments

@nikitasius
Copy link

Hi folks, idk what you did but 1.130.0 crashing when i deploy my stuff. Last working for me is 1.129.0.

Description:

sam validate --lint && sam build && sam deploy --no-confirm-changeset --no-fail-on-empty-changeset --no-progressbar

  • SAM 1.129.0 - OK
  • SAM 1.130.0 - CRASH
Error: 'NoneType' object has no attribute 'group'
Traceback:
  File "/home/runner/work/_temp/setup-sam-ccGfbF/.venv/lib/python3.10/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
  File "/home/runner/work/_temp/setup-sam-ccGfbF/.venv/lib/python3.10/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/runner/work/_temp/setup-sam-ccGfbF/.venv/lib/python3.10/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/runner/work/_temp/setup-sam-ccGfbF/.venv/lib/python3.10/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
  File "/home/runner/work/_temp/setup-sam-ccGfbF/.venv/lib/python3.10/site-packages/samcli/cli/cli_config_file.py", line 347, in wrapper
    return func(*args, **kwargs)
  File "/home/runner/work/_temp/setup-sam-ccGfbF/.venv/lib/python3.10/site-packages/click/decorators.py", line 92, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "/home/runner/work/_temp/setup-sam-ccGfbF/.venv/lib/python3.10/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
  File "/home/runner/work/_temp/setup-sam-ccGfbF/.venv/lib/python3.10/site-packages/samcli/lib/telemetry/metric.py", line 185, in wrapped
    raise exception  # pylint: disable=raising-bad-type
  File "/home/runner/work/_temp/setup-sam-ccGfbF/.venv/lib/python3.10/site-packages/samcli/lib/telemetry/metric.py", line 150, in wrapped
    return_value = func(*args, **kwargs)
  File "/home/runner/work/_temp/setup-sam-ccGfbF/.venv/lib/python3.10/site-packages/samcli/lib/utils/version_checker.py", line 43, in wrapped
    actual_result = func(*args, **kwargs)
  File "/home/runner/work/_temp/setup-sam-ccGfbF/.venv/lib/python3.10/site-packages/samcli/cli/main.py", line 95, in wrapper
    return func(*args, **kwargs)
  File "/home/runner/work/_temp/setup-sam-ccGfbF/.venv/lib/python3.10/site-packages/samcli/commands/build/command.py", line 169, in cli
    do_cli(
  File "/home/runner/work/_temp/setup-sam-ccGfbF/.venv/lib/python3.10/site-packages/samcli/commands/build/command.py", line 258, in do_cli
    ctx.run()
  File "/home/runner/work/_temp/setup-sam-ccGfbF/.venv/lib/python3.10/site-packages/samcli/commands/build/build_context.py", line 284, in run
    self._build_result = builder.build()
  File "/home/runner/work/_temp/setup-sam-ccGfbF/.venv/lib/python3.10/site-packages/samcli/lib/build/app_builder.py", line 226, in build
    return ApplicationBuildResult(build_graph, build_strategy.build())
  File "/home/runner/work/_temp/setup-sam-ccGfbF/.venv/lib/python3.10/site-packages/samcli/lib/build/build_strategy.py", line 83, in build
    result.update(self._build_functions(self._build_graph))
  File "/home/runner/work/_temp/setup-sam-ccGfbF/.venv/lib/python3.10/site-packages/samcli/lib/build/build_strategy.py", line 93, in _build_functions
    function_build_results.update(self.build_single_function_definition(build_definition))
  File "/home/runner/work/_temp/setup-sam-ccGfbF/.venv/lib/python3.10/site-packages/samcli/lib/build/build_strategy.py", line 167, in build_single_function_definition
    result = self._build_function(
  File "/home/runner/work/_temp/setup-sam-ccGfbF/.venv/lib/python3.10/site-packages/samcli/lib/build/app_builder.py", line 738, in _build_function
    return self._build_function_in_process(
  File "/home/runner/work/_temp/setup-sam-ccGfbF/.venv/lib/python3.10/site-packages/samcli/lib/build/app_builder.py", line 892, in _build_function_in_process
    builder.build(
  File "/home/runner/work/_temp/setup-sam-ccGfbF/.venv/lib/python3.10/site-packages/aws_lambda_builders/builder.py", line 172, in build
    return workflow.run()
  File "/home/runner/work/_temp/setup-sam-ccGfbF/.venv/lib/python3.10/site-packages/aws_lambda_builders/workflow.py", line 86, in wrapper
    valid_path = binary_checker.validator.validate(executable_path)
  File "/home/runner/work/_temp/setup-sam-ccGfbF/.venv/lib/python3.10/site-packages/aws_lambda_builders/workflows/java_gradle/gradle_validator.py", line 49, in validate
    jvm_mv = self._get_major_version(gradle_path)
  File "/home/runner/work/_temp/setup-sam-ccGfbF/.venv/lib/python3.10/site-packages/aws_lambda_builders/workflows/java_gradle/gradle_validator.py", line 70, in _get_major_version
    version = m.group(1).split(".")

Steps to reproduce:

i won't share my config, guess the error tell all you need.

Observed result:

BAD, waste of time, friday evening debug

Expected result:

GOOD, 6 minutes deploy and friday's beer.

Additional environment details (Ex: Windows, Mac, Amazon Linux etc)

github actions

@nikitasius nikitasius added the stage/needs-triage Automatically applied to new issues and PRs, indicating they haven't been looked at. label Nov 22, 2024
@dkphm
Copy link
Contributor

dkphm commented Nov 22, 2024

Hi @nikitasius , thank you for reporting the issue. From the logs looks like it is due to a new version of aws_lambda_builders that causing the exception. To assist further, could you help to run this command

gradle --version

and give us the output?

@dkphm dkphm added type/bug blocked/more-info-needed More info is needed from the requester. If no response in 14 days, it will become stale. and removed stage/needs-triage Automatically applied to new issues and PRs, indicating they haven't been looked at. labels Nov 22, 2024
@nikitasius
Copy link
Author

@dkphm sure (currently i force 1.129.0, usual CI/CD doesn't have SAM version specified)

    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Set up AWS Coretto 21
        uses: actions/setup-java@v4
        with:
          java-version: '21'
          distribution: 'corretto'
          architecture: x64
      - uses: actions/setup-python@v5
      - uses: aws-actions/setup-sam@v2
        with:
          version: '1.129.0'
      - uses: aws-actions/configure-aws-credentials@v4
        with:

and from logs from github actions:

java -version

openjdk version "21.0.5" 2024-10-15 LTS
OpenJDK Runtime Environment Corretto-21.0.5.11.1 (build 21.0.5+11-LTS)
OpenJDK 64-Bit Server VM Corretto-21.0.5.11.1 (build 21.0.5+11-LTS, mixed mode, sharing)

gradle -v

Welcome to Gradle 8.11!

Here are the highlights of this release:
 - Parallel load and store for Configuration Cache
 - Java compilation errors at the end of the build output
 - Consolidated report for warnings and deprecations

For more details see https://docs.gradle.org/8.11/release-notes.html


------------------------------------------------------------
Gradle 8.11
------------------------------------------------------------

Build time:    2024-11-11 13:58:01 UTC
Revision:      b2ef976169a05b3c76d04f0fa76a940859f96fa4

Kotlin:        2.0.20
Groovy:        3.0.22
Ant:           Apache Ant(TM) version 1.10.14 compiled on August 16 2023
Launcher JVM:  21.0.5 (Amazon.com Inc. 21.0.5+11-LTS)
Daemon JVM:    /opt/hostedtoolcache/Java_Corretto_jdk/21.0.5-11.1/x64 (no JDK specified, using current Java home)
OS:            Linux 6.5.0-1025-azure amd64

@dkphm dkphm added stage/waiting-for-release Fix has been merged to develop and is waiting for a release and removed blocked/more-info-needed More info is needed from the requester. If no response in 14 days, it will become stale. labels Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stage/waiting-for-release Fix has been merged to develop and is waiting for a release type/bug
Projects
None yet
Development

No branches or pull requests

2 participants