Calling Developers!
We are reenergizing our code contribution process! Learn More

What are the Slack Archives?

It’s a history of our time together in the Slack Community! There’s a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.

Because this space is not active, you won’t be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..

I'm trying to get started with Spryker with the Bootcamp but got stuck in the docker build process w

Options
U01B83B010S
U01B83B010S Posts: 10 🧑🏻‍🚀 - Cadet
edited September 2020 in Docker

I'm trying to get started with Spryker with the Bootcamp but got stuck in the docker build process with npm. I have Windows with WSL (Ubuntu 18.04). When building the docker images the npm install fails due to missing python.
To isolate the issue:

$ docker/sdk cli npm install
Warning: Neither SSH agent or COMPOSER_AUTH is configured. Private repositories would not be accessible.



  node-sass@4.10.0 install /data/node_modules/@spryker/oryx-for-zed/node_modules/node-sass

Comments

  • sprymiker
    sprymiker Cloud Platform Architect Sprykee Posts: 781 🧑🏻‍🚀 - Cadet
    Options

    Please, use latest B2C demoshop OR adjust deploy.yml you use according the following:

    image:
      tag: spryker/php:7.3-alpine3.10
    
  • sprymiker
    sprymiker Cloud Platform Architect Sprykee Posts: 781 🧑🏻‍🚀 - Cadet
    Options

    It is incompatibility of some npm modules with alpine 3.12.

  • U01B83B010S
    U01B83B010S Posts: 10 🧑🏻‍🚀 - Cadet
    edited September 2020
    Options

    Thanks that works. But not for too long. A docker command seems to fail and afterwards unison:

    ok  Starting unison for sync spryker_b2c_dev_dev_data_sync
              ok  spryker_b2c_dev_dev_data_sync container not running
              ok  Starting precopy
         precopy  docker run --rm -v "spryker_b2c_dev_dev_data_sync:/app_sync" -e APP_VOLUME=/app_sync -e TZ=$(basename $(dirname `readlink /etc/localtime`))/$(basename `readlink /etc/localtime`) -e UNISON_SRC="-socket 5000" -e UNISON_DEST="/app_sync" -e MONIT_ENABLE="false" -e MONIT_INTERVAL="" -e MONIT_HIGH_CPU_CYCLES="" -e UNISON_ARGS="-ignore='Path .git' -ignore='Path docker' -ignore='Path data/*/cache' -ignore='Name .docker-sync' -ignore='Name .idea' -ignore='Name .project' -ignore='Name *.log' -ignore='Name node_modules' -ignore='Name .composer' -ignore='Name .npm'" -e UNISON_WATCH_ARGS="" -e OWNER_UID="1000" -e HOSTSYNC_ENABLE="0" -e UNISONSOCKET_ENABLE="1"  --name spryker_b2c_dev_dev_data_sync eugenmayer/unison:2.51.2.2 /usr/local/bin/precopy_appsync
    dirname: missing operand
    Try 'dirname --help' for more information.
    basename: missing operand
    Try 'basename --help' for more information.
    basename: missing operand
    Try 'basename --help' for more information.
    doing initial sync with unison
    Unison 2.51.2 (ocaml 4.08.1): Contacting server...
    Looking for changes
    Reconciling changes
    Propagating updates
    UNISON 2.51.2 (OCAML 4.08.1) started propagating changes at 11:51:04.47 on 30 Sep 2020
    [BGN] Copying  from /app_sync to /host_sync
    [END] Copying
    UNISON 2.51.2 (OCAML 4.08.1) finished propagating changes at 11:51:04.47 on 30 Sep 2020
    Saving synchronizer state
    Synchronization complete at 11:51:04  (1 item transferred, 0 skipped, 0 failed)
    real    0m 0.30s
    user    0m 0.10s
    sys     0m 0.03s
    chown ing file to uid 1000
              ok  creating spryker_b2c_dev_dev_data_sync container
         command  docker run -p '127.0.0.1::5000' -v spryker_b2c_dev_dev_data_sync:/app_sync -e APP_VOLUME=/app_sync -e TZ=$(basename $(dirname `readlink /etc/localtime`))/$(basename `readlink /etc/localtime`) -e UNISON_SRC="-socket 5000" -e UNISON_DEST="/app_sync" -e MONIT_ENABLE="false" -e MONIT_INTERVAL="" -e MONIT_HIGH_CPU_CYCLES="" -e UNISON_ARGS="-ignore='Path .git' -ignore='Path docker' -ignore='Path data/*/cache' -ignore='Name .docker-sync' -ignore='Name .idea' -ignore='Name .project' -ignore='Name *.log' -ignore='Name node_modules' -ignore='Name .composer' -ignore='Name .npm'" -e UNISON_WATCH_ARGS="" -e OWNER_UID="1000" -e HOSTSYNC_ENABLE="0" -e UNISONSOCKET_ENABLE="1"  --name spryker_b2c_dev_dev_data_sync -d eugenmayer/unison:2.51.2.2
    dirname: missing operand
    Try 'dirname --help' for more information.
    basename: missing operand
    Try 'basename --help' for more information.
    basename: missing operand
    Try 'basename --help' for more information.
              ok  starting initial sync of spryker_b2c_dev_dev_data_sync
         command  docker inspect --format='{{(index (index .NetworkSettings.Ports "5000/tcp") 0).HostPort}}' spryker_b2c_dev_dev_data_sync
         command  unison -testserver /app_sync "<socket://127.0.0.1:32773>"
         command  docker inspect --format='{{(index (index .NetworkSettings.Ports "5000/tcp") 0).HostPort}}' spryker_b2c_dev_dev_data_sync
         command  unison -ignore='Path .git' -ignore='Path docker' -ignore='Path data/*/cache' -ignore='Name .docker-sync' -ignore='Name .idea' -ignore='Name .project' -ignore='Name *.log' -ignore='Name node_modules' -ignore='Name .composer' -ignore='Name .npm' '/c/dev/spryker/b2c-demo-shop' -auto -batch -prefer '/c/dev/spryker/b2c-demo-shop' -copyonconflict -force newer -perms=0 <socket://127.0.0.1:32773>
           error  Error starting sync, exit code 0
         message  Warning: No archive files were found for these roots, whose canonical names are:
            /c/dev/spryker/b2c-demo-shop
            //38584cb85bda//app_sync
    This can happen either
    because this is the first time you have synchronized these roots,
    or because you have upgraded Unison to a new version with a different
    archive format.
    
    Update detection may take a while on this run if the replicas are
    large.
    
    Unison will assume that the 'last synchronized state' of both replicas
    was completely empty.  This means that any files that are different
    will be reported as conflicts, and any files that exist only on one
    replica will be judged as new and propagated to the other replica.
    If the two replicas are identical, then no changes will be reported.
    
    If you see this message repeatedly, it may be because one of your machines
    is getting its address from DHCP, which is causing its host name to change
    between synchronizations.  See the documentation for the UNISONLOCALHOSTNAME
    environment variable for advice on how to correct this.
    
    Donations to the Unison project are gratefully accepted:
    <http://www.cis.upenn.edu/~bcpierce/unison>
    
    
         message  Unison 2.51.2 (ocaml 4.06.0): Contacting server...
    Connected [//38584cb85bda//app_sync -> //XDP0128//c/dev/spryker/b2c-demo-shop]
    Looking for changes
      Waiting for changes from server
    Fatal error: Fatal error during unmarshaling (input_value: ill-formed message),
    possibly because client and server have been compiled with differentversions of the OCaml compiler.
         success  Unison server started
         command  docker inspect --format='{{(index (index .NetworkSettings.Ports "5000/tcp") 0).HostPort}}' spryker_b2c_dev_dev_data_sync
         command  unison -ignore='Path .git' -ignore='Path docker' -ignore='Path data/*/cache' -ignore='Name .docker-sync' -ignore='Name .idea' -ignore='Name .project' -ignore='Name *.log' -ignore='Name node_modules' -ignore='Name .composer' -ignore='Name .npm' '/c/dev/spryker/b2c-demo-shop' -auto -batch -prefer '/c/dev/spryker/b2c-demo-shop' -copyonconflict -force newer -perms=0 <socket://127.0.0.1:32773>
           error  Error starting sync, exit code 0
         message  Warning: No archive files were found for these roots, whose canonical names are:
            /c/dev/spryker/b2c-demo-shop
            //38584cb85bda//app_sync
    This can happen either
    because this is the first time you have synchronized these roots,
    or because you have upgraded Unison to a new version with a different
    archive format.
    
    Update detection may take a while on this run if the replicas are
    large.
    
    Unison will assume that the 'last synchronized state' of both replicas
    was completely empty.  This means that any files that are different
    will be reported as conflicts, and any files that exist only on one
    replica will be judged as new and propagated to the other replica.
    If the two replicas are identical, then no changes will be reported.
    
    If you see this message repeatedly, it may be because one of your machines
    is getting its address from DHCP, which is causing its host name to change
    between synchronizations.  See the documentation for the UNISONLOCALHOSTNAME
    environment variable for advice on how to correct this.
    
    Donations to the Unison project are gratefully accepted:
    <http://www.cis.upenn.edu/~bcpierce/unison>
    
    
         message  Unison 2.51.2 (ocaml 4.06.0): Contacting server...
    Connected [//38584cb85bda//app_sync -> //XDP0128//c/dev/spryker/b2c-demo-shop]
    Looking for changes
      Waiting for changes from server
    Fatal error: Fatal error during unmarshaling (input_value: ill-formed message),
    possibly because client and server have been compiled with differentversions of the OCaml compiler.
         success  Starting Docker-Sync in the background
    Creating network "spryker_b2c_dev_private" with the default driver
    Creating network "spryker_b2c_dev_public" with the default driver
    Creating volume "spryker_b2c_dev_database-postgres-data" with default driver
    Creating volume "spryker_b2c_dev_broker-rabbitmq-data" with default driver
    Creating volume "spryker_b2c_dev_session-redis-data" with default driver
    Creating volume "spryker_b2c_dev_key_value_store-redis-data" with default driver
    Creating volume "spryker_b2c_dev_search-elastic-data" with default driver
    Creating volume "spryker_b2c_dev_scheduler-jenkins-data" with default driver
    Creating volume "spryker_b2c_dev_mail_catcher-mailhog-data" with default driver
    Creating volume "spryker_b2c_dev_swagger-swagger-ui-data" with default driver
    Creating volume "spryker_b2c_dev_redis-gui-redis-commander-data" with default driver
    Creating volume "spryker_b2c_dev_dashboard-dashboard-data" with default driver
    Creating volume "spryker_b2c_dev_ssh-relay" with default driver
    Creating volume "spryker_b2c_dev_logs" with default driver
    Creating volume "spryker_b2c_dev_cli_history" with default driver
    Pulling cli_ssh_relay (bpack/socat:)...
    latest: Pulling from bpack/socat
    ff3a5c916c92: Pull complete
    57b99ab2bf88: Pull complete
    Digest: sha256:ceab1a1913803f15d0893d08e657e2bcb12c2a1fec68b67e44a43ebe2c4ab535
    Status: Downloaded newer image for bpack/socat:latest
    Creating spryker_b2c_dev_cli_1           ... done
    Creating spryker_b2c_dev_cli_ssh_relay_1 ... done
    chmod: cannot access '/data/config/Zed/*.key': No such file or directory
    Composer could not find a composer.json file in /data
    To initialize a project, please create a composer.json file as described in the <https://getcomposer.org/> "Getting Started" section
    
  • sprymiker
    sprymiker Cloud Platform Architect Sprykee Posts: 781 🧑🏻‍🚀 - Cadet
    Options

    Fatal error during unmarshaling means the version of unison and/or OCAML is different on host and in docker-sync container.

  • U01B83B010S
    U01B83B010S Posts: 10 🧑🏻‍🚀 - Cadet
    Options

    I used the one from the tutorial - https://documentation.spryker.com/docs/docker-installation-prerequisites-windows. That's the last stable version as far as I can see from the releases.
    How can I open a terminal to the docker-sync container to compare the versions?

  • Valerii Trots
    Valerii Trots SRE @ Spryker Sprykee Posts: 1,654 ✨ - Novice
    edited September 2020
    Options

    I had the same error back when I was trying with WSL1 and older version of the Windows.

    Our developers couldn't reproduce it though.

    I gave up as I haven't found any solution to this problem except switching either to vagrant devvm or update Windows and use WSL2 wihtout docker-sync but working with remote folders from WSL2 in the IDE (VSCode or PHPStorm).

  • sprymiker
    sprymiker Cloud Platform Architect Sprykee Posts: 781 🧑🏻‍🚀 - Cadet
    Options

    I have a solution.

  • sprymiker
    sprymiker Cloud Platform Architect Sprykee Posts: 781 🧑🏻‍🚀 - Cadet
    edited September 2020
    Options
    1. Check local versions of Unison and OCAML
    2. Build docker-sync images with specific version you have (replace with the correct versions):
    git clone git@github.com:EugenMayer/docker-image-unison.git /tmp/docker-image-unison
    cd /tmp/docker-image-unison
    docker build --build-arg "OCAML_VERSION=4.06.0" --build-arg "UNISON_VERSION=2.51.2" -t custom-docker-image-unison .
    cd -
    rm -rf /tmp/docker-image-unison
    
    1. Change deploy.dev.yml file accordingly:
    ...
    docker:
    ...
      mount:
        docker-sync:
        ...
          image: custom-docker-image-unison
    
    1. Boot + up
    docker/sdk boot deploy.dev.yml && docker/sdk up
    
  • U01B83B010S
    U01B83B010S Posts: 10 🧑🏻‍🚀 - Cadet
    Options

    sorry - took some time to allow the direct access to alpinelinux.org with ssl. Builing docker-sync image fails:

    caml-4.06.0/byterun/caml/major_gc.h:68: first defined here
    #5 36.25 /usr/lib/gcc/x86_64-alpine-linux-musl/10.2.0/../../../../x86_64-alpine-linux-musl/bin/ld: main.pic.o:/tmp/ocaml-4.06.0/byterun/caml/major_gc.h:67: multiple definition of `caml_major_ring'; interp.pic.o:/tmp/ocaml-4.06.0/byterun/caml/major_gc.h:67: first defined here
    #5 36.31 collect2: error: ld returned 1 exit status
    #5 36.31 make[1]: *** [Makefile:202: libcamlrun_shared.so] Error 1
    #5 36.31 make: *** [Makefile:384: coldstart] Error 2
    #5 36.31 make[1]: Leaving directory '/tmp/ocaml-4.06.0/byterun'
    ------
    failed to solve with frontend dockerfile.v0: failed to build LLB: executor failed running [/bin/sh -c apk update     && apk add --no-cache --virtual .build-deps build-base coreutils                                         && wget <http://caml.inria.fr/pub/distrib/ocaml-${OCAML_VERSION:0:4}/ocaml-${OCAML_VERSION}.tar.gz>        && tar xvf ocaml-${OCAML_VERSION}.tar.gz -C /tmp                                                                      && cd /tmp/ocaml-${OCAML_VERSION}     && ./configure     && make world     && make opt     && umask 022     && make install     && make clean     && apk del .build-deps                                                       && rm -rf /tmp/ocaml-${OCAML_VERSION}    && rm /ocaml-${OCAML_VERSION}.tar.gz]: runc did not terminate sucessfully
    
  • sprymiker
    sprymiker Cloud Platform Architect Sprykee Posts: 781 🧑🏻‍🚀 - Cadet
    Options

    What versions do you build?

  • U01B83B010S
    U01B83B010S Posts: 10 🧑🏻‍🚀 - Cadet
    Options

    Exaktly your example OCAML 4.06.0 and Unison 2.51.2 -> both are the ones used in my Ubuntu 18.04 (Windows Subsystem)

  • sprymiker
    sprymiker Cloud Platform Architect Sprykee Posts: 781 🧑🏻‍🚀 - Cadet
    Options

    I tried it and the error seems to be the same.

    However we do this according the docs: https://github.com/EugenMayer/docker-image-unison

  • sprymiker
    sprymiker Cloud Platform Architect Sprykee Posts: 781 🧑🏻‍🚀 - Cadet
    edited October 2020
    Options

    They use OCAML 4.08.1 by default now.

  • U01B83B010S
    U01B83B010S Posts: 10 🧑🏻‍🚀 - Cadet
    Options

    I tried to use OCAML 4.08.1 on the Ubunutu instance -> it doesn't compile.

  • U01B83B010S
    U01B83B010S Posts: 10 🧑🏻‍🚀 - Cadet
    Options
    File "/home/userxy/unison-2.51.2/src/system.ml", line 1:
    Error: The implementation /home/userxy/unison-2.51.2/src/system.ml
           does not match the interface system.cmi:
           Values do not match:
             val link : ?follow:bool -> string -> string -> unit
    
  • U01B83B010S
    U01B83B010S Posts: 10 🧑🏻‍🚀 - Cadet
    Options

    Should I have just built the docker-sync with the newer ocaml version?

  • sprymiker
    sprymiker Cloud Platform Architect Sprykee Posts: 781 🧑🏻‍🚀 - Cadet
    Options

    Yes. That’s all. However I cannot build it by myself with any variants of versions.

  • U01B83B010S
    U01B83B010S Posts: 10 🧑🏻‍🚀 - Cadet
    Options

    Should I try to get the WSL2 to avoid this issue?

  • sprymiker
    sprymiker Cloud Platform Architect Sprykee Posts: 781 🧑🏻‍🚀 - Cadet
    Options

    I doubt it may have difference, OCAML/Unison would be the same. You can try mutagen.io instead.

    Download and install:
    https://github.com/mutagen-io/mutagen/releases/tag/v0.12.0-beta2

    in deploy.yml

    mount:
      mutagen:
    
  • U01B83B010S
    U01B83B010S Posts: 10 🧑🏻‍🚀 - Cadet
    Options

    Thanks for your support. I managed to get the tag 202009.0 up and running. As the update to WSL2 is recommended everywhere I updated Windows and use now WSL2. I guess as docker now also uses the WSL2 subsystem there is no incompatibility.