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

Some static files in Magento 2 sporadically result in net::ERR_FAILED #1792

Open
jaybeckr opened this issue Aug 22, 2023 · 4 comments
Open

Comments

@jaybeckr
Copy link

Description

When running Magento 2 (Adobe Commerce) in Docksal, static assets sometimes return net::ERR_FAILED rather than loading the asset. Opening the asset in a new tab, or refreshing the page will typically load fine. Refreshing the page sometimes has dozens of these, sometimes none, so it seems like it's happening in the infrastructure rather than a code issue. The same codebases work fine on other hosting environments, local docker based ones such as Den (Warden) or hosting env with apache or nginx.

Much of the time these are simple .gif files that do not impact usage of the site, but when they are js files then it causes numerous issues of course.

I tried both with the default stack as well as the platformsh stack to try nginx. Looking in the logs when I am getting a failure shows 200 response for the assets that are failing to load.

Also note that with Drupal 10 I see more network requests happening than with Magento, but they all succeed. Additionally, the Magento system for static assets routes them through a php process to handle asset versioning/cache busting and 404s, so possible that is the difference here?

Steps to reproduce the issue:

  1. Set up a Magento 2 site with sample data and the "default" stack
  2. Load a page, notably admin pages such as the customer grid
  3. Look in the network tab, or console for various static assets giving a net::ERR_FAILED response instead of loading
  4. Refresh, and observe less, or more, or different files doing the same thing

Describe the results you received:

Misc assets fail to load, differing on each page load.

Describe the results you expected:

All static assets load even time.

Output of fin config:

fin config output
$ fin config
---------------------
COMPOSE_PROJECT_NAME_SAFE: amzn-mftf-docksal
COMPOSE_FILE:
/home/jaybeckr/.docksal/stacks/volumes-bind.yml
/home/jaybeckr/.docksal/stacks/stack-platformsh.yml
/home/jaybeckr/dev/sites/amzn-mftf-docksal/.docksal/docksal.yml
/home/jaybeckr/dev/sites/amzn-mftf-docksal/.docksal/docksal-local.yml
ENV_FILE:
/home/jaybeckr/dev/sites/amzn-mftf-docksal/.docksal/docksal.env

PROJECT_ROOT: /home/jaybeckr/dev/sites/amzn-mftf-docksal
DOCROOT: pub
VIRTUAL_HOST: amzn-mftf-docksal.docksal.site
VIRTUAL_HOST_ALIASES: *.amzn-mftf-docksal.docksal.site
IP: 192.168.64.100

MySQL endpoint: 192.168.64.100:32776
Public URL:

