Force PHP Guzzle to use IPV4

Leave a Comment
You may be connection timeout error, while making API request via Guzzle. It may caused by following issues. 1. Check your internet connectivity. 2. It may be misconfiguration of IPV6 in your server. So you may need disable IPV6 or set the priority to IPV4. Just follow below tutorial to set priority to IPV4 over IPV6. https://forum.smarttutorials.net/2020/06/checking-http-connectivity-to-packagist-fail-composer-Linux.html Provide following option to Guzzle while making HTTP request.

'force_ip_resolve' => 'v4',

GET Request


<?php
use GuzzleHttp\Client as Guzzle;

$guzzle = new Guzzle();

$res = $guzzle->get($api_url, [
    'http_errors' => false,
    'verify' => false,
    'force_ip_resolve' => 'v4',
    'query' => [
        'user' => 'muni'
    ]
]);

POST Request


<?php
use GuzzleHttp\Client as Guzzle;

$guzzle = new Guzzle();

$guzzle->request('post', $api_url, [
    'http_errors' => false,
    'verify' => false,
    'force_ip_resolve' => 'v4',
    'form_params' => [
        'request_url'  => $url,
        'name' => 'muni'
    ]
]);

The "https://packagist.org/packages.json" file could not be downloaded: failed to open stream: Connection timed out

Leave a Comment
You may face this issue because following issue. 1. Check your internet connectivity 2. If your system is not IPV6 configured properly, then you may get this Connection timed out error.

Linux - Workaround

Here we are setting more prority to IPV4 than IPv6.
sudo sh -c "echo 'precedence ::ffff:0:0/96 100' >> /etc/gai.conf"

checking http connectivity to packagist fail composer Linux

Leave a Comment
You may face this error, if your system is not configured IPV6 properly.

Linux - Workaround

Here we are setting more prority to IPV4 than IPv6.
sudo sh -c "echo 'precedence ::ffff:0:0/96 100' >> /etc/gai.conf"

Could not open a connection to your authentication agent.

Leave a Comment
You are getting this error because ssh-agent is not started, so please start your ssh-agent using following command.


eval `ssh-agent -s`
 


After ran above command next run your ssh-add command
ssh-add YOUR-SSH-KEY

unable to resolve class edu.umd.cs.findbugs.annotations.SuppressFBWarnings @ line 29, column 1. import edu.umd.cs.findbugs.annotations.SuppressFBWarnings Jenkins

Leave a Comment
I had faced similar issue after upgrading Jenkins.

Once you had upgraded Jenkins, Please update all your Jenkins plugins as well. Mostly this will solve this issue.

Set Page Title Using 'title' option of htmlWebpackPlugin & Vue-Cli in Vue.config.js

Leave a Comment
We can set page title using vue.config.js file for the VueJS application that has been created using Vue CLI.

Please create vue.config.js file in your project root directory and restart your application using npm run serve command.


module.exports = {
    chainWebpack: (config) => {
        config
            .plugin('html')
            .tap((args) => {
                args[0].title = 'Chikku Fresh';
                return args;
            });
    },
};

ErrorException : Return value of "Illuminate\Foundation\Console\PackageDiscoverCommand::execute()" should always be of the type int since Symfony 4.4, NULL returned

Leave a Comment
This issue Laravel 6.* installation getting failing because PHP Error Suppress operator (@) is disabled in PHP configuration file using following directive.

scream.enabled=1;

#or 

xdebug.scream =1;

This scream directive will disable the effects of error suppression operator (@).

So please disable the following directive in your php.ini file.

scream.enabled=0;

#or 

xdebug.scream =0;