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

Google / Amazon menus not visible, S3 access not working #1607

Open
francois-a opened this issue Oct 23, 2024 · 15 comments
Open

Google / Amazon menus not visible, S3 access not working #1607

francois-a opened this issue Oct 23, 2024 · 15 comments
Milestone

Comments

@francois-a
Copy link

Hi,

I'm having trouble accessing BAMs on s3, with both the Mac desktop and web apps. On the desktop app, the Google and Amazon menu aren't visible (I tested multiple versions, including 2.18.4). The credentials in ~/.aws/credentials work, and I can access the BAMs using samtools for example.

When I try to load a BAM with the desktop app, I get the following error

Error loading s3://redacted/redacted.bam: Unable to load credentials from any of the providers in the chain AwsCredentialsProviderChain(credentialsProviders=[SystemPropertyCredentialsProvider(), EnvironmentVariableCredentialsProvider(), WebIdentityTokenCredentialsProvider(), ProfileCredentialsProvider(profileName=default, profileFile=ProfileFile(sections=[])), ContainerCredentialsProvider(), InstanceProfileCredentialsProvider()]) : [SystemPropertyCredentialsProvider(): Unable to load credentials from system settings. Access key must be specified either via environment variable (AWS_ACCESS_KEY_ID) or system property (aws.accessKeyId)., EnvironmentVariableCredentialsProvider(): Unable to load credentials from system settings. Access key must be specified either via environment variable (AWS_ACCESS_KEY_ID) or system property (aws.accessKeyId)., WebIdentityTokenCredentialsProvider(): Either the environment variable AWS_WEB_IDENTITY_TOKEN_FILE or the javaproperty aws.webIdentityTokenFile must be set., ProfileCredentialsProvider(profileName=default, profileFile=ProfileFile(sections=[])): Profile file contained no credentials for profile 'default': ProfileFile(sections=[]), ContainerCredentialsProvider(): Cannot fetch credentials from container - neither AWS_CONTAINER_CREDENTIALS_FULL_URI or AWS_CONTAINER_CREDENTIALS_RELATIVE_URI environment variables are set., InstanceProfileCredentialsProvider(): Failed to load credentials from IMDS.]
@jrobinso
Copy link
Contributor

jrobinso commented Oct 23, 2024

This is a known issue introduced in release 2.18.2. We have a fix but its not been released. In the interim you can either (1) use 2.18.1, or (2) use the development snapshot build. You can download 2.18.1 from the archive

https://data.broadinstitute.org/igv/projects/downloads/2.18/

The development snapshot is available at

https://igv.org/doc/desktop/#DownloadSnapshot/

Note the special instructions if you are on a Mac

The webapp does not support S3 credentials, a web application has no access to your disk, including of course ~/.aws

@jrobinso jrobinso added this to the 2.19.0 milestone Oct 23, 2024
@jrobinso
Copy link
Contributor

Duplicate of #1598

@jrobinso jrobinso marked this as a duplicate of #1598 Oct 23, 2024
@francois-a
Copy link
Author

Thanks — it doesn't work for me with 2.18.1 either (menus not visible, and loading from an S3 URL gives the error above).

@jrobinso
Copy link
Contributor

The fact that the Amazon menu does not appear implies that IGV could not read the credentials file. It relies on the AWS SDK to do this, which looks in various places including, on my Mac, in ~/.aws/credentials. Could you look in the IGV log file, located in the "igv" folder in your home directory, and see if there are any errors? The file name is usually igv0.log.

The Google menu does not appear by default, you have to enable it in the preferences.

@francois-a
Copy link
Author

Here's the error from the log:

