Skip to content

Build fails for Legacy mode ON for custom clients, KeyError: 'serviceName' #2712

Closed
@ajishna

Description

@ajishna

Describe the bug

When building the script for generate_sdks fail with:

Generating <my_service_name> api version <my_service_version>.
Traceback (most recent call last):

  File "aws-sdk-cpp\tools\scripts\legacy\generate_sdks.py", line 164, in <module>
    main()
  File "aws-sdk-cpp\tools\scripts\legacy\generate_sdks.py", line 153, in main
    generate_sdk(arguments['pathToGenerator'], sdks[key], arguments['outputLocation'], arguments['namespace'],
  File "aws-sdk-cpp\tools\scripts\legacy\generate_sdks.py", line 98, in generate_sdk
    process = Popen(['java', '-jar', jar_path, '--service', sdk['serviceName'], '--version', sdk['apiVersion'],
KeyError: 'serviceName'

The issue is because the key is defined as service_name and used as serviceName.
In tools/scripts/legacy/generate_sdks.py,

Line 76 :

sdk = {'service_name': service_name, 'apiVersion': match.group(2), 'filePath': join(discovery_path, file)}

Issue is in Line 98:

 process = Popen(['java', '-jar', jar_path, '--service', sdk['serviceName'], '--version', sdk['apiVersion'],

where the key is called using serviceName instead of service_name.

Expected Behavior

Build should not fail

Current Behavior

Build fails with KeyError

Reproduction Steps

Build custom client with -DLEGACY_BUILD=ON

Possible Solution

Rename serviceName to service_name at Line 98
or make the key names consistent (following naming/casing guidelines)

Additional Information/Context

No response

AWS CPP SDK version used

1.11.169

Compiler and Version used

Visual Studio 2022

Operating System and version

Windows 10

Activity

added
bugThis issue is a bug.
needs-triageThis issue or PR still needs to be triaged.
on Oct 13, 2023
self-assigned this
on Oct 16, 2023
jmklix

jmklix commented on Oct 17, 2023

@jmklix
Member

Does this PR fix the error you are getting when generating this sdk?

added
needs-reviewThis issue or pull request needs review from a core team member.
p3This is a minor priority issue
and removed
needs-triageThis issue or PR still needs to be triaged.
on Oct 17, 2023
ajishna

ajishna commented on Oct 18, 2023

@ajishna
Author
linked a pull request that will close this issuefix usage of service_name in codegen #2720on Nov 14, 2023
jmklix

jmklix commented on Nov 14, 2023

@jmklix
Member

Merged PR. closing this issue

github-actions

github-actions commented on Nov 14, 2023

@github-actions

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

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

Metadata

Metadata

Assignees

Labels

bugThis issue is a bug.needs-reviewThis issue or pull request needs review from a core team member.p3This is a minor priority issue

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Development

    Participants

    @jmklix@ajishna

    Issue actions

      Build fails for Legacy mode ON for custom clients, KeyError: 'serviceName' · Issue #2712 · aws/aws-sdk-cpp