boto / boto3

AWS SDK for Python
https://aws.amazon.com/sdk-for-python/
Apache License 2.0
9.07k stars 1.87k forks source link

Unknown service: 'glue' #3756

Closed ankitshaw1999 closed 1 year ago

ankitshaw1999 commented 1 year ago

Describe the bug

While creating the client for glue its throwing me UnknowServiceError.

crawler = boto3.client('glue', region_name = AWS_REGION_NAME, aws_access_key_id = AWS_ACCESS_KEY_ID, aws_secret_access_key = AWS_SECRET_ACCESS_KEY)

boto3 version = 1.26.155 botocore version = 1.29.155

Exact Error I am getting: Unknown service: 'glue'. Valid service names are: acm, apigateway, application-autoscaling, appstream, athena, autoscaling, batch, budgets, clouddirectory, cloudformation, cloudfront, cloudhsm, cloudsearch, cloudsearchdomain, cloudtrail, cloudwatch, codebuild, codecommit, codedeploy, codepipeline, codestar, cognito-identity, cognito-idp, cognito-sync, config, cur, datapipeline, dax, devicefarm, directconnect, discovery, dms, ds, dynamodb, dynamodbstreams, ec2, ecr, ecs, efs, elasticache, elasticbeanstalk, elastictranscoder, elb, elbv2, emr, es, events, firehose, gamelift, glacier, greengrass, health, iam, importexport, inspector, iot, iot-data, kinesis, kinesisanalytics, kms, lambda, lex-models, lex-runtime, lightsail, logs, machinelearning, marketplace-entitlement, marketplacecommerceanalytics, meteringmarketplace, mturk, opsworks, opsworkscm, organizations, pinpoint, polly, rds, redshift, rekognition, resourcegroupstaggingapi, route53, route53domains, s3, sdb, servicecatalog, ses, shield, sms, snowball, sns, sqs, ssm, stepfunctions, storagegateway, sts, support, swf, waf, waf-regional, workdocs, workspaces, xray

Expected Behavior

Client should be created with the given config.

Current Behavior

Throwing UnknownServiceName error

Reproduction Steps

create a client of boto3 for glue crawler = boto3.client('glue', region_name = AWS_REGION_NAME, aws_access_key_id = AWS_ACCESS_KEY_ID, aws_secret_access_key = AWS_SECRET_ACCESS_KEY)

Possible Solution

No response

Additional Information/Context

No response

SDK version used

1.26.155

Environment details (OS name and version, etc.)

MAC

tim-finnigan commented 1 year ago

Hi @ankitshaw1999 thanks for reaching out. The glue service has been available for many years and should definitely be accessible in recent versions of boto3.

You can print your boto3/botocore versions to make sure you are using a recent one. I just tested this with boto3 1.26.155 / botocore 1.29.155 and can confirm it is working:

import boto3
import botocore

print(boto3.__version__)
print(botocore.__version__)

client = boto3.client('glue')

response = client.list_crawlers()
print(response)

You could also view the debug logs by adding boto3.set_stream_logger('') to your script to see which versions are being used.