$config must be a string or an array - arrays

I am having errors when trying to access the subscription section on my app . It's something with the stripe API, this error occurs mostly when server caches are being cleared. I checked to clear caches, check config.app.php, payment controller, and all of that but not really understanding the source of this error!
Therefore I need someone's help, maybe someone who had this issue before here is the code line for that on vendor/stripe/stripe-php/lib/BaseStripeClient.php. please suggest a solution for this error! I will be grateful
if (\is_string($config)) {
$config = ['api_key' => $config];
} elseif (!\is_array($config)) {
throw new \Stripe\Exception\InvalidArgumentException('$config must be a string or an array');
}

make sure you have STRIPE_SECRET and STRIPE_KEY in your .env file
then you can just go with php artisan config:cache
if you have these in you .env file and error persists try removing the the files in bootstrap/cache i.e. rm -rf bootsrap/cache/*

php artisan config:cache run this command

Your application is pulling a cached version of its config. Delete the bootstrap/cache/config.php file and refresh your browser and the error should go away.
I haven't had much luck with running php artisan cache:clear so I just remove the file manually or run the command below.
If you run the terminal command rm -rf bootstrap/cache/* in the root of the application it should remove all the files in the cache directory.

Related

Build error on Vercel after Typescript file in Next.JS renamed

I have time options that I export to specific files named TimeOptions where I have Intl.DateFormat code like this
When I rename the file from TimeOptions to timeOptions, Vercel told that Type error: Cannot find module '../utils/timeOptions' or its corresponding type declarations. on build.
When I built it locally with next build, the results looks fine and no error.
Do you know what's happened? I have tried to setup tsconfig.js as mentioned in other threads but nothing seems to work on Vercel.
Here I attach the tsconfig file.
Thank you very much for your kind help.
It's caused by git not being case sensitive on file naming and not picking up your change.
You can fix it like this:
mv timeOptions.ts temp.ts
git add -A
git commit -m "renaming..."
mv temp.ts TimeOptions.ts
git add -A
git commit --amend -m "Rename timeOptions.ts to TimeOptions.ts"

Magento 2 Label translation showing braces

Labels showing multiple translations between double curly-braces.
I have this problem both on the front and backend of Magento 2.
This is what I've tried so far:
Cleared and flushed the cache
re-deployed static content
Updated Magento 2.2.5 to 2.2.6
Please look at the pictures for more info
Magento 2 Frontend
Magento 2 Backend
Any ideas?
Solution
It's not a pretty fix but I've restored both js-translation.json files at the static frontend and backup folder.
I had the same issue, this issue comes when you did not properly disable the configuration or inline translation configuration.
please check the inline translation or any other configuration and make sure you disable the configuration properly which applies to specific mode(developer) and before updating.
After that please run the following commands
$rm -rf var/cache/* var/view_processed/* generated/code/*
$php bin/magento setup:upgrade
$php bin/magento setup:static-content:deploy
$php bin/magento setup:di:compile
$php bin/magento cache:clean
$chmod 777 -R app/ var/ generated/ pub/
Are you sure you have all php dependencies installed correctly?
Solution was suggested on this stackexchange thread: https://magento.stackexchange.com/questions/245516/why-are-the-admin-labels-showing-curly-braces
I had the same issue several times, and don't know why its happening, but this solved my problem:
Manually delete generated/metadata, generated/code, var/cache, var/page_cache, pub/static (be careful not to delete htaccess files),
then run setup:upgrade, setup:static-content:deploy and cache:clean.
Hope it helps.

SuiteCrm Install error

I´m installing suiteCrm version 7.10.2, license agree works fine, system check works fine but when i´m done with the database and sdmin config and hit next don´t appen anything. I check the console and get the ReferenceError: YAHOO is not defined
I´m installing in my domain and not locally.
In chrome console i get this error
install.php:14 GET https://www.digitalinput.pt/SuiteCRM-7.10.2/cache/include/javascript/sugar_grp1_yui.js?s=6.5.25&c= 404 (Not Found)
but the file exists and i add a 777 permission just to try and nothing changes!
Check your .htaccess file. I can see you are using a subdirectory so make sure you have
rewriteBase /SuiteCRM-7.10.2
That should fix the 404.
you need to give the 'cache' folder write access (Recursively)
if you have access to ssh, you can run this commmand on you terminal :
Note : you need to be in the crm folder path
chmod 0777 -R cache/
then you refresh the page back

Nagios Plugin Error: (No output on stdout) ... failed. errno is 2: No such file or directory

I am using custom Nagios plugins for the first time and am running into this error when I create a service for the plugin.
(No output on stdout) stderr: execvp(/usr/local/nagios/libexec/check_load.py, ...) failed. errno is 2: No such file or directory
The plugin works when I run it on the command line, however does not work when it runs within Nagios.
I followed these steps to get the plugin into Nagios
https://assets.nagios.com/downloads/nagiosxi/docs/Managing-Plugins-in-Nagios-XI.pdf
Here is what it looks like in the Nagios UI
The plugin is in the correct path: /usr/local/nagios/libexec and the resource.cfg file has the same path within it.
I tried two separate plugins, both which work on the command line, and the result is the same error.
The error indicates the file location is incorrect, however the plugin is in the specified directory and runs with no errors within that directory.
I am totally stumped and appreciate any help.
For anyone reading this, I solved the problem.
The first time I added the plugin, I forgot to add the python extension. When I updated the already created plugin, Nagios still threw the error.
Once I completely deleted the plugin and re-created it the 'file not found', error went away.
I faced a similar issue when I was trying to add a custom plugin ( I had custom plugins in ruby and python ).
The issue was the missing shebang line at the start of the script (which determines the script's ability to be executed like a standalone executable).
For example, if you have a python plugin custom-plugin.py then make sure this script has shebang at the start of script #!/usr/bin/env python3. Also if you have other scripts (ruby, bash etc.) make sure to add the appropriate path at the start of your scripts.
Also, check the path for plugins Nagios version. For my setup path was /usr/local/nagios/libexec/ and make sure your custom plugin is executable and has correct ownership permissions.
Sample custom template I used :
define command {
command_name check_switch_health
command_line /usr/local/nagios/libexec/check_snmp.rb --host $HOSTADDRESS$ --model "$ARG1$" --community "$ARG2$"
}
The above workaround worked for me.

CakePHP error on Heroku when Debug set to zero

I have a CakePHP application setup on Heroku using the Heroku PHP buildpack (https://github.com/heroku/heroku-buildpack-php).
With Debug set to 1, the application uses the file cache and reduces the lifespan of the cache. In addition, the DebugKit toolbar appears.
With Debug set to 0, the application uses APC.
When I have Debug set to 1, it works properly, but the DebugKit toolbar shows up and the caching is essentially shutoff. When I set Debug = 0 I get the standard "Internal Error" message. Running "heroku logs" only shows me errors relating to php not being able to write to the tmp directory (specifically for error logs). I attempted to have cakePHP write to stdout, but that didn't help.
To see what exactly was causing the problem, I removed DebugKit from the installation and made the caching for Debug=1 match Debug=0. I thought this would cause the app to error again, but it's still working. Is there anything else that happens when Debug is turned off that could be causing this, or did I miss something with the error logs error?
I managed to get this working eventually. The answer was to make sure the app/tmp directory and all of the children directories were being created by the buildpack. I was under the impression that cakePHP wouldn't worry about them if it didn't need them, but I was incorrect.
I wanted to keep them out of the repo, so in the buildpack compile file I added:
CAKEPHP_APP_TMP_PATH="www/app/tmp"
# make tmp dir
echo "-----> Creating CakePHP tmp directories"
mkdir -p $CAKEPHP_APP_TMP_PATH/cache/models
mkdir -p $CAKEPHP_APP_TMP_PATH/cache/persistent
mkdir -p $CAKEPHP_APP_TMP_PATH/cache/views
mkdir -p $CAKEPHP_APP_TMP_PATH/logs
mkdir -p $CAKEPHP_APP_TMP_PATH/sessions
mkdir -p $CAKEPHP_APP_TMP_PATH/tests
chmod -R 777 $CAKEPHP_APP_TMP_PATH
With that, the directories were in place, but they never appear to be used. The app is now properly running with Debug set to 0.
It would be ideal if you could get write access to the tmp folder so that you can see the logs.
These Internal Error with Cake are usually related to the caching of the models. So in APC you may have and old cache that does not really match up with your database.
Try clearing the APC cache and see if that helps.
PS: The cake app has a couple of caches, so you'll have to make sure what uses what... you have the default, _cake_core_ and _cake_model_ at least! The last two could be the source of your problems.

Resources