bitte-ein-bit / MMM-iCloud-Client

MIT License
27 stars 4 forks source link

iCloud Calendar issue #2

Closed Sachin1968 closed 7 years ago

Sachin1968 commented 8 years ago

This was working fine but I keep getting the below error now...

Whoops! There was an uncaught exception... { [Error: EACCES: permission denied, open '/home/pi/MagicMirror/modules/MMM-iCloud-Client/contacts.db'] errno: -13, code: 'EACCES', syscall: 'open', path: '/home/pi/MagicMirror/modules/MMM-iCloud-Client/contacts.db' } MagicMirror will not quit, but it might be a good idea to check why this happened. Maybe no internet connection? If you think this really is an issue, please open an issue on GitHub: https://github.com/MichMich/MagicMirror/issues

bitte-ein-bit commented 8 years ago

Could you list the file permission of /home/pi/MagicMirror/modules/MMM-iCloud-Client/contacts.db? To do that open a terminal and enter

ls -l /home/pi/MagicMirror/modules/MMM-iCloud-Client/contacts.db

and post the output. And also how do you start your mirror and what user are you using? If unsure, post the output of ps auxwww while your mirror is running.

I suspect that the mirror was run at least once as root and you now try to start it as user pi.

Sachin1968 commented 8 years ago

@bitte-ein-bit I checked the permissions of contacts,db and it was owned by root/root with permissions set to rw r r. I manually set the ownership to pi/pi and changed the mode to rwx rwx rwx and it works for a few cycles, then it seems like a process updates contacts.db and changes permissions and ownership back to root/root rw r r.

The output of ps auxwww is lengthy, let me know if you want me to post it here? It seems most of the processes listed are owned by root.

thanks.

Sachin1968 commented 8 years ago

I start the Mirror as user pi from a terminal window: npm start

bitte-ein-bit commented 8 years ago

Hi,

that seems strange.

from ps auxwww all node specific lines would be of interest. Do you happen to start once as user pi and then as user root? Seems like the only explanation right now.

Maybe I have to move to some other storage dir... and use the user. PR welcome.

Am Di, 17. Mai 2016, um 15:43, schrieb Sachin1968:

@bitte-ein-bit[1] I checked the permissions of contacts,db and it was owned by root/root with permissions set to rw r r. I manually set the ownership to pi/pi and changed the mode to rwx rwx rwx and it works for a few cycles, then it seems like a process updates contacts.db and changes permissions and ownership back to root/root rw r r. The output of ps auxwww is lengthy, let me know if you want me to post it here? It seems most of the processes listed are owned by root. thanks. — You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub[2]

Links:

  1. https://github.com/bitte-ein-bit
  2. https://github.com/bitte-ein-bit/MMM-iCloud-Client/issues/2#issuecomment-219721301
Sachin1968 commented 8 years ago

Here's the output of ps auxwww

