Splash issues (d-bus, QSslSocket, libpng) - python-3.x

I'm trying to use Splash via scrapinghub/splash Docker image and have some alerts coming after the first request (which is to /robots.txt endpoint because I'm using scrapy-splash plugin for scrapy library (with Python 3.6).
[-] "172.17.0.1" - - [18/Jan/2018:00:05:12 +0000] "GET /robots.txt HTTP/1.1" 404 153 "-" "Scrapy/1.5.0 (+https://scrapy.org)"
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile
process 1: D-Bus library appears to be incorrectly set up; failed to read machine uuid: UUID file '/etc/machine-id' should contain a hex string of length 32, not length 0, with no other text
See the manual page for dbus-uuidgen to correct this issue.
qt.network.ssl: QSslSocket: cannot resolve SSLv2_client_method
qt.network.ssl: QSslSocket: cannot resolve SSLv2_server_method
And the saddest thing is that it doesn't render this page. Also need to mention that sometimes it renders this page, and it contains redirect in case JS is available.
How to make it work?
UPDATE
When using scrapinghub/splash:3.0 these messages still, but render works.
So should I report it as bug in scrapinghub/splash image or these errors can be caused by my environment?
UPDATE
For some reason, even 3.0 doesn't render from now, as well as master (docker image tag). So for every image with latest or master or 3.0 tag, after asking (form on index endpoint) for render http://floodlist.com/news page it only shows a page with You are being redirected... title.
I found this issue so d-bus problem may be harmless.

process 1: D-Bus library appears to be incorrectly set up; failed to read machine uuid: UUID file '/etc/machine-id' should contain a hex string of length 32, not length 0, with no other text
See the manual page for dbus-uuidgen to correct this issue.
These would appear to be fairly concise instructions on how to fix the D-Bus issue.
I don’t know about the other warnings, or whether any of them are relevant.