SEVERE [Oct 24,2024 12:11] [IGV] org.broad.igv.exceptions.DataLoadException: Unable to load credentials from any of the providers in the chain AwsCredentialsProviderChain(credentialsProviders=[SystemPropertyCredentialsProvider(), EnvironmentVariableCredentialsProvider(), WebIdentityTokenCredentialsProvider(), ProfileCredentialsProvider(profileName=default, profileFile=ProfileFile(profiles=[Profile(name=default, properties=[sso_session, sso_region, aws_access_key_id, aws_session_token, sso_registration_scopes, aws_secret_access_key, sso_role_name, region, sso_start_url, sso_account_id])])), ContainerCredentialsProvider(), InstanceProfileCredentialsProvider()]) : [SystemPropertyCredentialsProvider(): Unable to load credentials from system settings. Access key must be specified either via environment variable (AWS_ACCESS_KEY_ID) or system property (aws.accessKeyId)., EnvironmentVariableCredentialsProvider(): Unable to load credentials from system settings. Access key must be specified either via environment variable (AWS_ACCESS_KEY_ID) or system property (aws.accessKeyId)., WebIdentityTokenCredentialsProvider(): Either the environment variable AWS_WEB_IDENTITY_TOKEN_FILE or the javaproperty aws.webIdentityTokenFile must be set., ProfileCredentialsProvider(profileName=default, profileFile=ProfileFile(profiles=[Profile(name=default, properties=[sso_session, sso_region, aws_access_key_id, aws_session_token, sso_registration_scopes, aws_secret_access_key, sso_role_name, region, sso_start_url, sso_account_id])])): java.nio.file.NoSuchFileException: /Users/francois/.aws/sso/cache/8e7c27591e6cf06e4cdb68a0e6a19fda88924b14.json, ContainerCredentialsProvider(): Cannot fetch credentials from container - neither AWS_CONTAINER_CREDENTIALS_FULL_URI or AWS_CONTAINER_CREDENTIALS_RELATIVE_URI environment variables are set., InstanceProfileCredentialsProvider(): Unable to load credentials from service endpoint.]

I'm using sso, and have both ~/.aws/config and ~/.aws/credentials.

@jrobinso
Copy link
Contributor

This might be the cause, but I am not enough of an AWS expert to know what to do about it. However it is a clue

Either the environment variable AWS_WEB_IDENTITY_TOKEN_FILE or the javaproperty aws.webIdentityTokenFile must be set.

Do you have an oauth provisioning profile set (in the IGV preferences)? You should not, if using ~/.aws/credentials.

@jrobinso
Copy link
Contributor

Actually I don't think the AWS_WEB_IDENTITY_TOKEN_FILE is the real issue here, it shouldn't even get that far if it successfully read ~/.aws/credentials for the access key. It would read this on startup.

@jrobinso
Copy link
Contributor

jrobinso commented Oct 24, 2024

Apologies for the train of messages, I am far from an AWS expert, but you might be using an Amazon option (SSO) that IGV does not support. The authentication options are repeated below from the IGV readme, (1) setting access key and secret in ~/.aws/credentials, and (2) configuring Cognito as described in the link.

Authenticated access using s3:// urls is supported by either (1) enabling OAuth access with Cognito using the UMCCR contributed AWS configuration option, or (2) setting AWS credentials and region information as described here and here.

For more details on using Cognito for OAuth access, see the UMCCR documentation on the backend and frontend for a provisioning URL step by step guide.

@jrobinso
Copy link
Contributor

These instructions might be relevant

https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/setup.html

@francois-a
Copy link
Author

If ~/.aws/credentials is available, is anything else needed? This is also what I'm using to view the same BAMs with samtools, which hasn't been an issue.

@francois-a
Copy link
Author

Figured it out — it seems like the sso information in ~/.aws/config was the problem. Simplifying it to the following worked:

[default]
region = us-east-2

@jrobinso
Copy link
Contributor

I was just about to suggest that.

From the instructions posted above, when using SSO it looks like you have to sign in from the command line with SSO before accessing with Java (IGV).

I have no idea what samtools is doing, it is probably ignoring SSO configuration altogether and just accessing .aws/credentials directly.

@jrobinso
Copy link
Contributor

Is it possible there is an error in your original .aws/config? If samtools just ignores the SSO option this would explain how it worked. The real test would be can you access the files via SSO from the command line.

@francois-a
Copy link
Author

I don't think so — CLI access worked fine. I only needed ~/.aws/credentials for samtools.

@jrobinso
Copy link
Contributor

OK, well once again instructions for using SSO with Java programs are here: https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/setup.html. This section on signing in from the CLI is especially interesting, its seems a bit strange to me but worth a try: https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/setup.html#setup-login-sso

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants