An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://repo.mysql.com/apt/ubuntu focal InRelease: The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY 467B942D3A79BD29
Quite interesting story, we have website running WordPress with two noticed problems:
After making call to REST API it return valid JSON response (debugged in Postman) but when trying raw json_decode in PHP it fail.
In PHP, after echoing (readfile) random file into client (wget), SHA1 sum of file on server and downloaded does NOT match, but content of downloaded file is exactly the same (tested via FileMerge)
Opening downloaded file in PHPStorm does not reveal any special characters in downloaded or original file
Postman report 100% valid JSON response
Trying this malformed CURL command reveal hidden from naked eye problem.
curl -d "auth=something" -X POST https://somewebsite.com/index.php\?rest_route\=/plugin/route/test --trace-ascii --
CURL pass raw output to terminal, terminal report unknown command (code was only used to diagnose) it’s malformed and sould not be used since it can execute arbitrary code!!!!
In front of JSON data there is UTF-8 BOM code (\ufeff) (it’s being ignored by most of application but not all, it should never be present in JSON response since encoding is send in HTTP header – some code is ignoring it, some will fail on decode JSON and thread it as invalid syntax.
When we know what to look for, we need scan all PHP files on server and locate ( 0xEF, 0xBB, 0xBF ) string in root website directory using following command:
grep -rlI $’\xEF\xBB\xBF’ .
From result ignore anything that is not .PHP since those files can have BOM and not directly parsed via PHP interpreter.
Ignore anything except PHP files (only they are interpreted in PHP)
Download those PHP file and examine with “HexEditor” reveal BOM before PHP code that is being send along ANY content served from PHP.
Here is PHP source file (on server) containing BOM mark that’s being forwarded to browser on each page request that include this file.
Cleaning file from “BOM” mark (on MAC):
sed $’1s/\xef\xbb\xbf//’ < in8sync-customization.php > clean-in8sync-customization.php
Compare two files together to make sure only BOM is removed.
Properly cleaned file
Upload cleaned file in original location and repeat process if there is more than one. Be happy fixing unusual issue!!
Recently I have interesting issue of not being able to access my network shares on AirPort Time Capsule from Windows 10.
Pinging Time Capsule was successfull but trying access in file explorer (\\ip-address\untitled\share) cause unknown error.
Problem was caused by disabled SMB 1.0/CIFS File Sharing Support by default in Windows 10 that make it unable to connect. Reason of SMB being disabled is obsolete and have security issues but in my opinion this is not problem in trusted home network where all devices are our’s.
To enable support for SMB 1.0/CIFS File Sharing You need to open PowerShell with elevated permissions (run as administrator) and execute following command:
This device is quite obsolete and I have lot trouble finding correct working drivers. (on Win 10 drivers need to be installed from device manager – navigating to program files newly created directory.
Recently I have interesting problem with Valet using wrong PHP version on my Laravel application, trying to switch it from terminal not fix issue and stating it’s already done even including force relink.
valet use php@7.4 –force Unlinking current version: php@7.4 Linking new version: php@7.4 Updating PHP configuration… Restarting php@7.4… Restarting nginx… Valet is now using php@7.4.
Solution for this problem was using following command
rm ~/.config/valet/valet.sock
valet use php@7.4 –force
After that Valet use correct PHP version in my application.
Warning: Undefined array key 0 in /www/wwwroot/electronicnoobblog.com/wp-content/plugins/wp-google-analytics-scripts/wp-google-analytics-scripts.php on line 602