Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better error output for debugging #4258

Closed
xorinzor opened this issue Jul 4, 2020 · 9 comments
Closed

Better error output for debugging #4258

xorinzor opened this issue Jul 4, 2020 · 9 comments

Comments

@xorinzor
Copy link

xorinzor commented Jul 4, 2020

If your issue concerns a package not building, please report to
https://github.com/ocaml/opam-repository/issues or to the package maintainer
unless you are confident it is an issue in the opam tool itself.

When I use opam to install multiple packages & dependencies, it's not uncommon for one to fail because of whatever reason (most of the time because the package needs to be pinned to the repository).

But rather then just telling me which packages are the culprit, I get the most useless response that effectively just tells me the command failed, without providing any useful information at all.

Capture

It'd be really useful if this could be improved and could tell the user which packages (or dependencies) failed so we have more to go on.

@AltGr
Copy link
Member

AltGr commented Jul 4, 2020

The message "there seems to be a problem with your request" is a placeholder and generally symptom of a bug, normally there is more information.
It'd be really useful if you included the output of opam config report as the template advises: we don't even know what version of opam you are using!

Also note that there are --debug and --verbose (can be repeated) options for debug info.

@xorinzor
Copy link
Author

xorinzor commented Jul 4, 2020

Hm okay, wasn't aware that it would have been a bug. I had this earlier, and solved that one by just pinning another dependency to it's repository to use the newer version. Leading me to believe this just wasn't implemented properly.

Here's the information from opam config report:
Capture

I'm using a docker container based on debian 10, opam is installed from it's repository every time ensuring the latest version (at least the latest available to the repository) is used.

The steps that I run from my dockerfile are:

#Create the opam environment and install required packages
RUN opam init  --disable-sandboxing && \
	opam switch create 4.10.0

RUN sudo apt install -y libgstreamer-plugins-base1.0-dev libgstreamer1.0-dev gstreamer1.0-plugins-good gstreamer1.0-plugins-base gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly libx264-dev x264

RUN opam pin add -n duppy https://github.com/savonet/ocaml-duppy.git#master && \
	opam pin add -n mm https://github.com/savonet/ocaml-mm.git#master && \
	opam pin add -n gstreamer https://github.com/savonet/ocaml-gstreamer.git#master && \
	opam pin add -n liquidsoap https://github.com/savonet/liquidsoap.git#12f40c5

#For the github issue
#RUN opam config report ; exit 1

RUN opam depext alsa ao bjack camlimages cry dssi faad fdkaac ffmpeg flac frei0r gavl gd graphics lame lo mad magic ogg opus portaudio pulseaudio samplerate shine soundtouch ssl taglib theora vorbis xmlplaylist yojson liquidsoap && \
	opam install -y alsa ao bjack camlimages cry dssi faad fdkaac ffmpeg flac frei0r gavl gd graphics lame lo mad magic ogg opus portaudio pulseaudio samplerate shine soundtouch ssl taglib theora vorbis xmlplaylist yojson liquidsoap

I gave both --debug and --verbose a try too, although they do produce more output, it unfortunately doesn't tell me anything new.

Capture 2

@AltGr
Copy link
Member

AltGr commented Jul 4, 2020

That's weird... here is what I get (both with opam 2.0.3 and 2.0.7 (latest stable)):

