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

[BUG]: Server code: 503; Server is possibly experiencing traffic, trying again... #581

Closed
Kiven668 opened this issue Jan 3, 2025 · 7 comments
Labels

Comments

@Kiven668
Copy link

Kiven668 commented Jan 3, 2025

when I execute below codes, it returns 503. it worked a few days before. could you help on this? thank you.

id_exposure <- c("ieu-b-4846", "ieu-b-4850", "met-d-ApoB", "met-d-Total_C", "ukb-a-290" )
library(TwoSampleMR)
options(ieugwasr_api = 'gwas-api.mrcieu.ac.uk/')
#options(ieugwasr_api = 'https://api.opengwas.io/api')
exposure_dat <- mv_extract_exposures(id_exposure,
                                       opengwas_jwt = "<my jwt>")  
@Kiven668 Kiven668 added the bug label Jan 3, 2025
@JasonQiu
Copy link

JasonQiu commented Jan 3, 2025

Please remove both options() lines, save the code, restart session and try again.

options() can be used to toggle the API base URL, however it should not be used by end users unless instructed by the docs or a member of our team. If you are using the latest versions of TwoSampleMR and ieugwasr then https://api.opengwas.io/api will be the default value and there is no need to set/alter that.

We understand there are comments posted somewhere during the transitional period, suggesting that altering the base URL to gwas-api.mrcieu.ac.uk (the old service) could be helpful. In fact that will not work anymore because it is being decommissioned now and we are only able to provide support to those who are using api.opengwas.io/api (the new service).

Users may argue that gwas-api.mrcieu.ac.uk still works intermittently, however we would like to emphasise that it is not maintained anymore.

@JasonQiu JasonQiu closed this as completed Jan 3, 2025
@JasonQiu JasonQiu pinned this issue Jan 3, 2025
@Kiven668
Copy link
Author

Kiven668 commented Jan 3, 2025

@JasonQiu thank you for your quick response. I removed both options but it returned another error. I remember I resolve this issue by add the option before. could you help on this?
Error in if (nrow(d) == 0) return(NULL) : argument is of length zero

@JasonQiu
Copy link

JasonQiu commented Jan 3, 2025

@JasonQiu thank you for your quick response. I removed both options but it returned another error. I remember I resolve this issue by add the option before. could you help on this? Error in if (nrow(d) == 0) return(NULL) : argument is of length zero

@Kiven668 Please provide full, minimal and reproducible example (code and data). Assume I have installed the latest versions of TwoSampleMR and ieugwasr but know nothing about your work, please help me reproduce the error.

@Kiven668
Copy link
Author

Kiven668 commented Jan 3, 2025

@JasonQiu the code is as below.

id_exposure <- c("ieu-b-4846", "ieu-b-4850", "met-d-ApoB", "met-d-Total_C", "ukb-a-290" )
library(TwoSampleMR)
exposure_dat <- mv_extract_exposures(id_exposure,
                                       opengwas_jwt = "<my jwt>")  

@JasonQiu
Copy link

JasonQiu commented Jan 3, 2025

Follow the steps exactly as shown here (in step 6, if user() is not working, try ieugwasr::user()):
https://mrcieu.github.io/ieugwasr/articles/guide.html#authentication

In your code, remove the opengwas_jwt parameter from mv_extract_exposures() and all other similar functions. This parameter is not required if you have followed the instructions above carefully and set up OPENGWAS_JWT in .Renviron. https://mrcieu.github.io/TwoSampleMR/reference/mv_extract_exposures.html#arg-opengwas-jwt

@Kiven668
Copy link
Author

Kiven668 commented Jan 4, 2025

@JasonQiu where is the .Renviron file? shall I create it somewhere?

@MRCIEU MRCIEU locked and limited conversation to collaborators Jan 4, 2025
@remlapmot
Copy link
Contributor

The .Renviron file is just a text file you create in either your home directory or the working directory of your project. Most people have one in their home directory.

The easiest way to create one from inside R is to use the function in the usethis package as follows

install.packages("usethis")
usethis::edit_r_environ()

After you have saved the edits to the file (i.e., included your token on a line with OPENGWAS_JWT=) you then need to close and restart R/RStudio.

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

No branches or pull requests

3 participants