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

Parsing error #186

Open
oresch opened this issue Apr 1, 2022 · 14 comments
Open

Parsing error #186

oresch opened this issue Apr 1, 2022 · 14 comments

Comments

@oresch
Copy link

oresch commented Apr 1, 2022

Today I updated the local repo with your commits and startet again MM. The system was running before without any issues.

Unfortunatelly the calendar doesn't come up:
[CALEXT2] calendar:VWXYZ>> invalid line (no token ";" or ":") "<?xml version="1.0" encoding="utf-8"?>

Was there an update on a parser? Do I need to update somewhere the current config to make it running again?

@klaernie
Copy link
Contributor

klaernie commented Apr 1, 2022

I'd guess your calendar URL started responding with the wrong content - can you try your calendar URL in a browser or curl/wget, and take a look if it's a valid iCalendar feed?

@oresch
Copy link
Author

oresch commented Apr 1, 2022

No, URL is working perfectly (tested with Browser and Thunderbird). I'm querying Nextcloud all the time. It was working as before, but after the git pull this morning it stopped.
Here an extract of the config.js

                    module: "MMM-CalendarExt2",
                      config: {
                          locale: "de-DE",
                          updateInterval: 1000 * 60 * 10,
                        calendars : [
                            {
                              name: "meinName",
                              auth: {
                                    method: "basic",
                                    user: "<user",
                                    pass: "<pwd>",
                              },
                              url: "https://my.server.de/remote.php/dav/calendars/<user>/personal/?export",
                              icon: "noto-man-farmer-medium-skin-tone",
                            },
         [....]

@oresch
Copy link
Author

oresch commented Apr 1, 2022

I just deleted the module and did a new git clone etc.. Error remains.
Any hints, how debug this?

@klaernie
Copy link
Contributor

klaernie commented Apr 1, 2022

Can you still tell from which commit sha you came and which one you tested?
I'm sure you did this, but just to be sure: did you run npm install?
You might also try reverting a81cf67, which did a patch upgrade of node-fetch, but the change on their end doesn't look like it could cause issues like this.

Maybe try commenting in https://github.com/MMM-CalendarExt2/MMM-CalendarExt2/blob/main/node_helper.js#L91 and take a look if the XML document you get has maybe a text section describing what went wrong.

@oresch
Copy link
Author

oresch commented Apr 6, 2022

Hi - sorry for the longer delay.
Today I pulled again and installed the newest version, but still the same issue:

cd MagicMirror/modules/MMM-CalendarExt2/ && git pull && npm install && cd && pm2 restart mm.sh

The log ist than still showing the same errors:

0|mm       | [06.04.2022 19:18.19.849] [LOG]   Connecting socket for: MMM-CalendarExt2
0|mm       | [06.04.2022 19:18.19.850] [LOG]   Sockets connected & modules started ...
0|mm       | [06.04.2022 19:18.20.182] [LOG]   Launching application.
0|mm       | [06.04.2022 19:18.22.553] [INFO]  Checking git for module: MMM-MoonPhase
0|mm       | [06.04.2022 19:18.22.601] [LOG]   [CALEXT2] calendar:name1>> Scanning start with interval:1800000
0|mm       | [06.04.2022 19:18.22.609] [LOG]   [CALEXT2] calendar:name2>> Scanning start with interval:1800000
0|mm       | [06.04.2022 19:18.22.612] [LOG]   [CALEXT2] calendar:name3>> Scanning start with interval:1800000
....
0|mm  | [06.04.2022 19:18.50.821] [LOG
0|mm  | [CALEXT2] calendar:name1>> invalid line (no token ";" or ":") "<?xml version="1.0" encoding="utf-8"?>"
0|mm  | [06.04.2022 19:18.52.169] [LOG]
0|mm  | [CALEXT2] calendar:name2>> invalid line (no token ";" or ":") "<?xml version="1.0" encoding="utf-8"?>"
0|mm  | [06.04.2022 19:18.52.336] [LOG]
0|mm  | [CALEXT2] calendar:name3>> invalid line (no token ";" or ":") "<?xml version="1.0" encoding="utf-8"?>"
0|mm  | [06.04.2022 19:18.52.653] [LOG]
0|mm  | [CALEXT2] calendar:name4>> invalid line (no token ";" or ":") "<?xml version="1.0" encoding="utf-8"?>"
0|mm  | [06.04.2022 19:18.52.721] [LOG]
0|mm  | [CALEXT2] calendar:name5>> invalid line (no token ";" or ":") "<?xml version="1.0" encoding="utf-8"?>"
[...]

Info:

$ lsb_release -a
No LSB modules are available.
Distributor ID: Raspbian
Description:    Raspbian GNU/Linux 10 (buster)
Release:        10
Codename:       buster

$ uname -a
Linux mirror 5.10.103-v7l+ #1529 SMP Tue Mar 8 12:24:00 GMT 2022 armv7l GNU/Linux

On a RaspPI

@klaernie
Copy link
Contributor

klaernie commented Apr 7, 2022

Could you please try the things I suggested in my last comment?

@oresch
Copy link
Author

oresch commented Apr 7, 2022

git revert a81cf67 done, npm install executed. No success. Errors remain.

@klaernie
Copy link
Contributor

klaernie commented Apr 7, 2022

Hm, than it definitely was not a81cf67.

What does activating the Log.log() statement in https://github.com/MMM-CalendarExt2/MMM-CalendarExt2/blob/main/node_helper.js#L91 write to the log? I'd be really interested to see the content of the XML being returned - I'd guess there will be some hint in it.

@oresch
Copy link
Author

oresch commented Apr 7, 2022

Found it. My pwd is outdated :-/ It was not visible and while testing in browser it was ok. Strange.

So problem solved and sorry for the "stress". Maybe a hint in the log about some issues while fetching the data from the server would help troubleshooting?

@klaernie
Copy link
Contributor

klaernie commented Apr 7, 2022

That's a good one - I get how the browser testing was okay, since you probably used that very browser to change the password.

The "hint in the log" is exactly that - if the server does not clearly tell that there is an authorization problem - which I guess it didn't since it instead responded with an XML page - the parsing error is the only thing left. If there would have been a proper 403 error it should have been caught in https://github.com/MMM-CalendarExt2/MMM-CalendarExt2/blob/main/node_helper.js#L98-L103

Could you please try the request with curl -v with an incorrect password, and paste it here after anonymizing the URL and Authorization: header, so I can take a look on how we could improve this for the future?

@oresch
Copy link
Author

oresch commented Apr 7, 2022

I forgot to post the MMM-log output:

[07.04.2022 08:13.09.004] [LOG]   [CALEXT2] calendar:name >> invalid line (no token ";" or ":") "<?xml version="1.0" encoding="utf-8"?>"
[07.04.2022 08:13.09.695] [LOG]   <?xml version="1.0" encoding="utf-8"?>
<d:error xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns">
  <s:exception>Sabre\DAV\Exception\NotAuthenticated</s:exception>
  <s:message>No public access to this resource., Username or password was incorrect, No 'Authorization: Bearer' header found. Either the client didn't send one, or the server is mis-configured, Username or password was incorrect</s:message>
</d:error>

which is than also what you see in curl:

< strict-transport-security: max-age=31536000; preload
* Authentication problem. Ignoring this.
< www-authenticate: Basic realm="Nextcloud", charset="UTF-8"
< x-content-type-options: nosniff
< x-download-options: noopen
<
< x-frame-options: SAMEORIGIN
< x-permitted-cross-domain-policies: none
< x-robots-tag: none
< x-xss-protection: 1; mode=block
< content-length: 415
<?xml version="1.0" encoding="utf-8"?>
<d:error xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns">
  <s:exception>Sabre\DAV\Exception\NotAuthenticated</s:exception>
  <s:message>No public access to this resource., Username or password was incorrect, No 'Authorization: Bearer' header found. Either the client didn't send one, or the server is mis-configured, Username or password was incorrect</s:message>
</d:error>

@klaernie
Copy link
Contributor

klaernie commented Apr 7, 2022

Your curl output cuts of the HTTP status header, which would be the biggest clue. Could you copy the rest in?

@oresch
Copy link
Author

oresch commented Apr 7, 2022

it's 401:

> GET /remote.php/dav/calendars/name/personal/?export HTTP/2
> Host: my.server.de
> Authorization: Basic ****
> User-Agent: curl/7.64.0
> Accept: */*
>
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* Connection state changed (MAX_CONCURRENT_STREAMS == 250)!
< HTTP/2 401
< cache-control: no-store, no-cache, must-revalidate
< content-security-policy: default-src 'none';
< content-type: application/xml; charset=utf-8
< date: Thu, 07 Apr 2022 06:42:06 GMT
< expires: Thu, 19 Nov 1981 08:52:00 GMT
< pragma: no-cache

@klaernie
Copy link
Contributor

klaernie commented Apr 7, 2022

Okay, that's definitely something we should be able to catch

@oresch oresch closed this as completed May 11, 2022
@klaernie klaernie reopened this May 11, 2022
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

2 participants