AussieDaveF
Posts: 21
Joined: Tue Jun 26, 2018 11:36 am

rPi crashing the system

Sun Dec 22, 2019 8:11 am

/var/log/syslog tail gives me the following, with the 362 lines appearing a lot before the system crashes and appears to restart. The system has the latest updates.
I'm new to raspbian, so I'm happy to chase any diagnosis paths you suggest.

Code: Select all

Dec 22 13:17:32 rPi168 rc.local[362]: }Failed getting oauth client: Failed to exchange auth code for token: oauth2: cannot fetch token: 400 Bad Request
Dec 22 13:17:32 rPi168 rc.local[362]: Response: {
Dec 22 13:17:32 rPi168 rc.local[362]:   "error": "invalid_request",
Dec 22 13:17:32 rPi168 rc.local[362]:   "error_description": "Missing required parameter: code"
Dec 22 13:27:53 rPi168 systemd[1]: Time has been changed
Dec 22 13:27:53 rPi168 systemd[486]: Time has been changed
Dec 22 13:27:53 rPi168 systemd-timesyncd[248]: Synchronized to time server 139.99.222.72:123 (2.debian.pool.ntp.org).
Dec 22 13:27:53 rPi168 systemd[1]: apt-daily.timer: Adding 6h 47min 19.997838s random time.
Dec 22 13:27:53 rPi168 systemd[1]: apt-daily-upgrade.timer: Adding 38min 57.811453s random time.
Dec 22 13:27:53 rPi168 rc.local[362]: }Failed getting oauth client: Failed to exchange auth code for token: oauth2: cannot fetch token: 400 Bad Request
Dec 22 13:27:53 rPi168 rc.local[362]: Response: {
Dec 22 13:27:53 rPi168 rc.local[362]:   "error": "invalid_request",
Dec 22 13:27:53 rPi168 rc.local[362]:   "error_description": "Missing required parameter: code"

epoch1970
Posts: 5132
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: rPi crashing the system

Sun Dec 22, 2019 12:57 pm

Looks like there was something added to /etc/rc.local, that doesn’t quite work.
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

AussieDaveF
Posts: 21
Joined: Tue Jun 26, 2018 11:36 am

Re: rPi crashing the system

Sun Dec 22, 2019 8:42 pm

Agreed. I've moved my start at boot need to a systemd service, which is more in line with a another rPi running a similar script that isn't having the same issue.
Thanks

Anyone have any ideas on the oauth issue?

epoch1970
Posts: 5132
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: rPi crashing the system

Sun Dec 22, 2019 9:31 pm

The request seems invalid because the code parameter is missing from it :D

The only thing I can say is that the problem occurs seemingly before time was adjusted, so in case the code parameter is not missing at all, check if a slightly wrong date could explain the error.
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

AussieDaveF
Posts: 21
Joined: Tue Jun 26, 2018 11:36 am

Re: rPi crashing the system

Mon Dec 23, 2019 2:13 am

I'm actually curious as to why that time is being changes so often too. It's not something I've set up or requested (as best I can remember). It's certainly not int he scripts I have written. Given the time adjustment is random I assume it's something to do with checking for updates, or changes to something external.

epoch1970
Posts: 5132
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: rPi crashing the system

Mon Dec 23, 2019 11:24 am

There is no battery in a pi. When off it loses track of time.
When on, it reloads time from the SD (mostly thanks to the fake-hwclock service), then from NTP servers. Some users add a hardware clock, either battery-backed or radio/GPS as to provide a network-independent yet trusted time source.
At boot usually the clock is bumped to the date found, afterwards finer adjustments are usually preferred. Some processes don’t like seeing the clock jump, so instead the system clock can get slightly accelerated or slowed down to converge to the exact date.

Edit. Apt-timer. I haven’t looked into that but I imagine the idea is to avoid every Pi in the creation try to hit the raspbian repositories all at the same time. So the thing would randomize the next scheduled date.
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

Return to “Troubleshooting”