The following dependencies couldn't be met:
  - alsa -> ocaml < 4.04.0
      base of this switch (use `--unlock-base' to force)
Your request can't be satisfied:
  - liquidsoap >= 2.0.0 is in conflict with alsa < 0.3.0

No solution found, exiting

Dockerfile used (for reference):

FROM debian:10

ADD https://github.com/ocaml/opam/releases/download/2.0.7/opam-2.0.7-x86_64-linux /usr/bin/opam
RUN chmod a+x /usr/bin/opam

RUN apt-get update && apt-get install -y curl patch unzip make gcc git

#Create the opam environment and install required packages
RUN opam init  --disable-sandboxing --bare && \
	opam switch create 4.10.0 --fake

# RUN sudo apt install -y libgstreamer-plugins-base1.0-dev libgstreamer1.0-dev gstreamer1.0-plugins-good gstreamer1.0-plugins-base gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly libx264-dev x264

RUN opam pin add -n duppy https://github.com/savonet/ocaml-duppy.git#master && \
	opam pin add -n mm https://github.com/savonet/ocaml-mm.git#master && \
	opam pin add -n gstreamer https://github.com/savonet/ocaml-gstreamer.git#master && \
	opam pin add -n liquidsoap https://github.com/savonet/liquidsoap.git#12f40c5

#For the github issue
#RUN opam config report ; exit 1

RUN opam install --show alsa ao bjack camlimages cry dssi faad fdkaac ffmpeg flac frei0r gavl gd graphics lame lo mad magic ogg opus portaudio pulseaudio samplerate shine soundtouch ssl taglib theora vorbis xmlplaylist yojson liquidsoap

@AltGr
Copy link
Member

AltGr commented Jul 4, 2020

Ah, I am noticing you seem to be using an external mccs solver, and not the builtin one. This might be where the issue stems from.

@xorinzor
Copy link
Author

xorinzor commented Jul 4, 2020

mccs solver? Doesn't ring a bell haha.

This is my full dockerfile right now (I copied some parameters how you used them to see if it makes a difference, but doesn't work. I do notice that you didn't do the depext step though)

FROM debian:10

ENV DEBIAN_FRONTEND=noninteractive

#Install required system packages and dependencies
RUN apt update && \
	apt install -y \
	apt-utils \
	apt-transport-https \
	curl \
	wget \
	dirmngr \
	sudo

# Create the liquidsoap user and add it to the sudoers group
RUN useradd -m liquidsoap && \
	adduser liquidsoap sudo && \
	echo 'liquidsoap	ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers

# Copy the new sources.list to make use of the "buster" repositories instead of "stretch"
COPY sources.list /etc/apt/sources.list

# Update the package list, upgrade existing packages, and install opam
RUN apt update && \
	apt upgrade -y && \
	apt install -y \
	opam \
	git \
	m4 \
	automake \
	pkg-config \
	libpcre3-dev

#Switch to liquidsoap user
USER liquidsoap

WORKDIR /home/liquidsoap

ENV OPAMYES=1

#Create the opam environment and install required packages
RUN opam init  --disable-sandboxing --bare && \
	opam switch create 4.10.0 --fake

RUN sudo apt install -y libgstreamer-plugins-base1.0-dev libgstreamer1.0-dev gstreamer1.0-plugins-good gstreamer1.0-plugins-base gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly libx264-dev x264

RUN opam pin add -n duppy https://github.com/savonet/ocaml-duppy.git#master && \
	opam pin add -n mm https://github.com/savonet/ocaml-mm.git#master && \
	opam pin add -n gstreamer https://github.com/savonet/ocaml-gstreamer.git#master && \
	opam pin add -n liquidsoap https://github.com/savonet/liquidsoap.git#12f40c5

RUN opam depext alsa ao bjack camlimages cry dssi faad fdkaac ffmpeg flac frei0r gavl gd graphics lame lo mad magic ogg opus portaudio pulseaudio samplerate shine soundtouch ssl taglib theora vorbis xmlplaylist yojson liquidsoap && \
	opam install -y alsa ao bjack camlimages cry dssi faad fdkaac ffmpeg flac frei0r gavl gd graphics lame lo mad magic ogg opus portaudio pulseaudio samplerate shine soundtouch ssl taglib theora vorbis xmlplaylist yojson liquidsoap

RUN eval $(opam config env)

ENTRYPOINT ["opam", "config", "exec", "--"]
CMD ["liquidsoap", "/home/liquidsoap/app/main.liq"]

@xorinzor
Copy link
Author

xorinzor commented Jul 5, 2020

So I've been trying things just to see at what point it stops giving that error.
At first I started removing packages from the depext and install step which had a lower version at https://opam.ocaml.org/packages/ then the version defined in the conflicts section from https://github.com/savonet/liquidsoap/blob/master/liquidsoap.opam

Ran it again, no change, same error.

Then I removed liquidsoap from the opam depext step, and it suddenly passed that step, but threw the same error on the opam install step.

Capture

I attached the dockerfile what it looks like now as a file, to prevent these lengthy comments.

Dockerfile.txt

EDIT: I removed liquidsoap from the install step too, and now I'm getting an actual error message that tells me what is failing, although it's too lengthy for me to place here since Dockstation (the program that I use) doesn't allow me to select and copy text.

Hopefully this helps in diagnosing this bug.

@AltGr
Copy link
Member

AltGr commented Jul 6, 2020

mccs solver? Doesn't ring a bell haha.

Ah, probably has to do with how Debian provides opam then, as I see you are installing from apt.
About my changes:

  • the error is with the call to the solver, which is expected to be the same with depext and the next call, which is why I simplified away the call to depext.
  • don't use --fake, I put it in to get directly to the solver error since I was not interested in actually compiling the packages, but outside of debugging you won't get anything useful with it present.

As a workaround, I would suggest you try to get your opam binary directly from https://github.com/ocaml/opam/releases/download/2.0.7/opam-2.0.7-x86_64-linux instead of apt, while we investigate the issue.

@xorinzor
Copy link
Author

xorinzor commented Jul 6, 2020

@AltGr I did end up fixing the issue for myself once I got some error output, so that's solved :)
I'll just leave this issue here as a bug report

@dra27
Copy link
Member

dra27 commented Jul 8, 2021

I think this will have been resolved as part of the myriad changes in 2.1.0 for integrated depext along with various solver improvements. Please re-open if necessary!

@dra27 dra27 closed this as completed Jul 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants