Skip to Content
Odoo Menu
  • Log ind
  • Prøv gratis
  • Apps
    Økonomi
    • Bogføring
    • Fakturering
    • Udgifter
    • Regneark (BI)
    • Dokumenter
    • e-Signatur
    Salg
    • CRM
    • Salg
    • POS Butik
    • POS Restaurant
    • Abonnementer
    • Udlejning
    Hjemmeside
    • Hjemmesidebygger
    • e-Handel
    • Blog
    • Forum
    • LiveChat
    • e-Læring
    Forsyningskæde
    • Lagerbeholdning
    • Produktion
    • PLM
    • Indkøb
    • Vedligeholdelse
    • Kvalitet
    HR
    • Medarbejdere
    • Rekruttering
    • Fravær
    • Medarbejdersamtaler
    • Anbefalinger
    • Flåde
    Marketing
    • Markedsføring på sociale medier
    • E-mailmarketing
    • SMS-marketing
    • Arrangementer
    • Automatiseret marketing
    • Spørgeundersøgelser
    Tjenester
    • Projekt
    • Timesedler
    • Udkørende Service
    • Kundeservice
    • Planlægning
    • Aftaler
    Produktivitet
    • Dialog
    • Godkendelser
    • IoT
    • VoIP
    • Vidensdeling
    • WhatsApp
    Tredjepartsapps Odoo Studio Odoo Cloud-platform
  • Brancher
    Detailhandel
    • Boghandel
    • Tøjforretning
    • Møbelforretning
    • Dagligvarebutik
    • Byggemarked
    • Legetøjsforretning
    Mad og værtsskab
    • Bar og pub
    • Restaurant
    • Fastfood
    • Gæstehus
    • Drikkevareforhandler
    • Hotel
    Ejendom
    • Ejendomsmægler
    • Arkitektfirma
    • Byggeri
    • Ejendomsadministration
    • Havearbejde
    • Boligejerforening
    Rådgivning
    • Regnskabsfirma
    • Odoo-partner
    • Marketingbureau
    • Advokatfirma
    • Rekruttering
    • Audit & certificering
    Produktion
    • Tekstil
    • Metal
    • Møbler
    • Fødevareproduktion
    • Bryggeri
    • Firmagave
    Heldbred & Fitness
    • Sportsklub
    • Optiker
    • Fitnesscenter
    • Kosmetolog
    • Apotek
    • Frisør
    Håndværk
    • Handyman
    • IT-hardware og support
    • Solenergisystemer
    • Skomager
    • Rengøringsservicer
    • VVS- og ventilationsservice
    Andet
    • Nonprofitorganisation
    • Miljøagentur
    • Udlejning af billboards
    • Fotografi
    • Cykeludlejning
    • Softwareforhandler
    Gennemse alle brancher
  • Community
    Få mere at vide
    • Tutorials
    • Dokumentation
    • Certificeringer
    • Oplæring
    • Blog
    • Podcast
    Bliv klogere
    • Udannelselsesprogram
    • Scale Up!-virksomhedsspillet
    • Besøg Odoo
    Få softwaren
    • Download
    • Sammenlign versioner
    • Udgaver
    Samarbejde
    • Github
    • Forum
    • Arrangementer
    • Oversættelser
    • Bliv partner
    • Tjenester til partnere
    • Registrér dit regnskabsfirma
    Modtag tjenester
    • Find en partner
    • Find en bogholder
    • Kontakt en rådgiver
    • Implementeringstjenester
    • Kundereferencer
    • Support
    • Opgraderinger
    Github Youtube Twitter LinkedIn Instagram Facebook Spotify
    +1 (650) 691-3277
    Få en demo
  • Prissætning
  • Hjælp

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Bogføring
  • Lager
  • PoS
  • Projekt
  • MRP
All apps
Du skal være registreret for at interagere med fællesskabet.
All Posts People Emblemer
Tags (View all)
odoo accounting v14 pos v15
Om dette forum
Du skal være registreret for at interagere med fællesskabet.
All Posts People Emblemer
Tags (View all)
odoo accounting v14 pos v15
Om dette forum
Hjælp

Can't run Selenium code inside Odoo

Tilmeld

Få besked, når der er aktivitet på dette indlæg

Dette spørgsmål er blevet anmeldt
Seleniumv15
4 Besvarelser
5670 Visninger
Avatar
Fred Nunes

Hi everyone, I'm trying to trigger a very simple web scraper from Odoo. Right now, all I am trying to do is to instantiate a webdriver.Chrome object inside one of my model's functions, that is triggered by a button on my form view.

