Bug 1335344 - Hidden dependency on firefox
Summary: Hidden dependency on firefox
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: maven
Version: 23
Hardware: x86_64
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: Michal Srb
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-05-12 01:35 UTC by Bill C. Riemers
Modified: 2016-05-12 15:43 UTC (History)
18 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-05-12 15:43:12 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Build log without firefox on Fedora 23. (131.99 KB, text/plain)
2016-05-12 13:59 UTC, Bill C. Riemers
no flags Details
Build log without firefox on Fedora 23, with -X option and stripping color codes (139.72 KB, text/plain)
2016-05-12 15:10 UTC, Bill C. Riemers
no flags Details

Description Bill C. Riemers 2016-05-12 01:35:36 UTC
Description of problem:

I have a docker script that does a maven build of java code.   The dockerfile has been working for me for more than a year.   Recently I found it stopped working with a java backtrace.  However, maven builds of the same project worked on my desktop, with the same version of Fedora as the docker image.

After trying all packages installed on my laptop but not in the docker image, I found maven is only working if and only if firefox is installed.   Not the dependancies, but firefox itself.   Otherwise maven crashes the first time it attempts to download a dependancies.

So now my line for installing dependancies looks like:

RUN dnf -y update --skip-broken ; dnf -y install maven git bzip2 rpm-build firef
ox && dnf clean all

Significantly increasing my docker image size.

On a related note, I recently build an image for sublime-text-3. I found in that image I had to install firefox and I had to volume mount /var/lib/sss because when sublime-text-3 opens a link firefox will get called which will then in turn send a message through sssd to firefox running outside the docker container.  sublime-text-3 was unable to open firefox directly inside the container, even though I have the X11 display exported, because sssd is not running inside the container...

I point out this related issue with sublime-text-3 as it may provide a useful clue how firefox ends up being a dependency of maven.   I doubt maven is directly calling firefox, but the way the docker container is being connected to the dbus is probably result on it being used for java.






Version-Release number of selected component (if applicable):


How reproducible:

100%

Steps to Reproduce:
1.  Attempt to build a docker image that does a maven build.
2.
3.

Actual results:

Stack dump.

Expected results:

Image builds.


Additional info:

For reference here is the complete Dockerfile I use. Without firefox, the failure happen at the "mvn clean" step.

$ cat Dockerfile
FROM fedora
MAINTAINER briemers <briemers>
ENV LANG en_US.UTF-8

RUN dnf -y update --skip-broken ; dnf -y install maven git bzip2 rpm-build firefox && dnf clean all

RUN adduser -d /home/sfuser sfuser

COPY . /sfjavasuite.git

RUN ( [ -d /sfjavasuite.git ] || mkdir /sfjavasuite.git ) && chown -R sfuser /sfjavasuite.git

USER sfuser
WORKDIR /sfjavasuite.git
ENV HOME /home/sfuser

RUN mkdir "$HOME/.m2" && cp settings.xml "$HOME/.m2/."

RUN mvn clean
RUN mvn compile
RUN mvn package install

RUN chmod -R ugo+rX .

CMD ["/bin/bash", "-i"]

Comment 1 Daniel Walsh 2016-05-12 11:59:25 UTC
This is not a docker issue. Perhaps this is a maven issue.

Comment 2 Michal Srb 2016-05-12 13:32:42 UTC
Could you please share the java backtrace with us? Is is possible that you're trying to run some kind of selenium tests during the build, which require browser?

Comment 3 Bill C. Riemers 2016-05-12 13:59:34 UTC
Created attachment 1156700 [details]
Build log without firefox on Fedora 23.

Output of the command:

$ (docker build --no-cache --rm -t sfjavasuite . 2>&1) |tee /tmp/build.log

The code I'm building is available inside the RedHat firewall via the command:

$ git clone http://gitolite.corp.redhat.com/cgit/it-sales/sfjavasuite.git/

Currently the repository has firefox listed in the Dockerfile.

Comment 4 Bill C. Riemers 2016-05-12 14:10:57 UTC
BTW.  I just tried the same test on RHEL6.   I am comforted by the fact, at least it produces the same error.   Which indicates it probably is not a bug with docker, but rather with the fedora images.  I tried a Fedora:22 base, with the same results.   Fedora:21 works after changing dnf to yum...   Indicating the problem is one of three things:
  1. Maven has been updated in Fedora 22 and Fedora 23 to introduce this dependancy.  (It as recently as a couple of months ago.)
  2. There has been some update to the standard docker images that adds this hidden dependancy.
  3. There is something in docker's fake dbus stuff that is adding the runtime dependency.

I can't think of any other possibilities, and I'm not sure how to isolate this down to which possibility this is.

Comment 5 Mikolaj Izdebski 2016-05-12 14:20:00 UTC
Please remove ANSI codes from logs, they make them unreadable. Then run Maven with -X switch to enable debugging output.

Comment 6 Bill C. Riemers 2016-05-12 14:27:33 UTC
I think I can reasonably rule out possibility 3.  The build works without firefox for Fedora:21, Centos, and even Ubuntu.  (OK, Ubuntu fails from the lack of rpm-build, but it makes it past the mvn clean command...)

If it was a fake dbus issue I would expect to effect pretty much any up to date linux image.

Comment 7 Michal Srb 2016-05-12 14:28:36 UTC
I think it might be the same issue as bug#1332456. Investigating.

Comment 8 Michal Srb 2016-05-12 14:46:13 UTC
I think this is the problem:

Step 4 : RUN dnf -y update --skip-broken ; dnf -y install maven git bzip2 rpm-build && dnf clean all
 ---> Running in 5997e11ebb4e
Last metadata expiration check performed 0:00:08 ago on Thu May 12 13:42:21 2016.
No match for argument: --skip-broken

So you don't really update packages in the image, and when you later install  firefox, it will also update nss package, because firefox depends on it. And because of bug#1332456, JDK sometimes throws java.lang.InternalError exception, if nss version doesn't match JDK's expectations.

Long story short, replacing following line in your Dockerfile:
RUN dnf -y update --skip-broken ; dnf -y install maven git bzip2 rpm-build firefox && dnf clean all
with this line: 
RUN dnf -y update && dnf -y install maven git bzip2 rpm-build && dnf clean all
should fix the issue.

Comment 9 Bill C. Riemers 2016-05-12 15:10:05 UTC
Created attachment 1156711 [details]
Build log without firefox on Fedora 23, with -X option and stripping color codes

Output of:

(docker build --no-cache --rm -t sfjavasuite-x . 2>&1) |tr '\r' '\n' |sed -r 's/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g'|tee /tmp/build.log

BTW.  I tried running with TERM=dumb, but both docker and maven ignore the terminal setting and produce color ansi regardless of the terminal being used.

Comment 10 Bill C. Riemers 2016-05-12 15:37:20 UTC
Interesting.  I had already tried adding the nss packages into the list.  In fact I added every package firefox depends on.   But without firefox itself, it still failed.   But perhaps I had a similar bug in that RUN line.

I've been tempting in the past just to leave the "dnf update -y" out completely.  The base image is usually fairly current, so strictly speaking it should not really be needed.  Looks like though it really is needed.

Thank you.


Note You need to log in before you can comment on or make changes to this bug.