Ich habe einen Server, der Gunicorn und Python-Programme ausführt. Ein anderer Server sendet eine URL und der fragliche Server löscht die URL und sendet einige Informationen zurück.Xvfb hat gerade angefangen, ohne Code-Änderungen zu scheitern
Ich habe Selenium eine Firefox-Registerkarte im Hintergrund mit Xvfb.
Dies ist, wie ich schon seit einer Weile jetzt mein Server neu zu starten:
sudo Xvfb :10 -ac
export DISPLAY=:10
sudo pkill gunicorn
gunicorn -b 0.0.0.0:8080 wsgi:app
Plötzlich jede Schramme, die Xvfb nicht mehr funktioniert und Fehler aus verwendet, aber der gleiche Code funktioniert immer noch auf meinem lokalen Rechner, so Ich weiß, dass es damit zu tun hat, dass es auf dem Server ist und Xvfb benutzt.
Hier ist der neue Inhalt, der es Druck gestartet, nachdem es aufgehört zu arbeiten:
7 XSELINUXs still allocated at reset
SCREEN: 0 objects of 256 bytes = 0 total bytes 0 private allocs
DEVICE: 0 objects of 96 bytes = 0 total bytes 0 private allocs
CLIENT: 0 objects of 136 bytes = 0 total bytes 0 private allocs
WINDOW: 0 objects of 32 bytes = 0 total bytes 0 private allocs
PIXMAP: 2 objects of 16 bytes = 32 total bytes 0 private allocs
GC: 4 objects of 16 bytes = 64 total bytes 0 private allocs
CURSOR: 1 objects of 8 bytes = 8 total bytes 0 private allocs
TOTAL: 7 objects, 104 bytes, 0 allocs
2 PIXMAPs still allocated at reset
PIXMAP: 2 objects of 16 bytes = 32 total bytes 0 private allocs
GC: 4 objects of 16 bytes = 64 total bytes 0 private allocs
CURSOR: 1 objects of 8 bytes = 8 total bytes 0 private allocs
TOTAL: 7 objects, 104 bytes, 0 allocs
4 GCs still allocated at reset
GC: 4 objects of 16 bytes = 64 total bytes 0 private allocs
CURSOR: 1 objects of 8 bytes = 8 total bytes 0 private allocs
TOTAL: 5 objects, 72 bytes, 0 allocs
1 CURSORs still allocated at reset
CURSOR: 1 objects of 8 bytes = 8 total bytes 0 private allocs
TOTAL: 1 objects, 8 bytes, 0 allocs
1 CURSOR_BITSs still allocated at reset
TOTAL: 0 objects, 0 bytes, 0 allocs
Ich habe versucht, alle Xvfb und Firefox Arbeitsplätze zu töten und alle Hintergrundjobs zu töten und neu zu starten, aber die gleichen Fehler immer noch auftritt.
EDIT 1
Auch eine kürzliche Änderung besteht darin, dass, wenn ich schreibe:
sudo Xvfb :10 -ac
Es Ausgeben hat begonnen:
Initializing built-in extension Generic Event Extension
Initializing built-in extension SHAPE
Initializing built-in extension MIT-SHM
Initializing built-in extension XInputExtension
Initializing built-in extension XTEST
Initializing built-in extension BIG-REQUESTS
Initializing built-in extension SYNC
Initializing built-in extension XKEYBOARD
Initializing built-in extension XC-MISC
Initializing built-in extension SECURITY
Initializing built-in extension XINERAMA
Initializing built-in extension XFIXES
Initializing built-in extension RENDER
Initializing built-in extension RANDR
Initializing built-in extension COMPOSITE
Initializing built-in extension DAMAGE
Initializing built-in extension MIT-SCREEN-SAVER
Initializing built-in extension DOUBLE-BUFFER
Initializing built-in extension RECORD
Initializing built-in extension DPMS
Initializing built-in extension Present
Initializing built-in extension DRI3
Initializing built-in extension X-Resource
Initializing built-in extension XVideo
Initializing built-in extension XVideo-MotionCompensation
Initializing built-in extension SELinux
Initializing built-in extension GLX
EDIT 2
Hier sind die neuen Fehlercodes, nachdem ich eine Fehlerblockierung versucht habe: außer: statements.
...
File "./app/scraper/main.py", line 340, in uScrape
driver = webdriver.Firefox()
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/firefox/webdriver.py", line 77, in __init__
self.binary, timeout),
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/firefox/extension_connection.py", line 49, in __init__
self.binary.launch_browser(self.profile)
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/firefox/firefox_binary.py", line 68, in launch_browser
self._wait_until_connectable()
File "/usr/local/lib/python2.7/dist-
packages/selenium/webdriver/firefox/firefox_binary.py", line 103, in _wait_until_connectable
raise WebDriverException("Can't load the profile. Profile "
WebDriverException: Message: Can't load the profile. Profile Dir: %s If you specified a log_file in the FirefoxBinary constructor, check it for details.
EDTI 3
$pip show selenium
Name: selenium
Version: 2.53.1
Location: /usr/local/lib/python2.7/dist-packages
Gibt es einen Grund, warum Sie gunicorn in Ihrer virtuellen X-Sitzung ausgeführt werden soll festgelegt wurde? Außerdem bezweifle ich, dass es helfen wird, aber die Art, wie ich Selen gemacht habe, ist über xvfb-run Python .py ... das startet eine virtuelle Framebuffer-Sitzung und führt mein Selen und stoppt dann die Xvfb-Sitzung ... auch, welche Fehler bekommen Sie, wenn Sie Selen laufen lassen (oder einfach Firefox laufen lassen?) –
Foon
@Foon Siehe Edit 2, und schauen Sie sich Fall für Fall an, dass xvfb läuft – Rorschach