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

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

Closed
ajishna opened this issue Oct 13, 2023 · 4 comments · Fixed by #2720
Closed

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

ajishna opened this issue Oct 13, 2023 · 4 comments · Fixed by #2720
Assignees
Labels
bug This issue is a bug. needs-review This issue or pull request needs review from a core team member. p3 This is a minor priority issue

Comments

@ajishna
Copy link

ajishna commented Oct 13, 2023

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

@ajishna ajishna added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Oct 13, 2023
@jmklix jmklix self-assigned this Oct 16, 2023
@jmklix
Copy link
Member

jmklix commented Oct 17, 2023

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

@jmklix jmklix added needs-review This issue or pull request needs review from a core team member. p3 This is a minor priority issue and removed needs-triage This issue or PR still needs to be triaged. labels Oct 17, 2023
@ajishna
Copy link
Author

ajishna commented Oct 18, 2023 via email

@jmklix
Copy link
Member

jmklix commented Nov 14, 2023

Merged PR. closing this issue

@jmklix jmklix closed this as completed Nov 14, 2023
Copy link

⚠️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
Labels
bug This issue is a bug. needs-review This issue or pull request needs review from a core team member. p3 This is a minor priority issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants