Parsoid: Unexpected Token error and failing to initialize - config

mwApis:
- # This is the only required parameter,
# the URL of you MediaWiki API endpoint.
uri: 'http://spgenerations.com/wiki/api.php'
On my linux box, I can curl this URL and receive the api data.
Regardless of using the apt-get installation or developer installation (ngm install) both instances give me this error:
{"name":"parsoid","hostname":"play.projecttidal.com.KVM","pid":12636,"level":30,"levelPath":"info/service-runner","msg":"master(12636) initializing 2 workers","time":"2019-03-12T03:55:47.504Z","v":0}
{"name":"parsoid","hostname":"play.projecttidal.com.KVM","pid":12645,"level":60,"moduleName":"lib/index.js","levelPath":"fatal/service-runner/worker","msg":"Unexpected token ...","time":"2019-03-12T03:55:47.917Z","v":0}
{"name":"parsoid","hostname":"play.projecttidal.com.KVM","pid":12636,"level":40,"message":"first worker died during startup, continue startup","worker_pid":12645,"exit_code":1,"startup_attempt":1,"levelPath":"warn/service-runner/master","msg":"first worker died during startup, continue startup","time":"2019-03-12T03:55:48.925Z","v":0}
For context, the hostname here is incorrect and the domain has been removed.
This is my parsoid config:
// Parsoid configuration
$wgVirtualRestConfig['modules']['parsoid'] = array(
'url' => 'server.spgenerations.com',
'forwardCookies' => true
);
I have tried everything under the hidden voodoo sun to get this thing to work and I'm beyond frustrated. 4 hours spent tinkering with URL links to no avail, so please, if you know anything relating to this error, lend a hand.

Check what Node.JS version you are running with:
nodejs --version
If it is 4.x: That's too old for Parsoid. I had the same situation (Debian 9, still such an old Node.JS version in the repositories..). After upgrading to 10.x it ran fine for me.
I used the following guide (see Install using a PPA) to update to a newer Node.JS release: https://www.digitalocean.com/community/tutorials/how-to-install-node-js-on-debian-9

Related

ioncube_loader Issue: undefined symbol: zend_execute_ex

I have been struggling with the above problem for days. I need the ioncube_loader for my Shopware (version 5.3.2 with PHP version 7.1.8). The server on which Shopware runs has PHP version 5.6.40!
Inside the shop I am told that I am using the ionCube Loader but when I log in to the server via SSH the error occurs.
The following outputs are available for the following commands in the console:
PHP Version
[root#vh1 ~]# php -v
Failed loading /usr/lib64/php/modules/ioncube_loader_lin_7.1.so: /usr/lib64/php/modules/ioncube_loader_lin_7.1.so: undefined symbol: zend_execute_ex
PHP 5.4.16 (cli) (built: Oct 30 2018 19:30:51)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies
extension_dir
[root#vh1 ~]# php -i | grep extension_dir
Failed loading /usr/lib64/php/modules/ioncube_loader_lin_7.1.so: /usr/lib64/php/modules/ioncube_loader_lin_7.1.so: undefined symbol: zend_execute_ex
extension_dir => /usr/lib64/php/modules => /usr/lib64/php/modules
PHP Warning: Unknown: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in Unknown on line 0
sqlite3.extension_dir => no value => no value
set include
; Enable ioncube extension module
zend_extension = /usr/lib64/php/modules/ioncube_loader_lin_7.1.so
Can someone tell me what I did wrong? I can not find anything about the bug about Google.
undefined symbol: zend_execute_ex
Why zend_execute_ex? Where does it come from? Can the error occur due to the permissions?
[root#vh1 ~]# ll /usr/lib64/php/modules/
total 8940
-rwxr-xr-x 1 root root 1500368 16. Jul 11:11 ioncube_loader_lin_5.6.so
-rwxr-xr-x 1 root root 1366576 11. Jun 15:33 ioncube_loader_lin_7.1.so
EDIT:
As soon as I open the plugin manager in the backend of Shopware I get the following error:
The file /path/to/shop/engine/Shopware/Plugins/Community/Frontend/CoeVoucherUrl
/Bootstrap.php was encoded by the ionCube Encoder
for PHP 5.6 and cannot run under PHP 7.1 or later.
Please ask the of the script to provide a version
encoded with the ionCube Encoder for PHP 7.1.
File:Unknown
The ioncube-version you are using is for php 7.1 and not for php 5.6. When using PHP 5.6 you need the ioncube_loader_lin_5.6.so. It's provided with the current loader-packages as well. You need to make sure the loader version is compatible with your php-version. The error message already states, that you are using the encoder for php 7.1.
On most servers php versions are different between CLI and Web, so you need to make sure the CLI is using the same version as the webserver and the ioncube version is compatible with it. Sometimes there are possibilities to call different php versions via cli by adding the version number (like php7.1 ...).
On to of that, you can't use any plugin from the shopware store that is encrypted with php 7.1+, since the encryption of the store only supports 5.6 and 7.0. If you want to use php 7.1, you need to make sure there are no encrypted plugins in your system. In this case the plugin manager will work again.
https://docs.shopware.com/en/shopware-5-en/update-guides/update-guide-shopware-55#but-i-still-have-encrypted-plugins

firebase-admin - Auth error:TypeError: URL is not a constructor

I've got a node API that uses firebase-admin to handle firestore data. This wasn't a problem till a few days ago and now it started happening.
The weird thing is, I only seem to get this on my production server and not on local development environment(even using the same database).
I've tried redeploying, restarting the server, checked database configuration and everything and nothing really worked.
This is one of the more detailed errors:
Error: 14 UNAVAILABLE: Getting metadata from plugin failed with error: URL is not a constructor
at Object.exports.createStatusError (/root/apps/api/src/node_modules/grpc/src/common.js:91:15)
at Object.onReceiveStatus (/root/apps/api/src/node_modules/grpc/src/client_interceptors.js:1204:28)
at InterceptingListener._callNext (/root/apps/api/src/node_modules/grpc/src/client_interceptors.js:568:42)
at InterceptingListener.onReceiveStatus (/root/apps/api/src/node_modules/grpc/src/client_interceptors.js:618:8)
at callback (/root/apps/api/src/node_modules/grpc/src/client_interceptors.js:845:24)
And this is my connection file:
import * as admin from 'firebase-admin'
import serviceAccount from './fbAdminKey'
admin.initializeApp({
projectId: '<myProjectId>',
credential: admin.credential.cert(serviceAccount),
databaseURL: '<myDbURL>'
})
const db = admin.firestore()
const messaging = admin.messaging()
const auth = admin.auth()
export default { db, messaging, auth }
It should be able to just connect to the database and do the operations, I have an app, a web application and they all work normally, just the node API seems to be acting weirdly.
So, after banging my head around for nearly a week, having other problems and stuff, I could figure it out with the help of everybody here.
The problem was the node.js version
I was running node 8.4.0 locally and node 6.x.x on production. (firebase-admin 7.0.0)
So I updated it on production using nvm and than got another problem, related to the grpc version. I had a newer version installed and it was requiring an older one.
Note
If you are using PM2, make sure to update it as well:
http://pm2.keymetrics.io/docs/usage/update-pm2/
After that it started working again and it stuff is back on track.
Not the exact solution because it doesn't solve the problem with Node 6.11.5.
The production server runs by default on Node 6.11.5 and if you wanted to change the runtime version to 8, then refer to this article.
https://firebase.google.com/docs/functions/manage-functions#set_runtime_options
However, keep in mind that this runtime version is currently in beta, so it might break.
I also noticed, that I was able to get rid of this error that you were facing by installing previous version of firebase-admin (6.2.0 to be specific, as for now - the version 7.x.x is the latest one).
I'm afraid that one of the newer firebase-admin versions broke this feature in some environments and that's why this issue is not that common.

orocommerce install failed you have requested a non-existent parameter "web_backend_prefix"

I done all steps to install orocommerce on azure CentOS and nginx.
So now i got the following error after
$ ./bin/console oro:install --env=prod --timeout=900
"In ParameterBag.php line 102:
You have requested a non-existent parameter "web_backend_prefix".
Have anybody an idea?
How exactly did you get the source code (if GitHub - what repository, tag/branch, if download - what website and version)? Based on the error text it seems like it might be OroPlatform or OroCRM application, not OroCommerce.

RabbitMQ management returns 500 when trying to list queues

I've just installed Erlang 19.0, then Rabbitmq Server 3.6.3. OS - Windows 10. Then I installed rabbitmq_management plugin, then I started rabbitmq-server. I can successfully login into management console. The problem is when I go to Queues I get as error:
Got response code 500 with body {"error":"JSON encode error:
{bad_term,#{error_logger => true,kill => true,size =>
0}}","reason":"While encoding: \n[{total_count,1},\n {item_count,1},\n
{filtered_count,1},\n {page,1},\n {page_size,100},\n {page_count,1},\n
{items,\n [[{memory,22048},\n {reductions,6633},\n
{reductions_details,[{rate,0.0}]},\n {messages,0},\n
{messages_details,[{rate,0.0}]},\n {messages_ready,0},\n
{messages_ready_details,[{rate,0.0}]},\n
{messages_unacknowledged,0},\n
{messages_unacknowledged_details,[{rate,0.0}]},\n
{idle_since,<<\"2016-07-08 20:55:04\">>},\n
{consumer_utilisation,''},\n {policy,''},\n
{exclusive_consumer_tag,''},\n {consumers,1},\n
{recoverable_slaves,''},\n {state,running},\n {reductions,6633},\n
{garbage_collection,\n [{max_heap_size,#{error_logger => true,kill =>
true,size => 0}},\n {min_bin_vheap_size,46422},\n
{min_heap_size,233},\n {fullsweep_after,65535},\n {minor_gcs,3}]},\n
{messages_ram,0},\n {messages_ready_ram,0},\n
{messages_unacknowledged_ram,0},\n {messages_persistent,0},\n
{message_bytes,0},\n {message_bytes_ready,0},\n
{message_bytes_unacknowledged,0},\n {message_bytes_ram,0},\n
{message_bytes_persistent,0},\n {head_message_timestamp,''},\n
{disk_reads,0},\n {disk_writes,0},\n {backing_queue_status,\n
{struct,\n [{mode,default},\n {q1,0},\n {q2,0},\n
{delta,[delta,undefined,0,undefined]},\n {q3,0},\n {q4,0},\n
{len,0},\n {target_ram_count,infinity},\n {next_seq_id,0},\n
{avg_ingress_rate,0.0},\n {avg_egress_rate,0.0},\n
{avg_ack_ingress_rate,0.0},\n {avg_ack_egress_rate,0.0}]}},\n
{node,'rabbit#DESKTOP-330SD1I'},\n {arguments,{struct,[]}},\n
{exclusive,false},\n {auto_delete,false},\n {durable,true},\n
{vhost,<<\"/\">>},\n {name,<<\"queue1\">>}]]}]"}
If I remove from myself a privilegy to access "/" virtual host error disappears, but no queues are shown, which I suppose is wrong, because I have a running application which sends and reveives messages.
Here is the closest question to my, but those solution doesn't help.
P.S. I don't even hope somebody help me, I just wanted to post this question so at least this error can be googled.
there are some known issues with Erlang 19, discussed in the RMQ Google Group, here.
In other words, 3.6.3 effectively isn't Erlang 19.0-compatible:
you'll need to install a prior version of Erlang, until RMQ can be re-built to support the changes in Erlang 19
I've installed Erlang OTP 18.0 and RabbitMq 3.6.3 management console started to work fine. Before I tried to use OTP 19.0 and I got errors during browsing web-console.
I upgraded RabbitMQ to 3.6.5 and the error got resolved. It is now working with Erlang 19.0.

Composer needs a proxy to install laravel apparently, where do I get that? can I set it up myself using apache?

I was trying to get started with Laravel just last night, so I tried to install it with composer but it wouldn't go through and kept sayin The "https://packagist.org/packages.json" file could not be downloaded: SSL operation failed with code 1. , so I looked around and found out that you need to tell composer to use a proxy.(q1 q2 q3).
Well now this might sound silly but honestly I had no idea what a proxy was until last night, so I went and studied it a bit and I got this far:
"Proxy means to act on behalf of another. In the context of a Web server, this means
one server fetching content from another server, then returning it to the client"
and apparently there's 2 kinds of proxy: forward proxy and reverse proxy.
In those 3 pages that I just showed, they were saying before runing php bin\composer global require "laravel/installer=~1.1" you have to set an env var like this: set http_proxy=username:password#proxy_server:port
So now my question is: I still don't know where can I get a proxy like that, should I set it up myself with apache? is that gonna even work? what do I do?
Your thoughts would be appreciated, thank you.
Edit: Environment info:
I'm on windows 7
installed xampp-win32-5.6.14-0-VC11-installer
all of those 5 important extensions are all enabled in phpinfo()
the path= C:\Users\UserName\AppData\Roaming\Composer\vendor\bin is set in environment variables
here's a picture of the whole error
here's the result of php -m i.stack.imgur.com/wz030.png
Some stuff that I tried:
I went into these sites: proxy4free.com us-proxy.org proxylist.hidemyass.com ultraproxies.com,
I tried this: set https_proxy=https://xteamweb.com:xteam#75.55.165.86:8088 and this one: set http_proxy=http://1proxy.space and many others from those sites: i.stack.imgur.com/6YWyp.png
but no matter what, this is the result of all of them: i.stack.imgur.com/mqOrP.png
Still nothing...
Ok here's the solution, if you're having the same problem:
1:
Make sure these are all uncommented in php.ini:
extension=php_openssl.dll
extension=php_curl.dll
extension=php_sockets.dll
extension_dir="E:\xampp\php\ext"
browscap="E:\xampp\php\extras\browscap.ini"
Add these 2 lines at the end of php.ini
curl.cainfo=c:\openssl-1.0.2d-win32\ssl\cert.pem
openssl.cafile=c:\openssl-1.0.2d-win32\ssl\cert.pem
2:
Run this: php -r "print_r(openssl_get_cert_locations());"
and you'll get:
Array
(
[default_cert_file] => c:/openssl-1.0.2d-win32/ssl/cert.pem
[default_cert_file_env] => SSL_CERT_FILE
[default_cert_dir] => c:/openssl-1.0.2d-win32/ssl/certs
[default_cert_dir_env] => SSL_CERT_DIR
[default_private_dir] => c:/openssl-1.0.2d-win32/ssl/private
[default_default_cert_area] => c:/openssl-1.0.2d-win32/ssl
[ini_cafile] => c:\openssl-1.0.2d-win32\ssl\cert.pem
[ini_capath] =>
)
3:
Make these folders:
c:\openssl-1.0.2d-win32
c:\openssl-1.0.2d-win32\ssl
c:\openssl-1.0.2d-win32\ssl\certs
c:\openssl-1.0.2d-win32\ssl\private
Download this: http://curl.haxx.se/ca/cacert.pem.
Rename it to cert.pem and put it in c:\openssl-1.0.2d-win32\ssl\.
Rename it to cert.crt and put it in c:\openssl-1.0.2d-win32\ssl\certs\.
So:
c:\openssl-1.0.2d-win32\ssl\cert.pem
c:\openssl-1.0.2d-win32\ssl\certs\cert.crt
4:
Download https://getcomposer.org/Composer-Setup.exe and install it, It will no longer gives u the ERR_CONNECTION error.
Go to c:\users\YOURUSERNAME.
composer.bat should be there, if not create it yourself.
Add c:\users\YOURUSERNAME to your path.
Edit composer.bat and delete what's in it and put this in #php "%~dp0composer.phar" %*.
Download https://getcomposer.org/composer.phar.
Place composer.phar in c:\users\YOURUSERNAME.
5:
Done.
Composer will now install laravel using: composer global require "laravel/installer=~1.1" with no problem.
(Plus: now composer command is available globally instead of using it like: php composer.phar or php bin\composer).