ps auxwww USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND root 1 0.1 0.4 22832 3940 ? Ss 10:05 0:06 /sbin/init root 2 0.0 0.0 0 0 ? S 10:05 0:00 [kthreadd] root 3 0.0 0.0 0 0 ? S 10:05 0:00 [ksoftirqd/0] root 5 0.0 0.0 0 0 ? S< 10:05 0:00 [kworker/0:0H] root 7 0.1 0.0 0 0 ? S 10:05 0:04 [rcu_sched] root 8 0.0 0.0 0 0 ? S 10:05 0:00 [rcu_bh] root 9 0.0 0.0 0 0 ? S 10:05 0:00 [migration/0] root 10 0.0 0.0 0 0 ? S 10:05 0:00 [migration/1] root 11 0.0 0.0 0 0 ? S 10:05 0:00 [ksoftirqd/1] root 13 0.0 0.0 0 0 ? S< 10:05 0:00 [kworker/1:0H] root 14 0.0 0.0 0 0 ? S 10:05 0:00 [migration/2] root 15 0.0 0.0 0 0 ? S 10:05 0:00 [ksoftirqd/2] root 17 0.0 0.0 0 0 ? S< 10:05 0:00 [kworker/2:0H] root 18 0.0 0.0 0 0 ? S 10:05 0:00 [migration/3] root 19 0.0 0.0 0 0 ? S 10:05 0:00 [ksoftirqd/3] root 21 0.0 0.0 0 0 ? S< 10:05 0:00 [kworker/3:0H] root 22 0.0 0.0 0 0 ? S< 10:05 0:00 [khelper] root 23 0.0 0.0 0 0 ? S 10:05 0:00 [kdevtmpfs] root 24 0.0 0.0 0 0 ? S< 10:05 0:00 [netns] root 25 0.0 0.0 0 0 ? S< 10:05 0:00 [perf] root 26 0.0 0.0 0 0 ? S 10:05 0:00 [khungtaskd] root 27 0.0 0.0 0 0 ? S< 10:05 0:00 [writeback] root 28 0.0 0.0 0 0 ? S< 10:05 0:00 [crypto] root 29 0.0 0.0 0 0 ? S< 10:05 0:00 [bioset] root 30 0.0 0.0 0 0 ? S< 10:05 0:00 [kblockd] root 32 0.0 0.0 0 0 ? S< 10:05 0:00 [rpciod] root 33 0.0 0.0 0 0 ? S 10:05 0:00 [kswapd0] root 34 0.0 0.0 0 0 ? S 10:05 0:00 [fsnotify_mark] root 35 0.0 0.0 0 0 ? S< 10:05 0:00 [nfsiod] root 41 0.0 0.0 0 0 ? S< 10:05 0:00 [kthrotld] root 42 0.0 0.0 0 0 ? R 10:05 0:00 [kworker/1:1] root 43 0.0 0.0 0 0 ? S< 10:05 0:00 [VCHIQ-0] root 44 0.0 0.0 0 0 ? S< 10:05 0:00 [VCHIQr-0] root 45 0.0 0.0 0 0 ? S< 10:05 0:00 [VCHIQs-0] root 46 0.0 0.0 0 0 ? S< 10:05 0:00 [iscsi_eh] root 47 0.0 0.0 0 0 ? S< 10:05 0:00 [dwc_otg] root 49 0.0 0.0 0 0 ? S< 10:05 0:00 [DWC Notificatio] root 52 0.0 0.0 0 0 ? S 10:05 0:00 [VCHIQka-0] root 53 0.0 0.0 0 0 ? S< 10:05 0:00 [SMIO] root 54 0.0 0.0 0 0 ? S< 10:05 0:00 [deferwq] root 56 0.0 0.0 0 0 ? S 10:05 0:02 [mmcqd/0] root 58 0.0 0.0 0 0 ? S 10:05 0:00 [jbd2/mmcblk0p2-] root 59 0.0 0.0 0 0 ? S< 10:05 0:00 [ext4-rsv-conver] root 60 0.0 0.0 0 0 ? S< 10:05 0:00 [ipv6_addrconf] root 74 0.0 0.0 0 0 ? S< 10:05 0:00 [kworker/1:1H] root 98 0.0 0.0 0 0 ? S 10:05 0:00 [kworker/0:2] root 108 0.0 0.3 9948 3260 ? Ss 10:05 0:01 /lib/systemd/systemd-journald root 110 0.0 0.3 12000 3192 ? Ss 10:05 0:00 /lib/systemd/systemd-udevd root 193 0.0 0.0 0 0 ? S< 10:05 0:00 [cfg80211] root 199 0.0 0.0 0 0 ? S< 10:05 0:00 [brcmf_wq/mmc1:0] root 202 0.0 0.0 0 0 ? S 10:05 0:02 [brcmf_wdog/mmc1] root 216 0.2 0.0 0 0 ? S 10:05 0:08 [ksdioirqd/mmc1] root 389 0.0 0.2 5072 2384 ? Ss 10:06 0:00 /usr/sbin/cron -f root 390 0.0 0.2 3852 2456 ? Ss 10:06 0:00 /lib/systemd/systemd-logind root 391 0.0 0.1 2564 1740 ? Ss 10:06 0:02 /sbin/dhcpcd -q -b avahi 396 0.0 0.2 4000 2608 ? Ss 10:06 0:00 avahi-daemon: running [raspberrypi.local] message+ 398 0.0 0.3 5712 3204 ? Ss 10:06 0:00 /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation nobody 411 0.0 0.1 2292 1444 ? Ss 10:06 0:00 /usr/sbin/thd --daemon --triggers /etc/triggerhappy/triggers.d/ --socket /var/run/thd.socket --pidfile /var/run/thd.pid --user nobody /dev/input/event0 avahi 419 0.0 0.0 3876 240 ? S 10:06 0:00 avahi-daemon: chroot helper root 437 0.0 0.4 7264 3808 ? Ss 10:06 0:00 /sbin/wpa_supplicant -s -B -P /run/wpa_supplicant.wlan0.pid -i wlan0 -D nl80211,wext -c /etc/wpa_supplicant/wpa_supplicant.conf root 484 0.0 0.3 32144 2920 ? Ssl 10:06 0:00 /usr/sbin/rsyslogd -n root 507 0.0 0.0 0 0 ? S< 10:06 0:00 [kworker/2:1H] root 511 0.0 0.4 7860 4268 ? Ss 10:06 0:00 /usr/sbin/sshd -D root 529 0.0 0.7 40516 6904 ? Ssl 10:06 0:00 /usr/sbin/lightdm root 551 0.0 0.2 5668 2764 tty1 Ss 10:06 0:00 /bin/login -f
root 552 0.0 0.2 3872 1916 ttyS0 Ss+ 10:06 0:00 /sbin/agetty --keep-baud 115200 38400 9600 ttyS0 vt102 ntp 553 0.0 0.3 5684 3660 ? Ss 10:06 0:01 /usr/sbin/ntpd -p /var/run/ntpd.pid -g -u 106:111 root 597 5.4 5.8 131868 55156 tty7 Ssl+ 10:06 3:32 /usr/bin/X -s 0 -dpms :0 -seat seat0 -auth /var/run/lightdm/root/:0 -nolisten tcp vt7 -novtswitch root 648 0.0 0.7 32872 7288 ? Sl 10:06 0:00 lightdm --session-child 13 16 pi 659 0.0 0.3 4976 3328 ? Ss 10:06 0:00 /lib/systemd/systemd --user pi 664 0.0 0.1 6800 1268 ? S 10:06 0:00 (sd-pam)
pi 668 0.0 1.2 51876 12228 ? Ssl 10:06 0:00 /usr/bin/lxsession -s LXDE-pi -e LXDE pi 771 0.0 0.2 3416 2088 ? S 10:06 0:00 /usr/bin/unclutter -idle 1 -root pi 772 0.0 0.0 3696 220 ? Ss 10:06 0:00 /usr/bin/ssh-agent /usr/bin/dbus-launch --exit-with-session x-session-manager pi 775 0.0 0.1 3692 1568 ? S 10:06 0:00 /usr/bin/dbus-launch --exit-with-session x-session-manager pi 776 0.0 0.2 5600 2312 ? Ss 10:06 0:00 /usr/bin/dbus-daemon --fork --print-pid 5 --print-address 7 --session pi 794 0.0 0.5 30816 5596 ? Sl 10:06 0:00 /usr/lib/gvfs/gvfsd pi 798 0.0 0.5 48520 5332 ? Sl 10:06 0:00 /usr/lib/gvfs/gvfsd-fuse /run/user/1000/gvfs -f -o big_writes root 847 0.0 0.0 0 0 ? S< 10:06 0:00 [kworker/u9:0] root 848 0.0 0.0 0 0 ? S< 10:06 0:00 [hci0] root 849 0.0 0.0 0 0 ? S< 10:06 0:00 [hci0] root 850 0.0 0.0 2068 132 ? S 10:06 0:00 /usr/bin/hciattach /dev/ttyAMA0 bcm43xx 921600 noflow - root 853 0.0 0.0 0 0 ? S< 10:06 0:00 [kworker/u9:1] root 860 0.0 0.0 0 0 ? S< 10:06 0:00 [kworker/3:1H] root 862 0.0 0.3 5008 3484 ? Ss 10:06 0:00 /usr/lib/bluetooth/bluetoothd root 867 0.0 0.0 0 0 ? S< 10:06 0:00 [kworker/0:1H] pi 877 0.0 0.4 6488 4436 tty1 S+ 10:06 0:00 -bash pi 890 0.0 1.3 21484 12664 ? S 10:06 0:02 openbox --config-file /home/pi/.config/openbox/lxde-pi-rc.xml pi 892 0.0 0.9 29976 8548 ? Sl 10:06 0:00 lxpolkit pi 895 0.4 2.7 146108 25948 ? Sl 10:06 0:17 lxpanel --profile LXDE-pi pi 896 0.0 2.2 84756 21136 ? Sl 10:06 0:03 pcmanfm --desktop --profile LXDE-pi root 924 0.0 0.8 41160 7588 ? Ssl 10:06 0:00 /usr/lib/policykit-1/polkitd --no-debug pi 941 0.0 0.0 3696 220 ? Ss 10:06 0:00 /usr/bin/ssh-agent -s pi 946 2.6 1.7 26372 16696 ? S 10:06 1:40 x11vnc -forever -usepw -display :0 -ultrafilexfer pi 1027 0.0 0.8 42776 7784 ? Sl 10:06 0:00 /usr/lib/gvfs/gvfs-udisks2-volume-monitor root 1029 0.0 0.8 59064 7812 ? Ssl 10:06 0:00 /usr/lib/udisks2/udisksd --no-debug pi 1036 0.0 0.8 101536 8092 ? S<l 10:06 0:00 /usr/bin/pulseaudio --start rtkit 1037 0.0 0.2 21376 2000 ? SNsl 10:06 0:00 /usr/lib/rtkit/rtkit-daemon pi 1051 0.0 0.6 42248 6516 ? Sl 10:06 0:00 /usr/lib/gvfs/gvfs-afc-volume-monitor pi 1057 0.0 0.5 30812 5364 ? Sl 10:06 0:00 /usr/lib/gvfs/gvfs-gphoto2-volume-monitor pi 1061 0.0 0.5 29792 5160 ? Sl 10:06 0:00 /usr/lib/gvfs/gvfs-mtp-volume-monitor pi 1065 0.0 0.5 29868 5212 ? Sl 10:06 0:00 /usr/lib/gvfs/gvfs-goa-volume-monitor pi 1073 0.0 0.7 60200 7012 ? Sl 10:06 0:00 /usr/lib/gvfs/gvfsd-trash --spawner :1.1 /org/gtk/gvfs/exec_spaw/0 pi 1082 0.0 0.6 29692 5904 ? Ssl 10:06 0:00 /usr/lib/menu-cache/menu-cached /tmp/.menu-cached-:0-pi pi 1089 0.0 0.0 1912 96 ? S 10:06 0:00 /bin/sh /usr/bin/start-pulseaudio-x11 pi 1090 0.0 0.2 5796 2272 ? S 10:06 0:00 /usr/bin/xprop -root -spy root 1215 0.0 0.1 3696 1672 ? S 10:06 0:00 /usr/bin/dbus-launch --autolaunch 2c9b9d45656b45afb58b1f0a4682f91a --binary-syntax --close-stderr root 1216 0.0 0.1 5496 1544 ? Ss 10:06 0:00 /usr/bin/dbus-daemon --fork --print-pid 5 --print-address 7 --session root 6491 0.0 0.0 0 0 ? S 10:19 0:00 [kworker/3:0] root 7304 0.0 0.0 0 0 ? S 10:21 0:00 [kworker/2:1] root 18047 0.2 0.0 0 0 ? S 10:47 0:03 [kworker/u8:2] pi 20996 0.7 1.9 47696 18836 ? Sl 10:54 0:07 lxterminal pi 20997 0.0 0.1 2348 1440 ? S 10:54 0:00 gnome-pty-helper pi 20998 0.0 0.4 6396 4404 pts/0 Ss 10:54 0:00 /bin/bash root 21092 0.0 0.0 0 0 ? S 10:54 0:00 [kworker/3:1] root 21598 0.0 0.0 0 0 ? S 10:56 0:00 [kworker/2:2] root 21911 0.3 0.0 0 0 ? S 10:58 0:02 [kworker/u8:0] pi 22020 0.0 1.4 59420 13956 ? Sl 10:58 0:00 /usr/lib/gvfs/gvfsd-http --spawner :1.1 /org/gtk/gvfs/exec_spaw/1 pi 22068 0.0 0.5 20604 5344 ? Sl 10:58 0:00 /usr/lib/gvfs/gvfsd-metadata root 22151 0.4 0.0 0 0 ? S 10:58 0:03 [kworker/u8:3] pi 22732 16.6 14.2 632448 135328 ? Sl 11:01 1:34 chromium-browser --enable-pinch
pi 22755 0.0 0.0 2160 488 ? S 11:01 0:00 /usr/lib/chromium-browser/chrome-sandbox /usr/lib/chromium-browser/chromium-browser --type=zygote pi 22756 0.4 5.6 183560 53380 ? S 11:01 0:02 chromium-browser --type=zygote
pi 22770 0.0 1.0 183560 9924 ? S 11:01 0:00 chromium-browser --type=zygote
pi 22808 0.8 7.9 271212 75564 ? Sl 11:01 0:04 chromium-browser --type=gpu-process --channel=22732.0.404468211 --window-depth=16 --supports-dual-gpus=false --gpu-driver-bug-workarounds=3,54 --disable-accelerated-video-decode --gpu-vendor-id=0x0000 --gpu-device-id=0x0000 --gpu-driver-vendor --gpu-driver-version --v8-natives-passed-by-fd --v8-snapshot-passed-by- pi 22815 0.0 0.4 8984 4380 ? S 11:01 0:00 /usr/lib/arm-linux-gnueabihf/gconf/gconfd-2 pi 22893 12.4 19.9 538108 189216 ? Sl 11:01 1:08 /usr/lib/chromium-browser/chro
pi 23007 1.1 1.9 36424 18668 ? Sl 11:01 0:06 leafpad /home/pi/MagicMirror/config/config.js pi 23414 7.4 10.9 394144 104260 ? Sl 11:03 0:33 /usr/lib/chromium-browser/chro
root 23684 0.0 0.0 0 0 ? S 11:04 0:00 [kworker/0:0] root 23830 0.0 0.0 0 0 ? S 11:04 0:00 [kworker/1:0] root 24602 0.0 0.0 0 0 ? S 11:07 0:00 [kworker/3:2] pi 24787 1.7 3.8 130972 36340 pts/0 Sl+ 11:07 0:02 npm
pi 24810 0.0 0.0 1916 368 pts/0 S+ 11:07 0:00 sh -c electron js/electron.js pi 24811 0.2 2.0 82232 19480 pts/0 Sl+ 11:07 0:00 node /home/pi/MagicMirror/node_modules/.bin/electron js/electron.js pi 24816 57.0 12.0 514976 114012 pts/0 Rl+ 11:07 1:34 /home/pi/MagicMirror/node_modules/electron-prebuilt/dist/electron js/electron.js pi 24818 0.0 2.5 104628 23964 pts/0 S+ 11:07 0:00 /home/pi/MagicMirror/node_modules/electron-prebuilt/dist/electron --type=zygote --no-sandbox pi 24862 0.2 4.3 200600 41668 pts/0 Sl+ 11:07 0:00 /home/pi/MagicMirror/node_modules/electron-prebuilt/dist/electron --type=gpu-process --channel=24816.0.1762724555 --no-sandbox --window-depth=16 --supports-dual-gpus=false --gpu-driver-bug-workarounds=3,54 --disable-accelerated-video-decode --gpu-vendor-id=0x0000 --gpu-device-id=0x0000 --gpu-driver-vendor --gpu-driver-version --v8-natives-passed-by-fd --v8-snapshot-passed-by-fd pi 24870 15.3 7.3 303112 69340 pts/0 Sl+ 11:07 0:24 /home/pi/MagicMirror/node_modules/electron-prebuilt/dist/electron --type=renderer --no-sandbox --lang=en-US --node-integration=false --num-raster-threads=2 --content-image-texture-target=3553,3553,3553,3553,3553,3553,3553,3553,3553,3553,3553,3553,3553,3553 --video-image-texture-target=3553 --disable-accelerated-video-decode --channel=24816.1.483731838 --v8-natives-passed-by-fd --v8-snapshot-passed-by-fd root 24927 0.0 0.0 0 0 pts/0 Z+ 11:08 0:00 [gpio] pi 25027 0.1 0.4 6396 4420 pts/1 Ss 11:08 0:00 /bin/bash root 25090 0.0 0.0 0 0 ? S 11:08 0:00 [kworker/u8:1] root 25539 0.0 0.0 0 0 ? S 11:09 0:00 [kworker/0:1] pi 25955 0.0 0.2 4740 2124 pts/1 R+ 11:10 0:00 ps auxwww

bitte-ein-bit commented 8 years ago

Hmm, that looks totally fine to me. I have to look into this, but as I'm due to leave for a trip, it'll take a while. Sorry.

Sachin1968 commented 8 years ago

@bitte-ein-bit I figured it out. My autostart script had sudo npm start (leftover from a different smart mirror application). I removed the sudo, and all is well. Sorry for the wild goose chase. Thanks.

bitte-ein-bit commented 8 years ago

Hi,

great you figured it out. That's what I was hunting after.

Thanks

michlb1003 commented 7 years ago

Hi is it possible the whole icloud calendar to be shown on the magic mirror ? i think your module is user specific and secured with authentification so it would be better to view a calender with it than view a public calender like the normal calender module...

THanks.