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 starting with matrix-connector #1159
Comments
The config looks fine to me, I am little confused as to how this:
is being triggered off this regex? |
I forgot to mention that I'm using the docker image |
@Cadair yeah it's that regex. I've seen something similar when indentation has been off. There aren't any other options missing in the config are there? |
Could this be some issue with the yamale check? I remember the issue I had with Telegram(#1055) the messages seems somewhat similar to what I was getting 🤔 --EDIT-- --EDIT 2-- I check the schema.yaml and it seems that my suspicion was correct, the issue was some of the options that was passed to the configuration file. You can see on line 71 and line 75 that the regex expects the string to end with I believe the regex for rooms-main should be changed as well otherwise it will always fail if someone self-hosts matrix. @awesome-michael were you running matrix on your own server? If that's the case then I am going to say that I'm 100% sure the issue is here 🤔 |
Yes I'm trying to connect to my own homeserver. In fact I'm trying to connect to pantalaimon that should connect to my own homeserver as suggested in #992 ;) I'll check if editing the regex will help with this issue. |
Please let us know but I think it will be one of these fields (if not all of then) that are causing the issues. For what I've gathered they assume you are using matrix.org only. Please feel free to raise a PR fixing the issue if you wish otherwise i'll try to tackle it when I got the time once it has been confirmed 😄 👍 |
🙈 Why?! 😱 |
Looks like this has been busted since the introduction of these schemas: #1003 I think we probably shouldn't be validating any of those fields anywhere near as strongly as that, I am nervous about validating them at all beyond type really. |
Ok let's roll the validation back a bit. I'm also not very impressed with the error handling in yamale. It seems to just blast a ton of errors at you |
Perhaps the contributor didn't knew the matrix connector could connect to own servers 🤔 Instead of reverting the validation PR how about we fix the schema? I'm with Cadair about validating the yaml beyond type - it makes sense on the required things but doesn't on other situations like this one. Yamale allows you to just specify type like this:
We could check if some things are strings, lists, dicts, etc. You can also write custom validators but I'm not sure if it will be used much atm. I also agree that the error handling in yamale is pretty bad since it just regurgitates the errors at you and you need to cross check with the schema what is expected. (unless this is an issue with the regex validator) |
Yeah I didn't mean revert the PR. I meant relax the rules. |
Oh sorry misunderstood the comment! I did a quick look at yaml validators and Cerberus seems like a good way to get error handling 🤔 What do you think? Cerberus Usage |
Would that be a replacement for yamale? |
If we want better error handling we might have to replace it yeah, not sure how it compares with yamale yet though |
okay I verified that the regex checks are responsible for the error. I changed the scheme.yaml to
(the rooms were checked to end with and altered my config to
I had to provide all the |
If you are participating on the hacktoberfest you can just change the schema for what you have show shown on your comment that seems a good temporary fix until we decide what to do next. If not or you don’t have time I will open a PR to fix the issue tomorrow 😄👍 anyway thank you for raising the issue and helping us with this! |
Since hacktoberfest seems to be perfect occasion for this (would be my first PR) I begun to write a fix. Now I think I have an explanation for all the |
That’s a good question, I don’t understand why yamale decided to just go add the required if you specify a type, this is pretty weird... It’s a pain in the back but perhaps turn all of those that are not required to False? |
Was my first thought too.. but I think these values are checked with |
I read a bit through the documentation of yamale..
and
so the schema.yaml you built can not check for the individual connectors but checks always everything. Thats the reason it complains about the required fields so much. |
Okay.. yamale seems not to see all the fields as required, but when an error occurs all these fields are shown as "missing required fields". If the config is fine the fields aren't reported. So it's "just" the error handling that is misleading. I opened a PR to address the actual issue: #1166 |
When I try to start opsdroid I keep getting the following error. I double checked indentation and when I delete the matrix-connector part opsdroid starts fine.
Configuration File
The text was updated successfully, but these errors were encountered: