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

MastodonVersionError: Version check failed (Need version 3.4.0) #340

Open
carolmb opened this issue May 1, 2023 · 3 comments
Open

MastodonVersionError: Version check failed (Need version 3.4.0) #340

carolmb opened this issue May 1, 2023 · 3 comments

Comments

@carolmb
Copy link

carolmb commented May 1, 2023

Hello. I've been using the API these days, but since yesterday the following error is occurring and I can't find any record of it.

---> 17 user_profile = api1.account_lookup("{}@{}".format(user_name, user_server))

File d:\Documentos\yy-projects\mastodon-proj.venv\Lib\site-packages\decorator.py:232, in decorate..fun(*args, **kw)
230 if not kwsyntax:
231 args, kw = fix(args, kw, sig)
--> 232 return caller(func, *(extras + args), **kw)

File d:\Documentos\yy-projects\mastodon-proj.venv\Lib\site-packages\mastodon\utility.py:44, in api_version..api_min_version_decorator..wrapper(function, self, *args, **kwargs)
42 major, minor, patch = parse_version_string(version)
43 if major > self.mastodon_major:
---> 44 raise MastodonVersionError(f"Version check failed (Need version {version})")
45 elif major == self.mastodon_major and minor > self.mastodon_minor:
46 raise MastodonVersionError(f"Version check failed (Need version {version})")

MastodonVersionError: Version check failed (Need version 3.4.0)

Since I'm not familiar with where exactly I should ask about this kind of stuff if there is a better place, let me know. I can delete this one and repost where it is more suitable.

Thank you in advance.

More information:
I'm using python (3.11.3) and mastodon.py (1.8.1).

I also asked the same here. I'm not sure if it is a problem from mastodon.py or server side.

@andypiper
Copy link
Contributor

What specific Mastodon instance (server URL) is this happening with? Did it previously work with that instance, or has it never worked with that instance? Has anything changed on your system since the last time the code worked for you?

@carolmb
Copy link
Author

carolmb commented May 2, 2023

When I used the instance for the first time, I was setting the values directly on the code, so it worked with no problems. When I refactored the code then the errors appeared.

I discovered what was wrong but the message error did not help (the one I related previously).

About my mistakes:

I tried two different approaches to initialize a Mastodon object, both were incorrect.

The first problem was how I was reading the file with the cliend_id, cliend_secret, access_token, and api_base_url strings.
Once I removed the unnecessary "\n" at the end of the args, it worked well.

The other problem was about giving a filename as an argument to Mastodon init
I was trying to use as follows:

api = Mastodon(client_id='filename-with-id-secret-token-url.txt')

based on its documentation "If a file is given as client_id, client ID, secret and base url are read from that file."
Do you know how this argument should be used to work correctly?

In both cases, the error only occurred when I was trying to use the object, for instance, calling api.account_lookup.

@carolmb carolmb closed this as completed May 2, 2023
@halcy
Copy link
Owner

halcy commented May 2, 2023

Let me actually reopen this - I've noticed myself that the error message can be very misleading, and should be fixed in some way.

@halcy halcy reopened this May 2, 2023
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