Docker Compose configuration
---------------------
name: amzn-mftf-docksal
services:
  browser:
    dns:
    - 8.8.8.8
    - 9.9.9.9
    hostname: browser
    image: selenium/standalone-chrome-debug
    networks:
      default: null
    ports:
    - mode: ingress
      target: 5900
      published: "5900"
      protocol: tcp
  cli:
    dns:
    - 8.8.8.8
    - 9.9.9.9
    environment:
      BLACKFIRE_CLIENT_ID: null
      BLACKFIRE_CLIENT_TOKEN: null
      COMPOSER_ALLOW_XDEBUG: "0"
      COMPOSER_DEFAULT_VERSION: "2"
      COMPOSER_DISABLE_XDEBUG_WARN: "0"
      DOCROOT: pub
      DRUSH_ALLOW_XDEBUG: "0"
      DRUSH_OPTIONS_URI: amzn-mftf-docksal.docksal.site
      GIT_USER_EMAIL: jay@beargroup.com
      GIT_USER_NAME: Jay Becker
      HOST_GID: "1000"
      HOST_UID: "1000"
      META_PACKAGE: magento/project-enterprise-edition
      META_VERSION: 2.4.5-p1
      MYSQL_DATABASE: default
      MYSQL_HOST: db
      MYSQL_PASSWORD: user
      MYSQL_ROOT_PASSWORD: root
      MYSQL_USER: user
      PHP_IDE_CONFIG: serverName=amzn-mftf-docksal.docksal.site
      SECRET_ACQUIA_CLI_KEY: null
      SECRET_ACQUIA_CLI_SECRET: null
      SECRET_PLATFORMSH_CLI_TOKEN: null
      SECRET_SSH_PRIVATE_KEY: null
      SECRET_TERMINUS_TOKEN: null
      SSH_AUTH_SOCK: /.ssh-agent/proxy-socket
      VIRTUAL_HOST: amzn-mftf-docksal.docksal.site
      XDEBUG_CONFIG: client_host=192.168.64.1
      XDEBUG_ENABLED: "0"
    extends:
      file: /home/jaybeckr/.docksal/stacks/services.yml
      service: cli
    hostname: cli
    healthcheck:
      interval: 10s
    image: docksal/cli:php8.1-3
    labels:
      io.docksal.shell: bash
      io.docksal.user: docker
    logging:
      options:
        max-file: "10"
        max-size: 1m
    networks:
      default: null
    volumes:
    - type: volume
      source: docksal_ssh_agent
      target: /.ssh-agent
      read_only: true
      volume: {}
    - type: volume
      source: cli_home
      target: /home/docker
      volume: {}
    - type: bind
      source: /tmp/.docksal/amzn-mftf-docksal
      target: /tmp/.docksal/amzn-mftf-docksal
      read_only: true
      bind:
        create_host_path: true
    - type: volume
      source: project_root
      target: /var/www
      volume:
        nocopy: true
  db:
    dns:
    - 8.8.8.8
    - 9.9.9.9
    environment:
      MYSQL_ALLOW_EMPTY_PASSWORD: null
      MYSQL_DATABASE: default
      MYSQL_INITDB_SKIP_TZINFO: null
      MYSQL_ONETIME_PASSWORD: null
      MYSQL_PASSWORD: user
      MYSQL_RANDOM_ROOT_PASSWORD: null
      MYSQL_ROOT_PASSWORD: root
      MYSQL_USER: user
    extends:
      file: /home/jaybeckr/.docksal/stacks/services.yml
      service: mariadb
    hostname: db
    healthcheck:
      interval: 10s
    image: docksal/mariadb:10.4
    logging:
      options:
        max-file: "10"
        max-size: 1m
    networks:
      default: null
    ports:
    - mode: ingress
      target: 3306
      protocol: tcp
    volumes:
    - type: volume
      source: db_data
      target: /var/lib/mysql
      volume: {}
    - type: volume
      source: project_root
      target: /var/www
      read_only: true
      volume:
        nocopy: true
  elasticsearch:
    dns:
    - 8.8.8.8
    - 9.9.9.9
    - 8.8.8.8
    - 9.9.9.9
    entrypoint:
    - /usr/share/elasticsearch/docksal/entrypoints/elasticsearch.sh
    environment:
      ES_JAVA_OPTS: -Xms512m -Xmx512m
      bootstrap.memory_lock: "true"
      discovery.type: single-node
    hostname: elasticsearch
    image: elasticsearch:7.16.3
    networks:
      default: null
    ports:
    - mode: ingress
      target: 9200
      protocol: tcp
    ulimits:
      memlock:
        soft: -1
        hard: -1
    volumes:
    - type: bind
      source: /home/jaybeckr/dev/sites/amzn-mftf-docksal/.docksal
      target: /usr/share/elasticsearch/docksal
      bind:
        create_host_path: true
  redis:
    dns:
    - 8.8.8.8
    - 9.9.9.9
    environment:
      REDIS_MAXMEMORY: 256m
    extends:
      file: /home/jaybeckr/.docksal/stacks/services.yml
      service: redis
    hostname: redis
    healthcheck:
      interval: 10s
    image: wodby/redis:5.0
    logging:
      options:
        max-file: "10"
        max-size: 1m
    networks:
      default: null
  web:
    depends_on:
      cli:
        condition: service_started
    dns:
    - 8.8.8.8
    - 9.9.9.9
    environment:
      NGINX_BASIC_AUTH_PASS: null
      NGINX_BASIC_AUTH_USER: null
      NGINX_FCGI_HOST_PORT: cli:9000
      NGINX_SERVER_ROOT: /var/www/pub
      NGINX_VHOST_PRESET: drupal
    extends:
      file: /home/jaybeckr/.docksal/stacks/services.yml
      service: nginx
    hostname: web
    healthcheck:
      interval: 10s
    image: docksal/nginx:1.20-1.2
    labels:
      io.docksal.cert-name: none
      io.docksal.permanent: "false"
      io.docksal.project-root: /home/jaybeckr/dev/sites/amzn-mftf-docksal
      io.docksal.virtual-host: amzn-mftf-docksal.docksal.site,*.amzn-mftf-docksal.docksal.site,amzn-mftf-docksal.docksal.site.*
    logging:
      options:
        max-file: "10"
        max-size: 1m
    networks:
      default: null
    volumes:
    - type: volume
      source: project_root
      target: /var/www
      read_only: true
      volume:
        nocopy: true
networks:
  default:
    name: amzn-mftf-docksal_default
