Closed pmcenery closed 3 months ago
Hey @pmcenery many thanks for describing your situation in detail (and wanting to contribute to IBeam!) π
Is a build using master branch still working?
Yes, I have built it just two days ago as of writing this: https://hub.docker.com/layers/voyz/ibeam/0.5.4-rc3/images/sha256-39cb65946adba6e1dd36db4b3e54bb927e6fda21673762d7a2e324368e0fdb28?context=repo
I'm not sure if something has changed in the package build process - i.e. newer apt-installed packages that breaks it, or if its something local to my build process?
I'm imagining this would be something related to MacOS - I briefly remember issues happening to some other users on MacOS that didn't exist on other OSs. I can't find the specific Issues at the moment though.
Since I don't have an Apple device I cannot help you debugging this directly from my end. If it is of any help - I can see that the build fails when we attempt to access the login page and create a new webdriver:
# File "/srv/ibeam/src/login/driver.py", line 47
driver = webdriver.Chrome(options=options, service=service)
I'd suggest trying to create a Chrome Webdriver using the code in _new_chrome_driver
and see if that works for you on its own. I've simplified the code for you so it should be ready to execute on its own:
def _new_chrome_driver(driver_path, name: str = 'default', headless: bool = True, incognito: bool = True, ui_scaling: float = 1) -> webdriver.Chrome:
"""Creates a new chrome driver."""
options = webdriver.ChromeOptions()
if headless:
options.add_argument('--headless')
options.add_argument('--disable-gpu')
options.add_argument('--no-sandbox')
if incognito:
options.add_argument("--incognito") # this allows 2FA method to be selected every time
options.add_argument('--ignore-ssl-errors=yes')
options.add_argument('--ignore-certificate-errors')
options.add_argument(f'--remote-debugging-port={9222}')
options.add_argument('--useAutomationExtension=false')
options.add_argument('--disable-extensions')
options.add_argument('--dns-prefetch-disable')
options.add_argument('--disable-features=VizDisplayCompositor')
options.add_argument(f"--force-device-scale-factor={ui_scaling}")
options.add_argument(f'--user-data-dir={tempfile.gettempdir()}/ibeam-chrome-{name}')
service = Service(executable_path=driver_path)
driver = webdriver.Chrome(options=options, service=service)
if driver is None:
print('Unable to create a new chrome driver.')
return driver
Let me know how that goes
Thanks for the detailed and prompt response @Voyz
I battled with this one for quite some time and then found a Docker desktop update. Installed and restarted and now it works as I'd expect! I've never seen anything like it, but at least it explains the rather odd behaviour!
@pmcenery great, happy to hear you've solved it! Thanks for leaving the detailed guide on how to deal with the issue you've found ππ
Describe the bug I was hoping to update all the packages to the latest and test them out before submitting a PR with the changes. This ran aground when I couldnt even rebuild the master branch using the existing Dockerfile. I appear to have run into this issue, as I'm building using docker on macOS. I've tried all sorts of things from specifying a bigger default-dev-shm in the docker settings, but for some or other reason, I cannot run the rebuilt image. The dockerhub one however seems to run just fine π€·
To Reproduce Steps to reproduce the behavior:
I get this output
Expected behavior Running as normal
Environment IBeam version: master Docker image or standalone: Built using master Python version (standalone users only): N/A OS: macOS Sonoma 14.5
Additional context I'm not sure if something has changed in the package build process - i.e. newer apt-installed packages that breaks it, or if its something local to my build process? I build docker images all the time with no issue, so wouldn't have thought it was build host specific.
Suggest a Fix Is a build using master branch still working?