gitcoinco / web

Grow Open Source
https://gitcoin.co
Other
1.78k stars 773 forks source link

cannot run docker-compose up --build #5549

Closed Fatima-yo closed 4 years ago

Fatima-yo commented 4 years ago

Describe the bug While trying to get the local docker repo up and running, I get to the step when I must run " docker-compose up --build" and I get and error.

To Reproduce

  1. follow the instructions here: https://docs.gitcoin.co/mk_setup/
  2. until you run the following: docker-compose up --build

Expected behavior The docker container should start up.

Screenshots I get the following error displayed on the console: ERROR: unsatisfiable constraints: so:libheif.so.1 (missing): required by: vips-8.8.3-r2[so:libheif.so.1] vips-8.8.3-r2[so:libheif.so.1] vips-8.8.3-r2[so:libheif.so.1] ERROR: Service 'web' failed to build: The command '/bin/sh -c apk add --no-cache --update $PACKAGES && apk add --no-cache --update --repository http://dl-cdn.alpinelinux.org/alpine/edge/community/ vips && apk add --no-cache --update --virtual .builder $BUILD_DEPS' returned a non-zero code: 2

Desktop (please complete the following information):

mul1sh commented 4 years ago

Same here running into the same issue

Seems to be an issue with the vips package i.e.

# Install general dependencies.
RUN apk add --no-cache --update $PACKAGES && \
    apk add --no-cache --update --repository http://dl-cdn.alpinelinux.org/alpine/edge/community/ vips && \
    apk add --no-cache --update --virtual .builder $BUILD_DEPS

So maybe if we remove this, it will work, what do you think? Thanks

Korridzy commented 4 years ago

There is a good solution for this issue. The vips package will be installed from community repo and libheif from main.

I'm preparing a PR with this solution. @mul1sh, you can use it to unblock your work on #5281 meanwhile:

# Install general dependencies.
RUN apk add --no-cache --update $PACKAGES && \
apk add --no-cache --update --repository http://dl-cdn.alpinelinux.org/alpine/edge/main/ --repository http://dl-cdn.alpinelinux.org/alpine/edge/community/ vips && \
apk add --no-cache --update --virtual .builder $BUILD_DEPS
Fatima-yo commented 4 years ago

Thank you ! Waiting for it.

mul1sh commented 4 years ago

