Error executing “PutObject” on AWS - laravel-5

I am trying to read .png file from storage path of laravel and upload the same into amazon s3, but i'm getting this below issue:
{
"code": 422,
"status": "error",
"data": {
"exception": "Error executing \"PutObject\" on \"https://s3.amazonaws.com/mrxmms/123/12345_ach.png\"; AWS HTTP error:
count(): Parameter must be an array or an object that implements
Countable"
},
"message": "Unprocessable Entity" }
Here is my sample code:
$dir = storage_path('uploads'); $image_val = $dir. '/'
."product.png";
$image_load =
Storage::disk('s3')->put("123/12345.png",file_get_contents($image_val));
Can someone please help me? Thanks in advance!!

This issue hit me recently when using Guzzle in version 6.2.1 and AWS SDK in version 3.*
Updating Guzzle to 6.3.* solved the issue for me.
composer require guzzlehttp/guzzle:6.3.*
Hope that helps.

Related

Login, Register problem in laravel 8 Cpanel

The route is https://test.iqbal.live/api/auth/login/
field: username , password
enter image description here
In local environment its fine, when i upload it cpanel give the error below:
{
"message": "The GET method is not supported for this route. Supported methods: POST.",
"exception": "Symfony\\Component\\HttpKernel\\Exception\\MethodNotAllowedHttpException",
}
Try with postman ... its working...

Malformed UTF-8 characters, possibly incorrectly encoded with Guzzle/Http

I have an API created for export records in xlsx. It is working fine when I call the API directly but if I am using Guzzle/Http to call the API and this was tested using Postman, I get the following error:
"message": "Malformed UTF-8 characters, possibly incorrectly encoded",
"exception": "InvalidArgumentException",
"file": "C:\\xampp\\htdocs\\borneoshop-admin-laravel\\vendor\\laravel\\framework\\src\\Illuminate\\Http\\JsonResponse.php",
"line": 75, ......
Is there any additional configuration I will have to set?
Please help. Thanks.
Edit
I have 2 laravel API projects, for example, A and B. The excel export API (/a/export) has to be called in another laravel API (/b/download) with Guzzle/Http. Using Postman, I was testing both APIs and the "/a/export" API was working fine but if I called "/b/download" which I am using Guzzle/Http here with codes,
$client = new \GuzzleHttp\Client();
$res = $client->post($url, ['form_params' => $parameter]);
$content = $res->getBody()->getContents();
return $content;
I am getting the error response as shown above.

PCEP-SR draft version 6, SR Explicit Route Object/Record Route Object subobjects

I am setting up Segment routing via Pathman-SR with ODL Nitrogen Controller and vMX Juniper routers. To allow this, I have to change IANA subojbects code points, but I am unable to do it...
Followed this documenntations, but still no result:
https://docs.opendaylight.org/en/stable-carbon/user-guide/pcep-user-guide.html#segment-routing
https://test-odl-docs.readthedocs.io/en/latest/user-guide/pcep-user-guide.html
I tried to update configuration via REST API, but when I send PUT request:
/restconf/config/pcep-segment-routing-app-config:pcep-segment-routing-app-config
with the body:
<pcep-segment-routing-config xmlns="urn:opendaylight:params:xml:ns:yang:controller:pcep:segment-routing-app-config">
<iana-sr-subobjects-type>true</iana-sr-subobjects-type>
</pcep-segment-routing-config>
I get the following error:
{
"errors": {
"error": [
{
"error-type": "protocol",
"error-tag": "invalid-value",
"error-message": "URI has bad format. Possible reasons:\n 1. \"pcep-segment-routing-app-config:pcep-segment-routing-app-config\" was not found in parent data node.\n 2. \"pcep-segment-routing-app-config:pcep-segment-routing-app-config\" is behind mount point. Then it should be in format \"/yang-ext:mount/pcep-segment-routing-app-config:pcep-segment-routing-app-config\"."
}
]
}
}
I think there is a typo in the URL in the doc, you have to use /restconf/config/pcep-segment-routing-app-config:pcep-segment-routing-config
You can check this guide for reference:
https://docs.opendaylight.org/projects/bgpcep/en/stable-neon/pcep/pcep-user-guide-active-stateful-pce.html#iana-code-points

Kony service giving 1012 opstatus Request failed error and not giving response

I have a kony sample app where I am trying to do a build and the app has one web service in it for fetching categories of some product. I have the following code also that I wrote:
function GetCategories() {
var inputparam = {
"appID": "bbuy",
"serviceID": "GetCategories",
"catId": "cat00000",
"channel": "rc",
"httpheaders": {}
};
kony.net.invokeServiceAsync("http://192.168.42.134/middleware/MWservlet",inputparam, serv_GetCategoriesCallback);
}
I am getting no response for this. Getting 1012 opstatus and the message is saying "Request failed" error.
kony.net.invokeServiceAsync("http://192.168.42.134/middleware/MWservlet",inputparam, serv_GetCategoriesCallback);
In the above line, you have not given the port number in the MWservlet URL.(e.g. 8080) Give that and check.
Also, make sure all input params are being fed to the service and that they correspond to the exact naming convention followed in the service editor.
Visit :
Find the below link. i hope it gives you a solution
http://developer.kony.com/twiki/pub/Portal/Docs/API_Reference/Content/Network_APIs.htm#net.invo2
Check the mandatory and optional fields of Inputparam

Updating magento 2.0.x error - always_populate_raw_post_data and other errors

So while updating magento I get the following error:
.setup_cronjob_status
{
"readiness_checks": {
"db_write_permission_verified": true
},
"php_checks": {
"php_version_verified": {
"responseType": "error",
"data": {
"error": "phpVersionError",
"message": "Cannot determine required PHP version: Cannot find php version requirement in 'composer.lock' file"
}
},
"php_extensions_verified": {
"responseType": "success",
"data": {
"required": [],
"missing": []
}
},
"php_settings_verified": {
"responseType": "success",
"data": {
"always_populate_raw_post_data": {
"message": "Your PHP Version is 5.5.32, but always_populate_raw_post_data = -1.\n \t $HTTP_RAW_POST_DATA is deprecated from PHP 5.6 onwards and will be removed in PHP 7.0.\n \t This will stop the installer from running.\n\t Please open your php.ini file and set always_populate_raw_post_data to -1.\n \t If you need more help please call your hosting provider.",
"helpUrl": "http://php.net/manual/en/ini.core.php#ini.always-populate-settings-data",
"error": false
}
}
}
},
"last_timestamp": 1462759382,
"current_timestamp": 1462759625
}
What is the real error?
The phpVersionError ?
Or always_populate_raw_post_data ?
Because as the error says, I already set it to -1.
And if it's phpVersionError, how do I resolve it?
I tried composer update on magento and it broke my installation.
Thanks
you have to uncomment always_populate_raw_post_data = -1 in php.ini file If you are using version from Magento 2.0.1 to 2.0.6 but magento 2.0.7 doesn't support php 5.5 So, better way is to use php 5.6 for magento 2.0.x

Resources