4

Alpine 3.7 and 3.9. apk add htop works fine. apk add openjdk8-jre hangs forever. Problem step:

(25/36) Installing openjdk8-jre-lib (8.201.08-r0)
usr/ (dir)
usr/lib/ (dir)
usr/lib/jvm/ (dir)
usr/lib/jvm/java-1.8-openjdk/ (dir)
usr/lib/jvm/java-1.8-openjdk/jre/ (dir)
usr/lib/jvm/java-1.8-openjdk/jre/THIRD_PARTY_README
usr/lib/jvm/java-1.8-openjdk/jre/LICENSE
usr/lib/jvm/java-1.8-openjdk/jre/lib/ (dir)
usr/lib/jvm/java-1.8-openjdk/jre/lib/jsse.jar
usr/lib/jvm/java-1.8-openjdk/jre/lib/rt.jar

Here's the strace output:

writev(1, [{iov_base="\338\33[0K\0337 54% ###################"..., iov_len=198}, {iov_base=NULL, iov_len=0} 54% #####################################################################################################                                                                                    ) = 198
read(7, "\33\225\360$Vq\345\373\3117\300bi\373\206\345\v\254\225\226\344\217\324\251\332\267\224uY4\24\353"..., 8192) = 318
...[truncated a bunch more read(7, ... commands]
read(7, "\345\321\\L\270\266dD5&\3728\345lfj\7\t\341\345\235\317\336\370\334\20P\266\na\200\30"..., 4047) = 4044
read(7, "& e", 3)                       = 3
read(7, "\330\5,\tIj*\264W\356i\243\326\32\277\10\216\t\216\25\346\237\314?kd\276e\227\2233\333"..., 8192) = 531
read(7, "\r\241\306\205\3\325h\257&\242\312\341\24%\2331V.\223)\251\262=\v\314\20i\312\375\10r/"..., 7661) = 1348
read(7, "\235\2\333t\266\247\211\253Q*\207\205\v\34\351\231@#s\332\244\261\3321\247\264\253eBP\26z"..., 6313) = 5122
read(7, "T\314E\236\r\31g5d\234\325\20\377\25*\365\305\236\251'X\251'\330\2517\253\324\227x\246\236"..., 1191) = 1191
read(7, "T\256\376J\337%\vU\1\306\333\244l\4\376\225\323\21#\336'S\211nW@@\5/\31\1R"..., 8192) = 4941
read(7, "\6L\373\300\20\231>\2\263e*\312\267\342\344\210r\221\212r\221\356\205w\341=\274\277\1\362\345\265"..., 3251) = 1419
read(7, "\3514qz\362\346.2RPB\301[\3753\251\323B\272 uF\354\224\356*j'N{\2308"..., 1832) = 1460
read(7, "|\340\311C\255a\237+\17\301s()fHw\375\n\244\242<\221a\2p|\354\331\332\307\236\255"..., 372) = 372
read(7, "In(\231IC\263J\322\203i+\371\235@o\21\210\341\5\217;\222k7\79\233\263Q\265\34"..., 8192) = 1007
read(7,

It hangs on that last line as written and does nothing. How can I fix this?

Edit: this problem is definitely due to the nonsense proxies that we have set up at work. When I build on my work laptop from home, the problem disappears. It's unclear to me why our proxies cause this, but I don't really need an answer to that.

3
  • I wasn't able to reproduce myself. How about apk add openjdk8?
    – valiano
    Commented Mar 20, 2019 at 9:29
  • @valiano, it gets further along, but still hangs eventually (see edited question) Commented Mar 20, 2019 at 17:06
  • 1
    To everyone viewing this in the future, just note that the problem was due to proxies I had set up at my work. I have no idea what those problems were, and digging down this deep was not worthwhile. I don't have any answers for you. Best of luck. Commented Apr 27, 2020 at 22:57

1 Answer 1

2

It's difficult to tell what is going wrong exactly, without being able to reproduce, but you may be able to get a good idea using strace. It will generate a lot of output, but once it hangs, you should be able to tell from the last few lines what is keeping apk from proceeding - waiting on a file, lock, etc.

For running strace, add --cap-add=SYS_PTRACE to your docker run command and install strace with apk add strace. Then, run strace apk add openjdk8-jre-lib.

Alternatively, if the issue is only with the OpenJDK package and you're willing use a different base image, openjdk:8-jdk-alpine3.9 (or similar) may fit your needs. This image is basically Alpine 3.9 + the openjdk8 package. In both variations, image size is 101-105MB. Note you get slightly different OpenJDK builds - 1.8.0_201 from Alpine 3.9 + openjdk8, and 1.8.0_191 from openjdk:8-jdk-alpine3.9.

2
  • Unfortunately, the docker base image is not my decision, and because it can build via gitlab it's not going to be changed. I added the strace output (well, some of it). I have no idea how to read it because it looks like total garbage. If you have any more advice I'd really appreciate it. Commented Mar 25, 2019 at 17:57
  • @jeremysprofile Got it. According to strace the read from file handle 7 is stuck. Using the following command, you could check what file is mapped to this handle: ls -la /proc/$$/fd. In one docker, run the strace apk add openjdk8-jre-lib until it gets stuck; then, in a second console, connect to the same image using sudo docker exec -i -t [image-id], and run the ls command.
    – valiano
    Commented Mar 26, 2019 at 6:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .