0

I am trying to use the meetupr package from this repository: https://github.com/rladies/meetupr. According to the ReadMe, a token is created the first time when running a meetupr function. In my case the Meetup server had problems at the time when I used the package, which is why I could not log in and generate the token. Now, when trying to run meetupr I get the error

Cannot read token from alleged .rds file:
~/.local/share/meetupr/meetupr-token.rds

The file mentioned in this error message is empty.

This error arises for example when I run:

library(meetupr)
find_groups(text = "book")

OS: Ubuntu 20.04

R: version 4.1.2

Browser: Firefox 94.0

I already tried to remove.packages("meetupr") and install.packages("meetupr") again, but that didn't help.

How do I re-run the authentification function to create a token in this file?

  • So judging from that path construction you're probably on a Mac or Linux but other than that we cannot tell much about your setup. The Github text says files are supposed to be stored at the result of `rappdirs::user_data_dir("meetupr", "meetupr")`. You need to show your setup information and the full console output of your code and results. – IRTFM Dec 08 '21 at 23:11
  • I added information on my operating system and R version. The full output is the one I have indicated in the initial posting. `rappdirs::user_data_dir("meetupr", "meetupr")` just yields the location of the directory where the package is saved, that is `~/.local/share/meetupr/`. – LololoTheGreat Dec 08 '21 at 23:27

2 Answers2

1

Deleting the .rds file located in the folder that is returned by the following command should help:

rappdirs::user_data_dir("meetupr", "meetupr")

If you don’t tweak anything, the first time you run a meetupr function, you’ll be prompted to go into your browser and a token will be created. It will be saved to disk in an app directory as determined by rappdirs::user_data_dir("meetupr", "meetupr")

(Source: meetupr README)

So I think what happened is that while the authentication was not successful, the file was still created but without a valid token inside. meetupr thinks that if you have the file, you have a valid token. Deleting the file should re-trigger the oauth flow.

friep
  • 321
  • 1
  • 8
0

You have not described with any detail what all of your actions have been and what your system applications have been telling you. I offer an example of what you might have offered. Obviously you woulld not be post the same, but this should give you an example of what a more complete description of the full process might look like:


I am unable to reproduce this error running R 4.0.4 on Ubuntu 18.04 with Chrome as my default browser; After installing the package per its github page and running that code, I first see this message ...enter image description here

... and after clicking allow, a new page pops up ...

enter image description here

And after closing that page per instructions I see this at the console:

> find_groups(text = "book")
Adding ~/.local/share/meetupr/meetupr-token.rds to .gitignore
Waiting for authentication in browser...
Press Esc/Ctrl + C to abort
Authentication complete.
Downloading 16722 record(s)...
Error in curl::curl_fetch_memory(url, handle = handle) : 
  Operation was aborted by an application callback

I got tired of waiting for that many records to download and hit escape, and ran:

`meetupr-token` <- readRDS("/home/david/.local/share/meetupr/meetupr-token.rds")
`meetupr-token`
$`3a1a-munged--7b8e764968950`
<Token>
<oauth_endpoint>
 authorize: https://secure.meetup.com/oauth2/authorize
 access:    https://secure.meetup.com/oauth2/access
<oauth_app> meetup
  key:    2vag-munged-b32tca763m1
  secret: <hidden>
<credentials> access_token, refresh_token, token_type, expires_in
---

So the file is not empty. I then re-ran a call to the find_groups function using a less broad search term, and get (without any popup browser page):

find_groups(text = "Tai chi")
Downloading 863 record(s)...
# A tibble: 863 × 21
       id name  urlname status   lat     lon city  state country created            
    <int> <chr> <chr>   <chr>  <dbl>   <dbl> <chr> <chr> <chr>   <dttm>             
 1 3.08e7 Beac… Beachs… active  35.2  -83.4  Fran… "NC"  USA     2018-12-24 04:28:57
 2 3.17e7 Tai … Tai-Ch… active  26.2  -80.3  Fort… "FL"  USA     2019-04-25 16:10:30
 3 3.46e7 The … the-ta… active  33.2 -117.   Ocea… "CA"  USA     2021-01-01 01:10:51
 4 8.42e5 The … sifu-t… active  40.9  -73.8  Bron… "NY"  USA     2007-11-26 02:16:11
 5 2.68e7 Yang… Yangsh… active  51.8   -0.83 Ayle… "B9"  United… 2017-12-07 09:00:56
 6 3.40e7 Drag… Dragon… active  41.6  -72.8  Berl… "CT"  USA     2020-08-02 11:18:44
 7 2.68e7 Tai … Tai-Ch… active -33.9   18.5  Cape… ""    South … 2017-12-08 23:39:01
 8 2.39e7 The … The-Sc… active  50.8   -0.15 Brig… "P6"  United… 2017-05-21 14:02:24
 9 2.26e7 Auck… Auckla… active -36.8  175.   Auck… ""    New Ze… 2017-02-26 01:06:20
10 1.87e7 Tai … Larkers active  45.0  -93.2  Minn… "MN"  USA     2015-06-26 16:27:37
# … with 853 more rows, and 11 more variables: members <int>, timezone <chr>,
#   join_mode <chr>, visibility <chr>, who <chr>, location <chr>,
#   organizer_id <int>, organizer_name <chr>, category_id <int>,
#   category_name <chr>, resource <list>
IRTFM
  • 258,963
  • 21
  • 364
  • 487
  • I installed and ran the package the first time some days ago and cannot reproduce what exactly happened. I remember that I was redirected to my browser, but the Meetup server was down (or at least log-in didn't work). When I now try again to use the package, I get the error. I don't know which other significant information I can provide to you in my post. I just want to know how to run the authentication function again, for example by setting back the package or otherwise. I tried removing and reinstalling the package, but that didn't help. – LololoTheGreat Dec 09 '21 at 07:42
  • If that had happened to me I would have deleted the rds file and the directory and tried again. – IRTFM Dec 09 '21 at 15:49