volumes:
  cli_home:
    name: amzn-mftf-docksal_cli_home
  db_data:
    name: amzn-mftf-docksal_db_data
  docksal_ssh_agent:
    name: docksal_ssh_agent
    external: true
  project_root:
    name: amzn-mftf-docksal_project_root
    driver: local
    driver_opts:
      device: /home/jaybeckr/dev/sites/amzn-mftf-docksal
      o: bind
      type: none
---------------------


Output of fin sysinfo:

fin sysinfo output
$ fin sysinfo

███  DOCKSAL
Docksal version: v1.18.2
fin version:     v1.113.2

███  OS
Linux Pop!_OS 22.04
Linux grizzly 6.2.6-76060206-generic #202303130630~1689015125~22.04~ab2190e SMP PREEMPT_DYNAMIC Mon J x86_64 x86_64 x86_64 GNU/Linux

███  ENVIRONMENT
MODE : Linux Kernel
DOCKER_HOST : 

███  DOCKER
Expected client version: 20.10.23
Expected server version: 20.10.23

Installed versions:

Client: Docker Engine - Community
Version:           24.0.5
API version:       1.43
Go version:        go1.20.6
Git commit:        ced0996
Built:             Fri Jul 21 20:35:18 2023
OS/Arch:           linux/amd64
Context:           default

Server: Docker Engine - Community
Engine:
Version:          24.0.5
API version:      1.43 (minimum version 1.12)
Go version:       go1.20.6
Git commit:       a61e2b4
Built:            Fri Jul 21 20:35:18 2023
OS/Arch:          linux/amd64
Experimental:     false
containerd:
Version:          1.6.22
GitCommit:        8165feabfdfe38c65b599c4993d227328c231fca
runc:
Version:          1.1.8
GitCommit:        v1.1.8-0-g82f18fe
docker-init:
Version:          0.19.0
GitCommit:        de40ad0

███  DOCKER COMPOSE
Expected version:  2.15.1
Installed version: 2.15.1

███  DOCKSAL: PROJECTS
project             STATUS                    virtual host                                                                                       project root
drupal10test        Up 15 minutes (healthy)   drupal10test.docksal.site,*.drupal10test.docksal.site,drupal10test.docksal.site.*                  /home/jaybeckr/dev/sites/drupal10test
amzn-mftf-docksal   Up 15 hours (healthy)     amzn-mftf-docksal.docksal.site,*.amzn-mftf-docksal.docksal.site,amzn-mftf-docksal.docksal.site.*   /home/jaybeckr/dev/sites/amzn-mftf-docksal
<< removed other projects that weren't running >>

███  DOCKSAL: VIRTUAL HOSTS
*.amzn-mftf-docksal.docksal.site
*.drupal10test.docksal.site
amzn-mftf-docksal.docksal.site.*
amzn-mftf-docksal.docksal.site
drupal10test.docksal.site.*
drupal10test.docksal.site

███  DOCKSAL: NETWORKING

DOCKSAL_IP: 192.168.64.100
DOCKSAL_HOST_IP: 192.168.64.1
DOCKSAL_VHOST_PROXY_IP: 
DOCKSAL_DNS_IP: 
DOCKSAL_DNS_DISABLED: 1
DOCKSAL_NO_DNS_RESOLVER: 1
DOCKSAL_DNS_UPSTREAM: 
DOCKSAL_DNS_DOMAIN: docksal.site

███  DOCKSAL: CONNECTIVITY

Host to 192.168.64.100: 	PASS
Container to 192.168.64.100: 	PASS
Container to 192.168.64.1: 	PASS

Checking connectivity to http://dns-test.docksal.site...
Host: PASS
Containers: PASS

