Fetch favicon.ico failed with custom HOST var env set in GitLab CI MyST site deployment

Hi,

[repost from myst discord channel]
I try to deploy a MyST site with the GitLab CI/CD mechanism, but the VM always fails when the MyST server in the Docker image (Ubuntu) tries to fetch the « favicon.ico », whereas it succeeds in fetching all previous data.
I follow these settings according to this help.
Here is my gitlab-ci.yml :

default:
  image: ubuntu:rolling
variables:
  HOST: "127.0.0.1"
before_script:
  - apt-get update && apt-get install -y curl wget git pandoc npm
  - npm install -g mystmd
pages:
  stage: deploy
  script:
    - myst build --html --ci --keep-host
    - cp -ra _build/html/. public
    - echo "Votre document a été déployé à ce lien $CI_PAGES_URL"
  artifacts:
    paths:
      - public
  only:
    - main

and the Docker image errors :

🔌 Server started on port 3000!  🥳 🎉
    👉  http://127.0.0.1:3000  👈
💌 GET  /readme.json 200 - - 107.334 ms
💌 GET  /article.json 200 - - 104.935 ms
💌 GET  /article-1 200 - - 109.373 ms
GET /article 200 - - 105.587 ms
GET / 200 - - 118.208 ms
💌 GET  /robots.txt 200 - - 2.807 ms
💌 GET  /sitemap_style.xsl 200 - - 1.580 ms
GET /sitemap.xml 200 - - 7.233 ms
💌 GET  /myst-theme.css 200 - - 14.680 ms
[...]
💌 GET  /article-1 200 - - 109.373 ms
GET /article 200 - - 105.587 ms
[...]
⏳ Waiting for response from http://localhost:3000/favicon.ico
Fetch of http://localhost:3000/favicon.ico failed with HTTP status 404 for URL: http://localhost:3000/favicon.ico (Attempt #3)
Failed to fetch http://localhost:3000/favicon.ico after 3 attempts.
Myst CLI Versions:
 - node                        20.19.4     Required: >= 18.0.0      
 - npm                           9.2.0     Required: >=8.6.0        
 - myst                          1.8.0     

Anton_Akhmerov says « this is therefore unlikely related to your CI setup », but I can’t understand why the HOST var env is taken into account for major data and not for favicon.
Any ideas ?
arnome

It maybe a bit naive but have you tried putting favicon into html root, or if there is one have you checked it’s permissions?

Hi @spookster ,

Thank you for your reply. I don’t know whether this is relevant or not. As far as I know, when I use the command localy:

> myst build --ci --html
 

The file favicon.ico is present on the generated site on directory ./_build/html :

❯ ll _build/html/favicon.ico
-rw-rw-r-- 1 arnome arnome 41662 10 févr. 13:18 _build/html/favicon.ico

MyST server correctly fetches this file

💌 GET  /favicon.ico 200 - - 142.236 ms

But I will check on the Docker image.

Best regards,
arnome

Hi there,

This is weird because I try to build a Docker Image without GitLab with this configuration:

# syntax=docker/dockerfile:1
FROM ubuntu:rolling
# LABEL about the custom image
LABEL maintainer="arnaud.mounier@murena.io"
LABEL version="0.1"
LABEL description="This is a custom Docker Image for testing MySTmd."
# Disable Prompt During Packages Installation
ARG DEBIAN_FRONTEND=noninteractive
ENV HOST=127.0.0.1
# Update Ubuntu Software repository
RUN apt update
RUN apt upgrade -y
# Install mystmd from npm
RUN apt install -y curl wget git pandoc npm
RUN rm -rf /var/lib/apt/lists/*
RUN apt clean
RUN npm install -g mystmd
WORKDIR /site
RUN mkdir public
RUN chmod +r public
COPY *.md .
COPY myst.yml .
RUN myst build --html --ci --keep-host
RUN cp -ra _build/html/. public

And it’s working great… The site is generated correctly by the MyST server, and favicon.ico is present in public directory. So @Anton_Akhmerov is right (.gitlab-ci.yml misconfiguration), but I don’t know how to change it in the right way…

If someone has any ideas…
Best regards,

arnome

Hey @arnome-uBe, I’ve asked the jupyter book team before, and they are mostly not actively monitoring this discourse. Check out Community - Community Guide for the communication platforms. I myself am preoccupied with other things right now. I plan to return to hacking on JB in the near future, but I don’t have capacity to figure this out right now.

Hi @Anton_Akhmerov ,
Thanks for taking the time to post a quick response. No problemo, I ask on gitlab discourse and follow the doc you indicate but I post my problem to the MystMD Discord channel, and I have no response yet.
Good luck with your other things :wink:

Regards,

arnome