Skip to content

Broken Slack yarn.lock

Since, at latest, March 15, Github doesn't support git:// url. Unfortunatly for this repo, at least the package discord-markdown still use this protocol in the file yarn.lock.

This makes the repository impossible to build :

$ docker build . -f ./docker/Dockerfile-slack -t localhost/beeper/mx-puppet-monorepo/slack:broken
Sending build context to Docker daemon   9.39MB
Step 1/19 : FROM node:14-alpine AS builder
 ---> 83c989be17a9
Step 2/19 : WORKDIR /opt/mx-puppet-slack
 ---> Using cache
 ---> a65e94d0ce2a
Step 3/19 : RUN apk --no-cache add git python2 make g++ pkgconfig     build-base     cairo-dev     jpeg-dev     pango-dev     musl-dev     giflib-dev     pixman-dev     pangomm-dev     libjpeg-turbo-dev     freetype-dev
 ---> Using cache
 ---> e205e127b5b5
Step 4/19 : RUN chown -R node:node /opt/mx-puppet-slack
 ---> Using cache
 ---> f5c0d4b03fc4
Step 5/19 : USER node
 ---> Using cache
 ---> cb8d8aa66404
Step 6/19 : COPY --chown=node:node package.json yarn.lock ./
 ---> Using cache
 ---> 8943554b522c
Step 7/19 : COPY --chown=node:node packages/ ./packages
 ---> Using cache
 ---> ecb68c1a18b8
Step 8/19 : RUN yarn && cd packages/mx-puppet-slack && yarn build
 ---> Running in 56d675c4b4be
yarn install v1.22.17
[1/5] Validating package.json...
[2/5] Resolving packages...
[3/5] Fetching packages...
error Command failed.
Exit code: 128
Command: git
Arguments: ls-remote --tags --heads git://github.com/Sorunome/discord-markdown.git
Directory: /opt/mx-puppet-slack
Output:
fatal: remote error: 
  The unauthenticated git protocol on port 9418 is no longer supported.
Please see https://github.blog/2021-09-01-improving-git-protocol-security-github/ for more information.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
The command '/bin/sh -c yarn && cd packages/mx-puppet-slack && yarn build' returned a non-zero code: 128

A simple workaround is to re-generate this file (as it's auto-generated and yarnpkg.com did update all those references).


For those finding this issue and looking for a quick dirty fix, you can run this command to just change this broken protocol : $ sed -i "s/\"git:/\"https:/g" yarn.lock

After that, the docker build works just fine 👍