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

Error when deployed on shinyapps.io #134

Open
velkokamenov opened this issue Dec 27, 2018 · 3 comments
Open

Error when deployed on shinyapps.io #134

velkokamenov opened this issue Dec 27, 2018 · 3 comments

Comments

@velkokamenov
Copy link

Hi guys,

Thanks for the great package, I've been using it for the last couple of months.

I have developed a shiny application leveraging on data from eurostat pulled in R with the eurostat package. Locally everything runs perfectly and with no errors (for versions 3.3.1 as well as 3.1.5 of the eurostat package and version 3.3 of R).

However, when deployed on shinyapps,io I got the following error on my logs:

Warning in open.connection(con, "rb") :
"internal" method cannot handle https redirection to: 'https://ec.europa.eu/eurostat/estat-navtree-portlet-prod/BulkDownloadListing?sort=1&downfile=table_of_contents_en.txt'
Stack trace (innermost first):
Warning: Error in open.connection: cannot open the connection

And the application cannot be run.

The two functions I am using from the package are get_eurostat() and label_eurostat().

Any ideas why the problem within shinyapps.io framework exists?

I have deployed an older version of the same application in March 2018 and back then everything worked with no errors so I guess it is related in some way to changes in Eurostat API since then which are not addressed by shinyapps.io capabilities.

I would appreciate any ideas about possible workarounds.

Best Regards,

Velko

@jhuovari
Copy link

I think it could be that your application is trying to get a data with wrong data id. With right id, there shouldn't be any redirections to that address.

@velkokamenov
Copy link
Author

I don't believe the reason to be a wrong id since locally I do manage to get all the tables with data using the get_eurostat() function.

Anyway I managed to find a working solution for the moment which I hope may prove helpful for others struggling with the same problem in the future.

The problem with my application was lying somewhere in the label_eurostat() function or in its internal get_eurostat_dic() I cannot be 100% sure where exactly since I can't reproduce the error on my machine locally and it was only present after deploying the app on shinyapps.io.

So what solved my problem was that I downloaded manually all the eurostat dictionaries from the following link : https://ec.europa.eu/eurostat/estat-navtree-portlet-prod/BulkDownloadListing?sort=1&dir=dic

After that I created my own version of the label_eurostat() function using some of the .dic files downloaded locally from the presented link.

Hence I excluded label_eurostat() from my code and alternatively used the newly created function utilizing the locally available .dic files to map the geo and unit columns with their respective full meanings.

After these steps I was able to successfully deploy the application on shinyapps.io.

I would share the full project codes and files in a separate github repository soon.

@antagomir
Copy link
Member

Is this is something that could be realistically solved in the package itself? Otherwise, if there was a clear description we could add it in the tutorial to help others.

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

3 participants