joseballester / muFunds

µFunds lets you import your asset data from Morningstar and other sources to your Google Sheets spreadsheet by using a simple formula.
https://mufunds.com
81 stars 11 forks source link

muFunds stopped working (Error Loading ....) #42

Open nicodeceulaer opened 2 years ago

nicodeceulaer commented 2 years ago

It seems the entire fetching from Morningstar has stopped working in the last week. My google sheet now shows "Error Loading ..." for all invocations of the formula muFunds()

To verify I did not accidently break something in my google sheets, I made a new copy of one of the examples from the muFunds website (https://mufunds.com/usage.html - Examples: Single mutual fund).

The same problem happens in this google sheet document as well. As an example, this formula now displays "Loading ..." forever:

=VALUE(muFunds("nav", "LU0690375182"))

So I fear Morningstar has changed their HTML format?

zulufoxtrot commented 2 years ago

I'm having the same issue. Provider: morningstar-fr

zulufoxtrot commented 2 years ago

Looks like it's working again today. I am getting wrong values though, but I'll open another issue.

aleb60 commented 2 years ago

Same here in Portugal, not working since last week. @joseballester Any help from yr side, please.

aubreyz commented 2 years ago

Not working here in UK. Great addin though so hope sorted soon

aubreyz commented 2 years ago

This works =VALUE(muFunds("nav", $F50,"morningstar-es"))

This worked before but now fails =mufunds("nav",C64,"morningstar-gb")

aubreyz commented 2 years ago

This is the error you get in functions that were working perfectly well before Screenshot_20220310-225437

aubreyz commented 2 years ago

I have found that if I change functions that previously worked like =mufunds("nav",C35,"morningstar-gb")

to just =mufunds("nav",C35,"morningstar")

They now work again. At the very least this needs documentation

nicodeceulaer commented 2 years ago

I've started a fork to investigate this problem.

I started by moving the URL's from http:// to https://, thinking this was enough. But it seems the URL just return errors once in a while. Since the entire library is caching the result, it only needs to get the data once from morningstar to keep working. Regretfully, I started rewriting more and more of the code, so this is not an easy change to take over as a single pull request. The rewrite was triggered by some error I got in the GAS IDE due to the use of the Xml package (which was deprecated some years ago by google). This triggered me to rewrite the HTML parsing to use Cheerio. That led to some other changes, including adding some extra functionality (e.g. retrieving other fields of data like AUM of a fund, ...)

Not sure how to proceed now. Due to rewrite I broke some of the countries (I only support DE,NL,BE and UK as those are the ones I typically use)

mattjgalloway commented 2 years ago

@nicodeceulaer - I didn't see your comment here, but I also did a bit of a re-write and also used Cheerio to do the parsing of the HTML. It's now been merged in PR #44.