@Korridzy thanks, this seems to work though now it's hanging at the installing vips command i.e. Installing vips (8.8.3-r2) i've restarted the installation severally with no luck :(

Korridzy commented 4 years ago

Yes, it looks like problem is a bit more complex. Containers were created succesfully in my environment. But 'web', 'scheduler' and 'worker' now can't start with similar messages like:

OSError: cannot load library 'libvips.so.42': Error relocating /usr/lib/libheif.so.1: _ZNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEEC1Ev: symbol not found.  Additionally, ctypes.util.find_library() did not manage to locate a library called 'libvips.so.42'
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/pyvips/__init__.py", line 19, in <module>
    import _libvips
ModuleNotFoundError: No module named '_libvips'

Investigation is in process

octavioamu commented 4 years ago

probably related https://github.com/alpinelinux/docker-alpine/issues/49

octavioamu commented 4 years ago

Our problem https://gitlab.alpinelinux.org/alpine/aports/issues/10962

https://travis-ci.org/gitcoinco/web/jobs/617023755#L389

octavioamu commented 4 years ago

the blame commit https://github.com/alpinelinux/aports/commit/2f6bc1cb9b406078ebc8e9621231a50159680dd9

octavioamu commented 4 years ago

ok seems this worked, https://github.com/gitcoinco/web/pull/5553 you can try that changes locally until we figure out a better solution

mul1sh commented 4 years ago

@octavioamu thanks for the follow-up and the Dockerfile update, but still no luck in getting this work even with the command updates. I'm now getting the following error

ERROR: Command errored out with exit status 1:
   command: /usr/local/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-2iyl7n63/secp256k1/setup.py'"'"'; __file__='"'"'/tmp/pip-install-2iyl7n63/secp256k1/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-63nn0nwo --python-tag cp37
       cwd: /tmp/pip-install-2iyl7n63/secp256k1/
  Complete output (210 lines):
...
  ERROR: Failed building wheel for secp256k1

I think its because of the alpine update.

octavioamu commented 4 years ago

@mul1sh I think you tested #5554 not #5553

mul1sh commented 4 years ago

@octavioamu Yes I did because #5554 was merged into the repo whereas #5553 was closed. Anyway thanks for the heads up, let me test again with #5553

thelostone-mc commented 4 years ago

sorry about that @mul1sh ! goofup at my end

@Fatima-yo could you pull in master and try again ! Hopefully that should work

Fatima-yo commented 4 years ago

Yes, will do and let you know the results here.

mul1sh commented 4 years ago

@thelostone-mc no worries, thanks for the update 🙂 . I'll test later today then.

thelostone-mc commented 4 years ago

UPDATE: this still seems to be an issue ! mind giving us a day to figure it out ? I've been trying to build my container all day 😅

Fatima-yo commented 4 years ago

OK waiting for your ready-steady-go signal

thelostone-mc commented 4 years ago

@Fatima-yo + @mul1sh So I've got a working setup over at https://github.com/gitcoinco/web/pull/5558. This has been merged in so pull in the latest and rebuild the container.

Figuring out the breaking dependencies wasn't easy and every combination we tried had some issues with it. Ended up shifting to ubuntu image as opposed to alpine and tested it locally and it works ^_^ It takes a while longer to build but it's a one time setup so meh :P

Fatima-yo commented 4 years ago

Great! And funny also, as Ubuntu is my favorite, I run Xubuntu and Ubuntu Studio currently (plus Lubuntu a while ago and now LinuxLite in a small machine I use for YouTube only)

thelostone-mc commented 4 years ago

When you do get the time , could you pull in the latest master branch and rebuild the container. If it's good -> I'll go ahead and close this issue

Thanks for reporting it and being super patient ^_^

Fatima-yo commented 4 years ago

Yeah will do Not sure if today (almost going to sleep and still got a few issues to close) but tomorrow early morning

Fatima-yo commented 4 years ago

Looks like it is working now :-D Something like an error message in first screenshot but not sure, I let it in your competent hands Screenshot_2019-11-29_16-51-21 Screenshot_2019-11-29_17-45-15 Screenshot_2019-11-29_17-51-48 Anything else to try?

Fatima-yo commented 4 years ago

@thelostone-mc kindly check my last comment and tell me if I should test anything else. Looks as everything is good now.

mul1sh commented 4 years ago

No luck for me 😭 , it always exits with an error as shown below. And this after trying to build the image more than 5 times

Screenshot 2019-11-30 at 5 21 58 PM
Fatima-yo commented 4 years ago

@mul1sh are you sure about having the latest docker version? I installed it following these instructions: https://docs.docker.com/install/linux/docker-ce/ubuntu/

octavioamu commented 4 years ago

@mul1sh be sure you run a fresh installation docker-compose down -v; docker-compose up -d --build;

mul1sh commented 4 years ago

@Fatima-yo Yep i'm using the latest docker version 2.10.5

@octavioamu Yes i'm aslo running a fresh installation, infact i'm purging the old containers at every retry and clearing my cache just in case, but no luck it always fails at the above line.

octavioamu commented 4 years ago

As I see on the error seems you are under some vpn or something on your network is blocking the connection. If you have a vpn try using it. Or not sure if your up is fixed, try to reload your modem to see if with another up works

mul1sh commented 4 years ago

@octavioamu ok let me try switching ISP's and see if it helps, thanks

Fatima-yo commented 4 years ago

@thelostone-mc kindly let me know when should I close this issue

thelostone-mc commented 4 years ago

@Fatima-yo SOLIDD :D ❤️ Sorry I was with family and hence stayed away from github over the weekend

We are good to close the issue ! Apologize for the rough start but I hope it's smooth sailing from here on :D

@mul1sh I've gotten that error cause of network being blocked ! Use a VPN like @octavioamu and it should be a breeze

Fatima-yo commented 4 years ago

I am closing issue as it was resolved

octavioamu commented 4 years ago

@mul1sh were you able to solve your problem?

mul1sh commented 4 years ago

@octavioamu I was 🙂, thanks.