wangp / bower

A curses terminal client for the Notmuch email system
Other
119 stars 11 forks source link

bower depends on loopback? #99

Closed craftyguy closed 2 years ago

craftyguy commented 2 years ago

I'm trying to run bower in a new network namespace (on Linux) that does not have any network interfaces or connectivity at all (so, no lo, etc), and bower seems to have a hard requirement on that:

$ bower
Errors in configuration file:
posix_spawn failed
sendto(6, "\253&\1\0\0\1\0\0\0\0\0\0\10librem14\0\0\1\0\1", 26, MSG_NOSIGNAL, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("127.0.0.1")}, 16) = 26
sendto(6, "\2542\1\0\0\1\0\0\0\0\0\0\10librem14\0\0\34\0\1", 26, MSG_NOSIGNAL, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("127.0.0.1")}, 16) = 26
poll([{fd=6, events=POLLIN}], 1, 2500)  = 0 (Timeout)

The only reference to any network connection requirement is a brief mention of bower using ssh to access a remote notmuch. Is there a way to disable this and run bower completely "offline" ?

wangp commented 2 years ago

This would be due to the call to getaddrinfo in get_hostname_fqdn, which is used to determine the right side of Message-IDs (xxxx@yyyy) of any messages we create. I think there might be privacy implications of revealing the hostname or FQDN anyway, so we could just take the domain name from the From address. EDIT: that's on the message-id-domain branch now

The "posix_spawn failed" error is strange though.

craftyguy commented 2 years ago

ah yeah seems like the posix_spawn failed is unrelated, I no longer get timeouts on that message-id-domain branch. So I think the original issue I reported is resolved, thanks!

I totally don't expect you to support this way of running bower (using namespaces to constrain it), so feel free to ignore this... but if you're curious...

here's the strace (using the branch above):

expand to show strace output ``` execve("/usr/bin/bower", ["/usr/bin/bower"], 0x7ffd8d2d6780 /* 65 vars */) = 0 arch_prctl(ARCH_SET_FS, 0x7fbea1d51b48) = 0 set_tid_address(0x7fbea1d51f90) = 25841 brk(NULL) = 0x5560d1ce3000 brk(0x5560d1ce5000) = 0x5560d1ce5000 mmap(0x5560d1ce3000, 4096, PROT_NONE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x5560d1ce3000 open("/usr/lib/mercury/lib/libncursesw.so.6", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = -1 ENOENT (No such file or directory) open("/usr/lib/mercury/lib/hlc.gc/libncursesw.so.6", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = -1 ENOENT (No such file or directory) open("/etc/ld-musl-x86_64.path", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = -1 ENOENT (No such file or directory) open("/lib/libncursesw.so.6", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = -1 ENOENT (No such file or directory) open("/usr/local/lib/libncursesw.so.6", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = -1 ENOENT (No such file or directory) open("/usr/lib/libncursesw.so.6", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3 fcntl(3, F_SETFD, FD_CLOEXEC) = 0 fstat(3, {st_mode=S_IFREG|0755, st_size=371664, ...}) = 0 read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\20}\1\0\0\0\0\0"..., 960) = 960 mmap(NULL, 376832, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7fbea1c5f000 mmap(0x7fbea1c75000, 167936, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0x16000) = 0x7fbea1c75000 mmap(0x7fbea1c9e000, 94208, PROT_READ, MAP_PRIVATE|MAP_FIXED, 3, 0x3f000) = 0x7fbea1c9e000 mmap(0x7fbea1cb5000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x55000) = 0x7fbea1cb5000 close(3) = 0 open("/usr/lib/mercury/lib/libpanelw.so.6", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = -1 ENOENT (No such file or directory) open("/usr/lib/mercury/lib/hlc.gc/libpanelw.so.6", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = -1 ENOENT (No such file or directory) open("/lib/libpanelw.so.6", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = -1 ENOENT (No such file or directory) open("/usr/local/lib/libpanelw.so.6", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = -1 ENOENT (No such file or directory) open("/usr/lib/libpanelw.so.6", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3 fcntl(3, F_SETFD, FD_CLOEXEC) = 0 fstat(3, {st_mode=S_IFREG|0755, st_size=18024, ...}) = 0 read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\0\21\0\0\0\0\0\0"..., 960) = 960 mmap(NULL, 24576, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7fbea1c59000 mmap(0x7fbea1c5a000, 8192, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0x1000) = 0x7fbea1c5a000 mmap(0x7fbea1c5c000, 4096, PROT_READ, MAP_PRIVATE|MAP_FIXED, 3, 0x3000) = 0x7fbea1c5c000 mmap(0x7fbea1c5d000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x3000) = 0x7fbea1c5d000 close(3) = 0 open("/usr/lib/mercury/lib/libgpgme.so.11", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = -1 ENOENT (No such file or directory) open("/usr/lib/mercury/lib/hlc.gc/libgpgme.so.11", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = -1 ENOENT (No such file or directory) open("/lib/libgpgme.so.11", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = -1 ENOENT (No such file or directory) open("/usr/local/lib/libgpgme.so.11", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = -1 ENOENT (No such file or directory) open("/usr/lib/libgpgme.so.11", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3 fcntl(3, F_SETFD, FD_CLOEXEC) = 0 fstat(3, {st_mode=S_IFREG|0755, st_size=273848, ...}) = 0 read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0 z\0\0\0\0\0\0"..., 960) = 960 mmap(NULL, 278528, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7fbea1c15000 mmap(0x7fbea1c1c000, 163840, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0x7000) = 0x7fbea1c1c000 mmap(0x7fbea1c44000, 73728, PROT_READ, MAP_PRIVATE|MAP_FIXED, 3, 0x2f000) = 0x7fbea1c44000 mmap(0x7fbea1c56000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x40000) = 0x7fbea1c56000 close(3) = 0 open("/usr/lib/mercury/lib/libmer_std.so", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = -1 ENOENT (No such file or directory) open("/usr/lib/mercury/lib/hlc.gc/libmer_std.so", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3 fcntl(3, F_SETFD, FD_CLOEXEC) = 0 fstat(3, {st_mode=S_IFREG|0755, st_size=5183680, ...}) = 0 read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0@\242\27\0\0\0\0\0"..., 960) = 960 mmap(NULL, 9650176, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7fbea12e1000 mmap(0x7fbea1447000, 2527232, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0x166000) = 0x7fbea1447000 mmap(0x7fbea16b0000, 937984, PROT_READ, MAP_PRIVATE|MAP_FIXED, 3, 0x3cf000) = 0x7fbea16b0000 mmap(0x7fbea1795000, 4718592, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x4b3000) = 0x7fbea1795000 mmap(0x7fbea17d4000, 4460544, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7fbea17d4000 close(3) = 0 open("/usr/lib/mercury/lib/libmer_rt.so", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = -1 ENOENT (No such file or directory) open("/usr/lib/mercury/lib/hlc.gc/libmer_rt.so", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3 fcntl(3, F_SETFD, FD_CLOEXEC) = 0 fstat(3, {st_mode=S_IFREG|0755, st_size=289560, ...}) = 0 read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\200!\1\0\0\0\0\0"..., 960) = 960 mmap(NULL, 303104, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7fbea1297000 mmap(0x7fbea12a8000, 147456, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0x11000) = 0x7fbea12a8000 mmap(0x7fbea12cc000, 57344, PROT_READ, MAP_PRIVATE|MAP_FIXED, 3, 0x35000) = 0x7fbea12cc000 mmap(0x7fbea12db000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x43000) = 0x7fbea12db000 mmap(0x7fbea12df000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7fbea12df000 close(3) = 0 open("/usr/lib/mercury/lib/libgc.so", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3 fcntl(3, F_SETFD, FD_CLOEXEC) = 0 fstat(3, {st_mode=S_IFREG|0755, st_size=113056, ...}) = 0 read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\0{\0\0\0\0\0\0"..., 960) = 960 mmap(NULL, 851968, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7fbea11c7000 mmap(0x7fbea11ce000, 53248, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0x7000) = 0x7fbea11ce000 mmap(0x7fbea11db000, 24576, PROT_READ, MAP_PRIVATE|MAP_FIXED, 3, 0x14000) = 0x7fbea11db000 mmap(0x7fbea11e2000, 741376, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x1a000) = 0x7fbea11e2000 mmap(0x7fbea11e4000, 733184, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7fbea11e4000 close(3) = 0 open("/usr/lib/mercury/lib/libassuan.so.0", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = -1 ENOENT (No such file or directory) open("/usr/lib/mercury/lib/hlc.gc/libassuan.so.0", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = -1 ENOENT (No such file or directory) open("/lib/libassuan.so.0", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = -1 ENOENT (No such file or directory) open("/usr/local/lib/libassuan.so.0", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = -1 ENOENT (No such file or directory) open("/usr/lib/libassuan.so.0", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3 fcntl(3, F_SETFD, FD_CLOEXEC) = 0 fstat(3, {st_mode=S_IFREG|0755, st_size=75824, ...}) = 0 read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0pF\0\0\0\0\0\0"..., 960) = 960 mmap(NULL, 81920, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7fbea11b3000 mmap(0x7fbea11b7000, 36864, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0x4000) = 0x7fbea11b7000 mmap(0x7fbea11c0000, 16384, PROT_READ, MAP_PRIVATE|MAP_FIXED, 3, 0xd000) = 0x7fbea11c0000 mmap(0x7fbea11c5000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x11000) = 0x7fbea11c5000 close(3) = 0 open("/usr/lib/mercury/lib/libgpg-error.so.0", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = -1 ENOENT (No such file or directory) open("/usr/lib/mercury/lib/hlc.gc/libgpg-error.so.0", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = -1 ENOENT (No such file or directory) open("/lib/libgpg-error.so.0", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = -1 ENOENT (No such file or directory) open("/usr/local/lib/libgpg-error.so.0", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = -1 ENOENT (No such file or directory) open("/usr/lib/libgpg-error.so.0", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3 fcntl(3, F_SETFD, FD_CLOEXEC) = 0 fstat(3, {st_mode=S_IFREG|0755, st_size=128992, ...}) = 0 read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0@V\0\0\0\0\0\0"..., 960) = 960 mmap(NULL, 135168, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7fbea1192000 mmap(0x7fbea1197000, 65536, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0x5000) = 0x7fbea1197000 mmap(0x7fbea11a7000, 40960, PROT_READ, MAP_PRIVATE|MAP_FIXED, 3, 0x15000) = 0x7fbea11a7000 mmap(0x7fbea11b1000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x1e000) = 0x7fbea11b1000 close(3) = 0 mprotect(0x7fbea1cb5000, 20480, PROT_READ) = 0 mprotect(0x7fbea1c5d000, 4096, PROT_READ) = 0 mprotect(0x7fbea1c56000, 4096, PROT_READ) = 0 mprotect(0x7fbea1795000, 253952, PROT_READ) = 0 mprotect(0x7fbea12db000, 8192, PROT_READ) = 0 mprotect(0x7fbea11e2000, 4096, PROT_READ) = 0 mprotect(0x7fbea1d4e000, 4096, PROT_READ) = 0 mprotect(0x7fbea11c5000, 4096, PROT_READ) = 0 mprotect(0x7fbea11b1000, 4096, PROT_READ) = 0 mprotect(0x5560d0102000, 135168, PROT_READ) = 0 rt_sigprocmask(SIG_UNBLOCK, [RT_1 RT_2], NULL, 8) = 0 rt_sigaction(SIGBUS, {sa_handler=0x7fbea12b4b00, sa_mask=[], sa_flags=SA_RESTORER|SA_RESTART|SA_SIGINFO, sa_restorer=0x7fbea1d01c8a}, NULL, 8) = 0 rt_sigaction(SIGSEGV, {sa_handler=0x7fbea12b4860, sa_mask=[], sa_flags=SA_RESTORER|SA_RESTART|SA_SIGINFO, sa_restorer=0x7fbea1d01c8a}, NULL, 8) = 0 rt_sigaction(SIGSEGV, {sa_handler=0x7fbea11d2546, sa_mask=[], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7fbea1d01c8a}, {sa_handler=0x7fbea12b4860, sa_mask=[], sa_flags=SA_RESTORER|SA_RESTART|SA_SIGINFO, sa_restorer=0x7fbea1d01c8a}, 8) = 0 rt_sigprocmask(SIG_SETMASK, NULL, [], 8) = 0 --- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0x5560d0101f00} --- rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 rt_sigaction(SIGSEGV, {sa_handler=0x7fbea12b4860, sa_mask=[], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7fbea1d01c8a}, {sa_handler=0x7fbea11d2546, sa_mask=[], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7fbea1d01c8a}, 8) = 0 open("/proc/self/stat", O_RDONLY|O_LARGEFILE) = 3 read(3, "25838 (strace) S 25837 25836 275"..., 4096) = 328 close(3) = 0 brk(NULL) = 0x5560d1ce5000 open("/dev/zero", O_RDONLY|O_LARGEFILE) = 3 fcntl(3, F_SETFD, FD_CLOEXEC) = 0 mmap(NULL, 262144, PROT_READ|PROT_WRITE, MAP_PRIVATE, 3, 0) = 0x7fbea1152000 mmap(0x7fbea1192000, 262144, PROT_READ|PROT_WRITE, MAP_PRIVATE, 3, 0) = 0x7fbea1112000 mmap(0x7fbea1152000, 262144, PROT_READ|PROT_WRITE, MAP_PRIVATE, 3, 0) = 0x7fbea10d2000 mmap(0x7fbea1112000, 262144, PROT_READ|PROT_WRITE, MAP_PRIVATE, 3, 0) = 0x7fbea1092000 mmap(0x7fbea10d2000, 262144, PROT_READ|PROT_WRITE, MAP_PRIVATE, 3, 0) = 0x7fbea1052000 mmap(0x7fbea1092000, 262144, PROT_READ|PROT_WRITE, MAP_PRIVATE, 3, 0) = 0x7fbea1012000 dup(0) = 4 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fbea1011000 dup(1) = 5 ioctl(5, TIOCGWINSZ, {ws_row=56, ws_col=157, ws_xpixel=1099, ws_ypixel=840}) = 0 times({tms_utime=1 /* 0.01 s */, tms_stime=0, tms_cutime=0, tms_cstime=0}) = 1527640304 access("/home/clayton/.config/bower/bower.conf", R_OK) = 0 open("/home/clayton/.config/bower/bower.conf", O_RDONLY|O_LARGEFILE) = 6 fstat(6, {st_mode=S_IFREG|0644, st_size=8493, ...}) = 0 read(6, "# Bower configuration file.\n#\n# "..., 1024) = 1024 read(6, " # I run bower locally but kee"..., 1024) = 1024 read(6, "\n ; alt_html_filter = pandoc -f"..., 1024) = 1024 read(6, "nd -i mail-message-new -c email."..., 1024) = 1024 read(6, "--------------------------------"..., 1024) = 1024 read(6, "the command\n # or disable it "..., 1024) = 1024 read(6, "ile viewing a thread of messages"..., 1024) = 1024 read(6, "e-specific sections override key"..., 1024) = 1024 read(6, "agenta\n separator = bold blue"..., 1024) = 301 read(6, "", 1024) = 0 close(6) = 0 pipe([6, 7]) = 0 rt_sigprocmask(SIG_BLOCK, ~[], [], 8) = 0 pipe2([8, 9], O_CLOEXEC) = 0 clone(child_stack=0x7fffea1b7c08, flags=CLONE_VM|CLONE_VFORK|SIGCHLD) = 25842 close(9) = 0 read(8, "\2\0\0\0", 4) = 4 wait4(25842, [{WIFEXITED(s) && WEXITSTATUS(s) == 127}], 0, NULL) = 25842 close(8) = 0 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=25842, si_uid=1000, si_status=127, si_utime=0, si_stime=0} --- close(6) = 0 close(7) = 0 writev(2, [{iov_base="Errors in configuration file:\n", iov_len=30}, {iov_base=NULL, iov_len=0}], 2Errors in configuration file: ) = 30 writev(2, [{iov_base="posix_spawn failed", iov_len=18}, {iov_base=NULL, iov_len=0}], 2posix_spawn failed) = 18 writev(2, [{iov_base="", iov_len=0}, {iov_base="\n", iov_len=1}], 2 ) = 1 exit_group(1) = ? +++ exited with 1 +++ ```

I'm running it like this, with bubblewrap:

$ bwrap --ro-bind /usr/bin /usr/bin --ro-bind /lib /lib --ro-bind /usr/lib /usr/lib --ro-bind /proc/self /proc/self --ro-bind /run/dbus /run/dbus --ro-bind /etc/localtime /etc/localtime --ro-bind /usr/share/zoneinfo /usr/share/zoneinfo --tmpfs /usr/lib/gcc --setenv XDG_RUNTIME_DIR /var/run/user/1000 --setenv HOME $HOME --dir /var/run/user/1000 --dev /dev --ro-bind $HOME/.notmuch-config $HOME/.notmuch-config --ro-bind $HOME/Mail $HOME/Mail --ro-bind $HOME/.config/bower $HOME/.config/bower /usr/bin/bower
wangp commented 2 years ago

I've merged the branch to master.

craftyguy commented 2 years ago

thank you!