/srv/irclogs.ubuntu.com/2019/09/07/#snappy.txt

mupPR snapd#7424 closed: fixme: move snapfrompid into osutils <Created by ardaguclu> <Closed by ardaguclu> <https://github.com/snapcore/snapd/pull/7424>06:32
mupPR snapd#7424 opened: fixme: move snapfrompid into osutils <Created by ardaguclu> <https://github.com/snapcore/snapd/pull/7424>07:38
rogpeppehi all, a raspberry pi that i maintain went into a reboot loop recently. i reflashed the sd card and it now works, so i'm guessing it's probably not a h/w problem. any ideas why this might have happened? it was previously running the same s/w for months on end without incident.09:29
rogpeppeit's annoying because it's a remote system running a domestic power control system and i don't have direct access to it (physical access requires either a 900 mile drive or having the pi sent in the post)09:31
rogpeppei suspect that snappy/core auto-update might have been to blame, but it's also possible that the sd card has become unreliable09:33
zygarogpeppe: hey10:36
zygarogpeppe: do you still have the card contents from the reboot loop?10:37
zygarogpeppe: we could perform analysis to determine that10:37
rogpeppezyga: no, sorry, i had to overwrite them10:37
rogpeppezyga: i shoulda copied the card contents10:37
zygarogpeppe: I see, it's too bad because it might have been interesting to understand the cause10:37
rogpeppezyga: yeah, i thought so too10:37
zygarogpeppe: next time please "dd" the card to disk for safe-keeping10:38
zygarogpeppe: if this happens again please let us know10:38
zygawe saw a few events like that but in all cases those bugs were eventually fixed10:38
rogpeppezyga: will do. i wanted to look at syslog but i'm not sure how to view journalctl logs via an sd card10:38
zygarogpeppe: I'm not sure either but there's probably a way somehow10:39
rogpeppezyga: it's quite possible this hardware is unreliable - i've just seen another random reboot10:39
zygarogpeppe: in one case we found a bug in the FAT encoding between the bootloader, linux and some dos editing tools from linux10:39
rogpeppezyga: i'm moving onto another rpi (a rpi 3 this time) and keeping fingers crossed10:39
zygarogpeppe: so the range of possible problems is wide10:39
zygarogpeppe: make sure to use a good power adapter, PI 3B+ uses way more energy and needs a reliable source10:40
rogpeppezyga: ok, that's interesting. how many amps does it need?10:40
zygarogpeppe: from the top of my head you need 2.5 or 3A10:40
zygarogpeppe: I ordered a new dedicated power supply for this reason, just waiting for the package to arrive10:41
rogpeppezyga: one thing that concerns me about my current setup: the snap that's doing the work prints quite a bit to stdout (logging messages) and that ends up churning the sd card quite a bit over the course of months.10:41
zygarogpeppe: mmm10:41
zygarogpeppe: it's a common complaint actually,10:41
rogpeppezyga: there have been a couple of occasions when i think an unexpected power outage has resulted in a corrupted sd card that's unable to boot10:41
zygathere used to be some settings to disable rsyslog and make journal only log to memory but I think those never got released10:42
rogpeppezyga: at least, that's my tentative diagnosis10:42
rogpeppezyga: i'm thinking of installing some kind of battery-backed UPS device to avoid that somewhat10:42
zygarogpeppe: maybe just a powerbank?10:43
zygasome powerbanks can be charged and used at the same time10:43
zygait's a low cost solution for sure :)10:43
rogpeppezyga: yeah, maybe. it needs to work reliably over a period of years10:45
rogpeppezyga: and deal ok with power outages on the order of days10:46
zygadays?10:46
zygaI have a pi zero wireless10:46
zygathat's powered from a power bank with USB-C power delivery10:46
rogpeppezyga: yeah, this is in a fairly remote area of scotland and power outages aren't uncommon10:46
zygaa larger one actually10:46
zygait lets the pi run for about a week10:46
zygaI didn't try it with a more power-hungry device10:47
zygait's neat because I can use USB-C to charge the battery10:47
rogpeppezyga: the other thing i'm considering is a small pi zero or something to act as a monitor and reboot if needed, because i've seen some hangups where the pi doesn't autoreboot on crash10:47
zygawhile powering the PI or other devkit from the other connector10:47
zygarogpeppe: yeah, the pi doesn't have a watchdog10:47
zygaso it's not reliable in this sense unfortunately10:47
rogpeppezyga: i remember seeing a UPS device that also included a real time clock, which would be ideal, but i can't seem to find it now10:48
zygagee, I wish USB battery packs could convey their charge over USB10:48
rogpeppeha, that would be cool10:49
zygayeah10:50
zygatoo bad USB is such a mess10:50
zygaI think USB-PD is better in this regard10:50
rogpeppeat least the pi doesn't seem to go back in time any more - that was a real pain for my app10:50
zygarogpeppe: that's another bug10:52
zygaa combination of bugs actually10:52
zygapi has no RTC with battery power10:52
rogpeppehmm, that's twice now that this pi has scheduled a reboot and not managed to come out of it10:52
zygaso each reboot it's back to 1970s10:52
zygaso we used some timestamps to establish "less insane wrong time"10:52
zygalike the stamp on some files in FAT10:53
rogpeppeyes, that's definitely better10:53
zygabut you really only get working time after you ntp10:53
zygaso offline you are still in the past on reboot10:53
zygawe also changed things so that time is saved back to fat on reboot10:53
zygaso it's not perfect but much better10:53
zygarogpeppe: if you can get any logs that would be good10:53
rogpeppeand it just failed again after powering off/on, but then succeeded the next time. i'm a bit concerned about reliablilty here.10:53
zygaif you can image the SD card and help us with forensics that would be perfect10:53
rogpeppezyga: what logs would you look at?10:53
zygamany things10:54
rogpeppezyga: it's booted ok again now10:54
zygasnap changes to understand what snapd was doing10:54
zygajournal to see what the system was doing10:54
zygathe full card image to look for FAT corruption or other magic10:54
zygait all depends on initial analysis10:54
zygaone small tip10:54
zygaif you enable persistent journal10:54
zygayou can see what happened in the past better10:54
zygamkdir /var/log/journal10:55
zygaand reboot10:55
rogpeppezyga: the first time it rebooted, i got it to reboot again after a couple of tries, and the snap was still half way through installing10:55
zygarogpeppe: that's normal10:55
rogpeppezyga: i think that it decided to reboot again after it had installed (and it failed again)10:55
rogpeppezyga: oh really? ok i guess.10:55
zygarogpeppe: when snapd / kernel or other essential snap updates some updates are postponed until after that one fully finished10:55
zygawhich may include a reboot10:55
zygabut if it reboots like 3 times that's curious10:56
zygaif you can ssh and check "snap changes" that would help10:56
rogpeppezyga: i'd hope the card wasn't corrupted, as i've only just flashed it10:56
zygaSD cards can permanently fail10:56
zygause a flashing tool that verifies each block10:56
zygalike etcher does10:56
rogpeppezyga: when the reboot fails, it fails quickly - i don't get the core splash screen10:56
zygait's useful to spot flaky cards outright10:56
zygado you have "hands on" access to the device now?10:57
rogpeppezyga: yup10:57
zygaI can recommend attaching a serial adapter to the pins on the PI10:57
rogpeppezyga: for a few hours before i need to leave10:57
zygait's useful to see what's going on early10:57
zygayou can plug that to another device for monitoring10:57
rogpeppezyga: i haven't got a serial adaptor here i'm afraid10:57
zygae.g. even another PI10:57
zygarogpeppe: ah, too bad, it's useful10:57
rogpeppezyga: i should get hold of one10:57
zygaUSB-TTL adapters, grab a few next time on ebay10:57
zygait's mostly useful to see early boot logic10:58
zygaas we log what's going on10:58
zygaespecially kernel / rootfs selection10:58
zygaand boot mode10:58
rogpeppezyga: i presume that's not TTL as in TTL-logic10:58
zyga(normal or trying new kernel or new rootfs)10:58
zygathey are just called TTL to differentiate from "high" voltage real serial ports10:58
zygaon pi it's 3.3V AFAIK10:58
rogpeppei think i'm behind the times on acronyms :)10:59
zyga:D10:59
rogpeppeFWIW when it fails to boot, the it takes about a couple of seconds before the permanent red light comes on10:59
zygawhich PI variant is tihs?11:00
zyga*this11:00
zygaspeaking of which, I need to place that backorder on Pi 4 finally11:00
zygathe 4GB variant is never in stock, it seems11:00
zygaif it shows anything is that pi 5 will have an 8GB version11:01
zygaand a SATA port ;-)11:01
rogpeppezyga: it's a pi 3, but i can't remember which exact variant. how do i tell?11:01
zygacat /proc/cpuinfo11:01
rogpeppezyga: is this the etcher tool you were talking about? https://www.techspot.com/downloads/6931-etcher.html11:01
zygayeah11:01
zyganow owned by balena11:01
zygahttps://www.balena.io/etcher/11:02
zygastill FOSS, just a way to point to a company11:02
rogpeppehttp://paste.ubuntu.com/p/3m8k66gtVS/11:02
zygait's remarkably good11:02
zygaone sec11:02
zygathat's PI 3B11:03
zygano, wait11:04
* zyga rechecks11:04
zygathat could be 3B+11:04
zygadoes it have a metal can on the CPU?11:04
zygaif so that's the 3B+ which needs way more power to work11:04
zyga(but is also faster)11:04
rogpeppenot sure. i think the cpu might be covered up by the piglow device i've got plugged in11:05
zygaoh, you have pilgow?11:06
zygalet me share one thing I made11:06
zygahttps://github.com/zyga/snappy-pi2-piglow11:06
zygait's for the time when snapd interfaces were still called "snappy skills"11:06
rogpeppeah, i've found the order: Raspberry Pi 3 Model B Quad Core CPU 1.2 GHz 1 GB RAM Motherboard11:07
zygammm11:07
zygaI should update that piglow repo to more recent snappy standards :)11:07
rogpeppei built a nice piglow library in Go11:07
rogpeppehttps://godoc.org/github.com/rogpeppe/misc/piglow11:09
rogpeppeit's designed to work ok if used concurrently11:09
rogpeppeand a command too: https://godoc.org/github.com/rogpeppe/misc/cmd/piglow11:09
zygaI went to check out the gamma table :D11:10
rogpeppei'd totally forgotten about that until now :)11:11
zygaI used https://github.com/zyga/snappy-pi2-piglow/blob/master/sn3218.c#L3011:11
rogpeppei think i probably nicked the gamma table from somewhere else11:11
zygaI don't recall how I got those values now11:11
zygaI _may_ have used something to measure the output at the time11:11
zygait was when I was still doing hardware fun projects11:11
rogpeppeha, i even gave it credit: // Stolen from github.com/benleb/PyGlow.11:12
zygayeah :)11:17
zygaI'm back to tinkering11:17
rogpeppezyga: sadly it seems like my command has rotted and no longer works :(11:25
mupPR snapcraft#2704 closed: extensions: create the gnome-platform directory <Created by sergiusens> <Merged by sergiusens> <https://github.com/snapcore/snapcraft/pull/2704>15:56
mupPR snapcraft#2705 closed: extensions: rename extension classes to known names <Created by sergiusens> <Merged by sergiusens> <https://github.com/snapcore/snapcraft/pull/2705>15:56

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!