Firefox profile could not be loaded. It may be missing or inaccessible.
🐛 Bug Report
Pulled a fresh image from selenium/standalone-firefox-debug:latest this morning and went to test out the web driver to be met with this error. Pulled back a few iterations to lithium as well and same deal. Cannot figure out what is going on as it looks like the profile is being created in /tmp as it always was. See Docker file, docker-compose.yml, and python snippet below for full reproducible example.
Note, these exact Dockerfile, docker-compose, and python snippets worked up until rebuilding with latest.
To Reproduce
# Dockerfile
FROM selenium/standalone-firefox-debug:latest
USER root
RUN apt-get update
RUN apt-get install -y python3-pip
RUN python3 -m pip install --upgrade pip
COPY requirements.txt .
RUN pip3 install -r requirements.txt
USER seluser
# docker-compose.yml
version: '3'
services:
selenium:
build: .
environment:
- VNC_NO_PASSWORD=1
shm_size: '2gb'
volumes:
- .:/code
ports:
- "5901:5900"
# python3 snippet
from selenium import webdriver
from selenium.webdriver.firefox.options import Options
options = Options()
options.log.level = 'trace'
driver = webdriver.Firefox(options=options, service_log_path='/home/seluser/geckodriver.log')
# geckodriver log file
1559828377535 mozrunner::runner INFO Running command: "/usr/bin/firefox" "-marionette" "-foreground" "-no-remote" "-profile" "/tmp/rust_mozprofile.YVyjvRDMQOf2"
Expected behavior
Open a Firefox browser window.
Environment
OS: ubuntu:bionic-20181204.
Docker-Selenium image version: 3.141.59-palladium
Firefox version: 67.0.1
Geckodriver version: 0.24.0 (2019-01-28)
I think I'm running against the same problem with selenium-server-standalone of this version, without using it inside a container so the problem might be on the selenium jar itself.
UPDATE:
- With a pull of only the docker container, running
firefoxfrom the command line as seluser works. However, it does not when I run the apt-get update and install pip and my packages. - With the Dockerfile displayed above, still no good on running
firefoxas seluser, but it does work when runningfirefoxas root user
So something is happening when I install pip and my packages, which seems a bit odd. I'll keep investigating.
UPDATE:
The following Dockerfile changes appear to have resolved my issue:
FROM selenium/standalone-firefox-debug:latest
WORKDIR /home/seluser
RUN sudo apt-get update
RUN sudo apt-get install -y python3-pip
RUN sudo python3 -m pip install --upgrade pip
COPY requirements.txt .
RUN pip3 install --user -r requirements.txt