Profile (False) not found

Offen
#1,066 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
35/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Veraltet
Tech-Stack
aws, python
Bereich
cli

Rechercherichtung

Beginnen Sie mit rpdk/core/package.py und folgen Sie project.py:_load_target_info bis zu boto_helpers.py:create_sdk_session, unter Verwendung des im Bericht gezeigten Tracebacks und .rpdk-config. Reproduzieren Sie cfn package mit den gemeldeten Profileinstellungen und ermitteln Sie, warum False statt des konfigurierten Profils an Boto3 übergeben wird. Als erledigt gilt die Aufgabe, wenn der Befehl den Profilwert korrekt verarbeitet und die Regression durch einen geeigneten Test abgedeckt ist.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

When running cfn package, I am getting the following error

[2024-05-01T11:30:50Z] DEBUG    - Running package: Namespace(version=False, subparser_name='package', command=<function package at 0x7f7646575a20>, verbose=0)
[2024-05-01T11:30:50Z] DEBUG    - Root directory: /home/runner/work/db-aws-cloudformation-guard/db-aws-cloudformation-guard/hook
[2024-05-01T11:30:50Z] DEBUG    - Loading project file '/home/runner/work/db-aws-cloudformation-guard/db-aws-cloudformation-guard/hook/.rpdk-config'
[2024-05-01T11:30:50Z] INFO     - Validating your hook specification...
[2024-05-01T11:30:50Z] DEBUG    - Rewriting refs in '<BASE>' (file:///home/runner/work/db-aws-cloudformation-guard/db-aws-cloudformation-guard/hook/myCompany-cloudformation-guard.json)
[2024-05-01T11:30:50Z] DEBUG    - inputs not found. Not writing to package.
[2024-05-01T11:30:50Z] DEBUG    - Hook schema target names: {'AWS::S3::BucketPolicy', 'AWS::S3::Bucket'}
[2024-05-01T11:30:50Z] DEBUG    - Unhandled exception
Traceback (most recent call last):
  File "/home/runner/.local/lib/python3.10/site-packages/rpdk/core/cli.py", line 105, in main
    args.command(args)
  File "/home/runner/.local/lib/python3.10/site-packages/rpdk/core/package.py", line 15, in package
    project.submit(
  File "/home/runner/.local/lib/python3.10/site-packages/rpdk/core/project.py", line 648, in submit
    self._add_hooks_content_to_zip(
  File "/home/runner/.local/lib/python3.10/site-packages/rpdk/core/project.py", line 715, in _add_hooks_content_to_zip
    else self._load_target_info(
  File "/home/runner/.local/lib/python3.10/site-packages/rpdk/core/project.py", line 1233, in _load_target_info
    session = create_sdk_session(region_name, profile_name)
  File "/home/runner/.local/lib/python3.10/site-packages/rpdk/core/boto_helpers.py", line 24, in create_sdk_session
    session = Boto3Session(profile_name=profile_name, region_name=region_name)
  File "/home/runner/.local/lib/python3.10/site-packages/boto3/session.py", line 90, in __init__
    self._setup_loader()
  File "/home/runner/.local/lib/python3.10/site-packages/boto3/session.py", line 131, in _setup_loader
    self._loader = self._session.get_component('data_loader')
  File "/home/runner/.local/lib/python3.10/site-packages/botocore/session.py", line 802, in get_component
    return self._components.get_component(name)
  File "/home/runner/.local/lib/python3.10/site-packages/botocore/session.py", line 1140, in get_component
    self._components[name] = factory()
  File "/home/runner/.local/lib/python3.10/site-packages/botocore/session.py", line 199, in <lambda>
    lambda: create_loader(self.get_config_variable('data_path')),
  File "/home/runner/.local/lib/python3.10/site-packages/botocore/session.py", line 323, in get_config_variable
    return self.get_component('config_store').get_config_variable(
  File "/home/runner/.local/lib/python3.10/site-packages/botocore/configprovider.py", line 465, in get_config_variable
    return provider.provide()
  File "/home/runner/.local/lib/python3.10/site-packages/botocore/configprovider.py", line 671, in provide
    value = provider.provide()
  File "/home/runner/.local/lib/python3.10/site-packages/botocore/configprovider.py", line 761, in provide
    scoped_config = self._session.get_scoped_config()
  File "/home/runner/.local/lib/python3.10/site-packages/botocore/session.py", line 422, in get_scoped_config
    raise ProfileNotFound(profile=profile_name)
botocore.exceptions.ProfileNotFound: The config profile (False) could not be found

my rpdk config is:

{
    "artifact_type": "HOOK",
    "typeName": "myCompany::CloudFormation::Guard",
    "language": "java",
    "runtime": "java17",
    "entrypoint": "com.myCompany.cloudformation.guard.HookHandlerWrapper::handleRequest",
    "testEntrypoint": "com.myCompany.cloudformation.guard.HookHandlerWrapper::testEntrypoint",
    "settings": {
        "version": false,
        "subparser_name": null,
        "verbose": 0,
        "force": false,
        "type_name": null,
        "artifact_type": null,
        "endpoint_url": null,
        "region": null,
        "target_schemas": [],
        "profile": "default",
        "namespace": [
            "com",
            "myCompany",
            "cloudformation",
            "guard"
        ],
        "codegen_template_path": "default",
        "protocolVersion": "2.0.0"
    },
    "executableEntrypoint": "com.myCompany.cloudformation.guard.HookHandlerWrapperExecutable"
}

I have profile set to default and I set AWS_PROFRILE to default in my deploy script. What Profile is it looking for?

Vorherrschende Sprache
Python
Sterne
336
Forks
173
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus aws-cloudformation/cloudformation-cli

Alle Issues in aws-cloudformation/cloudformation-cli

Ähnliche Issues

Weitere Issues zu Python

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.