Exception occurred in file 'chrome.py', line 64: 'NoneType' object has no attribute 'split'

I am using pyhtml2pdf for converting HTML to PDF which has a requirement of Chrome headless.

When the server is run as python manage.py runserver there is no issue.

But when the django is run as a service it throws and error regarding split with chrome.py :

Exception occurred in file ‘/var/www/myProject/env/lib/python3.11/site-packages/webdriver_manager/drivers/chrome.py’, line 64: ‘NoneType’ object has no attribute ‘split’.

Our service :

cat /etc/systemd/system/myProject.service
[Unit]
Description=myProject_0 project
After=network.target

[Service]
User=root
Group=root
WorkingDirectory=/var/www/myProject
Environment="PATH=/var/www/myProject/env/bin/activate"
ExecStart=/bin/bash -c 'source /var/www/myProject/env/bin/activate && python manage.py runserver'
StandardOutput=append:/var/log/myProject/myProject.log
StandardError=append:/var/log/myProject/myProject_error.log

[Install]
WantedBy=multi-user.target

Do you have a local instance of the Chrome browser? if so try re-installing it.

also, try to remove the .wdm folder and --upgrade the package.

rm -rf /Users/briandekeijzer/.wdm

pip install --upgrade webdriver_manager

Ugly hack - not a long term solution but works as of now.

This function in /var/www/myProject/env/lib/python3.11/site-packages/webdriver_manager/drivers/chrome.py was causing the issue :

def get_latest_release_version(self):

I gave a return value right after entering this function return "125.0.6422.112"

Back to Top