I am able to run this code as a separate python script (simply doing python my_script.py) which proves that Selenium is correctly configured in my system. However, it seems like the Odoo server's threads have a problem running it:

selenium\.common\.exceptions\.WebDriverException:\ Message:\ Service\ /root/\.wdm/drivers/chromedriver/linux64/103.0.5060.53/chromedriver unexpectedly exited. Status code was: -5

I have spent several hours trying to understand what is going on, but to no avail. Things I've tried so far include using both Chrome, Chromium and Firefox; tried every single combination of Webdriver parameters (headless, etc.); trying giving full permissions on chromedriver, chrome and chromium executables (chmod 777); running odoo with and without sudo.

Unfortauntely nothing worked so far, so I started looking into Odoo's ThreadedServer code, so see if I found any reason why Selenium's subprocess.Popen calls wouldn't work, but unfortunately this is so beyond my knowledge that I don't even know what to Google!

Any insights would be greatly appreciated... thanks!

2
Avatar
Kassér
Avatar
Enric Tobella Alomar
Bedste svar

The problem is related to limit_memory_hard. Increase it and it will work properly. I had the same issue. 

1
Avatar
Kassér
Vaidehi Vasani

I set it like limit_memory_hard=2684354560
but still the same

Enric Tobella Alomar

You need to increase it even more.

Vaidehi Vasani

Oh yeah I agree, with
limit_memory_hard=99999999999
It works all okay, this was so strange, I wonder how you could find such resolution, thanks a lot

Enric Tobella Alomar

All thanks to your question! You inspired me the idea, and after a lot of test I was able to figure it out. Selenium is opening a browser, but Odoo limits the memory of the thread. It closes abruptly due to that limit. For that reason, it is necessary to increase it so much.

Avatar
Julian
Bedste svar

Hi, i try to apply the answer of Enric Tobella Alomar , but doesnt works for me, stay raising the error  "Status code was: -5". Im doing good?  

i go to the "odoo.conf" and add the next line:
limit_memory_hard=999999999999

its right like this?

1
Avatar
Kassér
Avatar
QSB Consulting
Bedste svar

Please add the following line before creating the driver object.

https://github.com/Vauxoo/odoo-selenium/blob/main/src/odoo_selenium/selenium.py#L88

0
Avatar
Kassér
Avatar
GEMASTIC E.I.R.L.
Bedste svar

I have the same error, I am working in Odoo 14 CE, Ubuntu 20, 8 GB Memory and 4 vCPUs, Any suggestions?

0
Avatar
Kassér
Fred Nunes
Forfatter

I wasn't able to fix it, so what I did was I delegated the Selenium code to a small HTTP server running side on the same machine as my Odoo instance, and I just send requests from Odoo to the server.

Olli

Did you find any other solution? Also facing this issue

Adnier Roselló

Hi Fred Nunes, How can I delegate the execution of selenium to a http server to send requests out of odoo? if you can share your solution it would be very helpful, thank you very much in advance

Denis Nichiporchik

Hi Fred Nunes and Adnier Roselló.
Could you share your solution if you found it? Thank you.

Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Tilmeld dig
Related Posts Besvarelser Visninger Aktivitet
Prevent navigation if records are not save
v15
Avatar
Avatar
Avatar
2
okt. 25
3461
Creating user creates duplicated partner_id
v15
Avatar
Avatar
1
sep. 25
3347
Sales order line comment to Purchase order line comment Løst
v15
Avatar
Avatar
3
jul. 25
4552
attribute is not applied when dynamically rendering
v15
Avatar
1
maj 25
2686
Odoo Custome Module Language Creation
v15
Avatar
Avatar
Avatar
Avatar
4
maj 25
4112
Community
  • Tutorials
  • Dokumentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Oversættelser
Tjenester
  • Odoo.sh-hosting
  • Support
  • Opgradere
  • Individuelt tilpasset udvikling
  • Uddannelse
  • Find en bogholder
  • Find en partner
  • Bliv partner
Om os
  • Vores virksomhed
  • Brandaktiver
  • Kontakt os
  • Stillinger
  • Arrangementer
  • Podcast
  • Blog
  • Kunder
  • Juridiske dokumenter • Privatlivspolitik
  • Sikkerhedspolitik
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo er en samling open source-forretningsapps, der dækker alle dine virksomhedsbehov – lige fra CRM, e-handel og bogføring til lagerstyring, POS, projektledelse og meget mere.

Det unikke ved Odoo er, at systemet både er brugervenligt og fuldt integreret.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now