These warnings/errors seems to be harmless (see #491 on Splash and #122 on scrapy-splash)
And the problem with rendering was solved by increasing wait value up to 1 second. More info about rendering issues here.

Related

When I scan my magento website it Detected encoded JavaScript code commonly used to hide suspicious behaviour

When I scan my magento website (using tool: https://scanner.pcrisk.com/) it Detected encoded JavaScript code commonly used to hide suspicious behaviour.
Severity: Suspicious
Reason: Detected malicious crypto miner
Details: Detected encoded JavaScript code commonly used to hide suspicious behaviour.
Offset: 8
Threat dump: View code
File size[byte]: 347199
File type: HTML
MD5: 3830153B59E769056519C688A49C733E
Scan duration[sec]: 4.652
I didn't find anything in code.
Is there a way around it ?
I'd like to get rid of the "suspicious flag".

Problem with Chrome headless from CLI: empty PDF and error "Failed to serialize document: Uncaught"

My web application generates a PDF from an HTML page via Google Chrome 76.0.3809.100 headless on Debian GNU/Linux 9.9 (stretch). My call looks like this:
google-chrome --headless --ignore-certificate-errors --hide-scrollbars --print-to-pdf='mypdf.pdf' --run-all-compositor-stages-before-draw --no-sandbox --virtual-time-budget=60000 https://example.com/mypage.html
Everything works perfectly... about 9 times out of 10. But sometime I got an empty PDF.
I thought it was a bug in my code, so I tried to run the same command from the command line directly. I also added --dump-dom to exclude the PDF generation and display the HTML on the console. Again, about 9 times out of 10 it works, one... it doesn't.
When it doesn't, I get this error:
[0814/090047.461433:ERROR:headless_shell.cc(434)] Failed to serialize document: Uncaught
Well, actually this is my full console output, but all the other messages are there also when it runs OK, so I don't think they matter:
Fontconfig warning: "/etc/fonts/fonts.conf", line 100: unknown element "blank"
Fontconfig warning: ignoring UTF-8: not a valid region tag
[0814/090046.673042:ERROR:command_buffer_proxy_impl.cc(107)] ContextResult::kTransientFailure: Shared memory region is not valid
[0814/090046.674622:WARNING:ipc_message_attachment_set.cc(49)] MessageAttachmentSet destroyed with unconsumed attachments: 0/1
[0814/090046.736342:ERROR:cert_verify_proc_nss.cc(969)] CERT_PKIXVerifyCert for example.com failed err=-8102
[0814/090047.461433:ERROR:headless_shell.cc(434)] Failed to serialize document: Uncaught
[0814/090047.474334:ERROR:browser_process_sub_thread.cc(203)] Waited 3 ms for network service
Ok, so back to "my bad" route. I switched https://example.com/mypage.html to https://google.com and... lo and behold! Same "sometime" error!
I'm fresh out of ideas, even more since I cannot replicate the behaviour in a consistent manner: sometime it works, sometime it doesn't.
Any help is appreciated, thanks!
Ok, I reported this to the Chromium devs as Issue 993686. It was recognized as a bug in Chromium.
As a workaround, I removed som aync-loaded fonts I had in my CSS and now it works 10/10.

Unicode Decode Error with audio in psychopy experiment

I have the following problem:
I have experiments that ran on a computer with the PsychoPy Version 1.83.04.
Due to some problems, the computer was reconfigured, hence also PsychPy updated to Version 1.85.4. Since then, none of my experiments with a sound included work anymore. The error message is as follows:
Following an advice in another forum, I changed the files of
- psychopy/sound/init.py
- psychopy/sound/backend_pyo.py
(as suggested also in here).
But unfortunately, this did not work neither. I get a new error message that is
I also tried with the old PsychoPy-Version 1.83.04 - here the experiment at least starts before breaking down. The error message then states that the lxml version is too old to be used with openpyxl and hence cannot open the xlsx-condition file. But there seems to be no problem with the sound device with the old version.
My sound device is as follows:
Description: Lautsprecher (Realtek High Definition Audio)
Default Sound Playback: Yes
Default Voice Playback: Yes
Hardware ID:
HDAUDIO\FUNC_01&VEN_10EC&DEV_0671&SUBSYS_173411EB&REV_1000
Manufacturer ID: 1
Product ID: 100
Type: WDM Driver
Name:
RTKVHD64.sys
Driver Version: 6.00.0001.8186 (English) Driver
Attributes: Final Retail WHQL
Logo'd: Yes
Date and Size: 6/29/2017
18:52:00, 5826560 bytes
What else can I try?
Thank you for your help.
I finally managed to solve the problem - at least superficially.
Following this advice I set PsychoPy back to version 1.85.2. But then, the experiment crushed with a "Fatal Python error: (pygame parachute)..." error message.
Finally, I found the hint where to "switch off" pyo (it was found here): in PsychoPy in File -> Preferences and then delte pyo from the audio library.
Now, my experiments are running again.

Unity 5.0: Sprite.Create error message "!hasError"

I came back to a Unity game that I was working on a couple of weeks ago, using version 4.6.1. After upgrading to version 5.0 and converting the project, there was an error in the following line:
Sprite.Create(plusTexture, Rect(toRightBoundry, 0, plusTexture.width, plusTexture.height), rightPos);
The image is imported as a single Sprite , 150 pixels per unit, pivoted at the center, using a bilinear filter. The import mode is compression , with a max size of 1024. Given those conditions and the fact that this piece of code was not altered since the working version and also after confirming that all values passed are valid, the following error is found at runtime:
"!hasError"
I have researched in the forums and cannot find a solution for this, mostly topics that end in the developers asking for a bug report. Is anyone familiar with how to solve this issue ?
Thanks in advance and have a nice day
it looks like an error do to unresolved merge conflicts from sprite atlas meta file of the resource file. We were getting a few funny named errors lie"aabb is not define" "!hasError" and something WIPPE. On of them was due to artist not resolving conflicts on a mesh meta file

Method for Debugging Userscripts in Chrome

I've attempted to make some modifications to a userscript to enable it to work under Chrome, but when I drag it into Chrome's window in order to install it, a dialog pops up and says 'Invalid Script Header'.
I've tried to use the Developer Tools, and built-in Javascript Console, to debug any errors occurring, but nothing appears to list any information.
Console.app does not list anything meaningful, except for the same error message I already know.
[0x0-0x2d02d].com.google.Chrome: [346:1547:16686819618022:ERROR:extension_error_reporter.cc(55)] Extension error: Invalid script header.
How can I reasonably debug this error message and figure out what about the header is incorrect?
I'm using Chrome 15.0.861.0 on the dev channel, under OS 10.7 Lion.
I finally stumbled across the answer to this question, amusingly via a Chromium Bug Report.
As it turns out, the answer to my question was in the (significantly brief) Userscript Documentation for Chrome page.
With Greasemonkey-style #include rules, it is not possible for Chrome to know for certain the domains a script will run on (because google.* can also run on google.evil.com). Because of this, Chrome just tells users that these scripts will run on all domains, which is sometimes scarier than necessary. With #match, Chrome will tell users the correct set of domains a user script will run on.
As it turns out, I had been using #match http://*musicbrainz.org in an attempt to match www.musicbrainz.org as well as musicbrainz.org, but per the quoted text, that doesn't save you from accidentally matching evilmusicbrainz.org. So, my solution was to use two lines:
#match http://*.musicbrainz.org
#match http://musicbrainz.org
Type:
debugger;
Somewhere in the code, and the Web Inspector will pop up in that location. I have answered similar question here Chrome debugger inject javascript
I figured out while I got the same error message ( INVALID SCRIPT HEADER ) that it accoured cause of a typo between the // ==UserScript== Header info.
wronge line
// #run-at document.end
corrected line
// #run-at document-end

Resources