███  DOCKER: RUNNING CONTAINERS
CONTAINER ID   IMAGE                                COMMAND                   CREATED          STATUS                    PORTS                                                    NAMES
6d64f060633e   docksal/apache:2.4-2.5               "httpd-foreground"        15 minutes ago   Up 15 minutes (healthy)   80/tcp, 443/tcp                                          drupal10test_web_1
d7697d6afde0   docksal/cli:php8.1-3.2               "/opt/startup.sh sup…"    15 minutes ago   Up 15 minutes (healthy)   22/tcp, 3000/tcp, 9000/tcp                               drupal10test_cli_1
5a1f9332b733   docksal/mariadb:10.4                 "docker-entrypoint.s…"    15 minutes ago   Up 15 minutes (healthy)   0.0.0.0:33142->3306/tcp, :::33142->3306/tcp              drupal10test_db_1
4a19492536db   elasticsearch:7.16.3                 "/usr/share/elastics…"    15 hours ago     Up 15 hours               9300/tcp, 0.0.0.0:32778->9200/tcp, :::32778->9200/tcp    amzn-mftf-docksal_elasticsearch_1
54bd6a40b15d   docksal/cli:php8.1-3                 "/opt/startup.sh sup…"    15 hours ago     Up 15 hours (healthy)     22/tcp, 3000/tcp, 9000/tcp                               amzn-mftf-docksal_cli_1
c92d8c614b0a   docksal/nginx:1.20-1.2               "docker-entrypoint.s…"    15 hours ago     Up 15 hours (healthy)     80/tcp, 443/tcp                                          amzn-mftf-docksal_web_1
da23d35a4b80   wodby/redis:5.0                      "/docker-entrypoint.…"    15 hours ago     Up 15 hours               6379/tcp                                                 amzn-mftf-docksal_redis_1
9a3bd0b74ed3   docksal/ssh-agent:1.4                "docker-entrypoint.s…"    16 hours ago     Up 16 hours (healthy)                                                              docksal-ssh-agent
dce12a9f1ca9   docksal/vhost-proxy:1.8              "docker-entrypoint.s…"    16 hours ago     Up 16 hours (healthy)     192.168.64.100:80->80/tcp, 192.168.64.100:443->443/tcp   docksal-vhost-proxy
96a9191977e8   selenium/standalone-chrome-debug     "/opt/bin/entry_poin…"    17 hours ago     Up 15 hours               4444/tcp, 0.0.0.0:5900->5900/tcp, :::5900->5900/tcp      amzn-mftf-docksal_browser_1
9839cee474b7   docksal/mariadb:10.4                 "docker-entrypoint.s…"    18 hours ago     Up 15 hours (healthy)     0.0.0.0:32776->3306/tcp, :::32776->3306/tcp              amzn-mftf-docksal_db_1
1aba6994507d   ghcr.io/swiftotter/den-dashboard     "/den_entrypoint"         2 months ago     Up 5 days                 80/tcp                                                   dashboard
0e371d57034a   traefik:2.2                          "/entrypoint.sh trae…"    2 months ago     Up 5 days                 127.0.0.1:80->80/tcp, 127.0.0.1:443->443/tcp             traefik
6c08996fd030   panubo/sshd:latest                   "/entry.sh /usr/sbin…"    2 months ago     Up 5 days                 127.0.0.1:2222->22/tcp                                   tunnel
ce16023bf212   ghcr.io/swiftotter/den-dnsmasq       "/bin/sh -c ' echo \"…"   2 months ago     Up 5 days                 127.0.0.1:53->53/udp                                     dnsmasq
17aedc7e6bbe   ghcr.io/swiftotter/den-mailhog:1.0   "MailHog"                 2 months ago     Up 5 days                 1025/tcp, 8025/tcp                                       mailhog

███  DOCKER: NETWORKS
NETWORK ID     NAME                        DRIVER    SCOPE
dd3a681dbbd5   _default                    bridge    local
394bc8c70ae6   amzn-245_default            bridge    local
2948a0209b23   amzn-246_default            bridge    local
655ab7b7a05c   amzn-mftf-docksal_default   bridge    local
be36b9b66372   bridge                      bridge    local
463ddfcfa437   host                        host      local
daddf37b52b6   none                        null      local
728e4cb0731d   warden                      bridge    local

███  DOCKER DESKTOP
EXPECTED VERSION: 4.17.0
DETECTED VERSION: 

███  HDD Usage
Filesystem      Size  Used Avail Use% Mounted on
tmpfs           3.2G  3.7M  3.2G   1% /run
/dev/nvme0n1p2  884G  328G  512G  40% /
tmpfs            16G  1.2G   15G   8% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
/dev/nvme0n1p1  2.0G  264M  1.8G  13% /boot/efi
tmpfs           3.2G  256K  3.2G   1% /run/user/1000

@jaybeckr
Copy link
Author

image

@jajajaime
Copy link

I have seen this happening as well in the frontend and backend while using Magento 2.

@halisonfernandes
Copy link
Contributor

I'm experiencing the same issue with Drupal 10.
This seems to be related to HTTPS protocol as I was not having this issue before setting up the URL redirect from HTTP to HTTPS.

@vflirt
Copy link

vflirt commented Apr 10, 2024

I can confirm I have the same issue with Drupal 10, https and Chrome. Refreshing the page most of the time loads the resources however every other page refresh will fail which makes it very inconvenient.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants