Fresh prestashop 1.7 install curl timeout - prestashop-1.7

I am trying to install Prestashop on my local machine
Using ubuntu 18.04, php 7.2, mysql 5.6, apache 2.4
I have cloned from their github repo, checkouted to branch 1.7.6.x, installed composer dependencies and made a symbolic link to the code directory from my /var/www/html (didn't want to bother creating a vhost)
Opened chromium to http://127.0.0.1/prestashop/install-dev/index.php
Proceeded with all steps, with correct mysql settings, directory permission settings, left the language to English (English)
But during the Store Installation step, when "Installing addons modules", it fails with a curl error like this:
file_get_contents_curl failed to download http://i18n.prestashop.com/translations/1.7.6.7/en-US/en-US.zip : (error code 28) Operation timed out after 5001 milliseconds with 221832 out of 516048 bytes received
I also have the following info in the Request tab of my inspector:
It's calling http://127.0.0.1/prestashop/install-dev/index.php?installModulesAddons=true&_=1596718771175 with status_code 200
I have the following as response body in there:
{
"success":false,
"message":"file_get_contents_curl failed to download http:\/\/i18n.prestashop.com\/translations\/1.7.6.7\/en-US\/en-US.zip : (error code 28) Operation timed out after 5001 milliseconds with 221832 out of 516048 bytes received"
}
I checked the file in install-dev/controllers/http/process.php but the code that I think is called just looks like this:
/**
* PROCESS : installModulesAddons
* Install modules from addons
*/
public function processInstallAddonsModules()
{
$this->initializeContext();
if (($module = Tools::getValue('module')) && $id_module = Tools::getValue('id_module')) {
$result = $this->model_install->installModulesAddons(array('name' => $module, 'id_module' => $id_module));
} else {
$result = $this->model_install->installModulesAddons();
}
if (!$result || $this->model_install->getErrors()) {
$this->ajaxJsonAnswer(false, $this->model_install->getErrors());
}
$this->session->process_validated = array_merge($this->session->process_validated, array('installModulesAddons' => true));
$this->ajaxJsonAnswer(true);
}
I suspect my faulty internet is to blame, but is there a workaround to increase the curl timeout?

Comment the code lines like this:

Related

Shopware 6: Cypress test - reset database failed

I try to cleanup my database with command cy.cleanUpPreviousState:
// mytest.cy.js
...
beforeEach(() => {
cy.cleanUpPreviousState()
})
...
the request was response with error:
CypressError
cy.request() failed trying to load:
http://my-route.dev.localhost:8005/cleanup
The app runs in docker container, using shyim/shopware-docker
Questions
What is wrong with my request/route?
Which controller has to take this request?
To find out what is wrong, have a log at the network tab request log.
Answering your second question: There is a special server spun up for this action. It is not a normal Shopware route.
See in the cypress.js - it is supposed to use psh.phar to clean-up when this URL is called.
const requestedUrl = request.url;
if (requestedUrl !== "/cleanup") {
response.end();
return;
}
return childProcess.exec(
`${PROJECT_ROOT}/psh.phar e2e:cleanup`,
[...]
server.listen(8005);
So things to check are:
Is that port forwarded to your docker container?
Are you using the development template and is psh.phar existing?

Laravel / Twilio: Twilio\Exceptions\ConfigurationException Credentials are required to create a Client

So I am trying to use the SMS (text message) function in Laravel / Twilio - I have a local machine which I tested it on and the credentials and everything works fine- I use the same code on my remote machine (which worked fine yesterday) and today I am getting an error: "Error: Credentials are required to create a Client"
I have triple confirmed the credentials are correct, I have even hard coded them into the code , I have moved them from the env file to config file and still not working - I have retested my local machine and it works still - I have copied the code from local machine (working) to remote machine and still not working - the only difference between the two is I have changed the SMTP settings in the env file (even if I remove this , the problem still exists). I have cleared cache, restarted services.
my .env file
TWILIO_SID=xxxxxxxxxx
TWILIO_TOKEN=xxxxxxxxxxxxxxx
TWILIO_FROM=+1xxxxxxxxxxxxx
my Twiliocontroller:
public function smsSend()
{
$receiverNumber = "+111111111";
$message = "Sup Dude";
try {
$account_sid = getenv("TWILIO_SID");
$auth_token = getenv("TWILIO_TOKEN");
$twilio_number = getenv("TWILIO_FROM");
$client = new Client($account_sid, $auth_token);
$client->messages->create($receiverNumber, [
"from" => $twilio_number,
"body" => $message,
"statusCallback" => "https://webhook.site/xxxxxxxxxxxxxx"
]);
dd('SMS Sent Successfully.');
} catch (Exception $e) {
dd("Error: " . $e->getMessage());
}
}
My web.php
Route::get('/smssend', [TwilioController::class, 'smsSend'])->name('smsSend');
Any help would be greatly appreciated

File Upload - Error executing ListObjects | AWS S3 & Laravel

I am getting the error below when i try to upload a file greater than 25mb to amazon s3 using laravel aws sdk, however files below 25mb are uploading successfully. I have everything setup correctly in my .env file. I have no idea why this is happening.
Any help would be appreciated.
Error:
Error executing "ListObjects" on
"bucketdomain/?prefix=b6d767d2f8ed5d21a44b0e5886680cb9%filename%2F&max-keys=1&encoding-type=url";
AWS HTTP error: cURL error 7: Failed to connect to bucketdomain
port 443: Network unreachable (see
http://curl.haxx.se/libcurl/c/libcurl-errors.html)
Save function in laravel:
$v = Storage::disk('s3')->put($path, file_get_contents($file), 'public');
unlink($file->getPathname());
return response()->json(["message" => "File uploaded successfully!"]);
Upload function in laravel:
if ($receiver->isUploaded() === false) {
throw new UploadMissingFileException();
}
$save = $receiver->receive();
if ($save->isFinished()) {
database entries...
return $this->saveChunkFile($file,$userFolderName,$path,$fileName);
}
$handler = $save->handler();
return response()->json([
"Percentage" => $handler->getPercentageDone()
]);
I am using reusable.js in client side to upload files in chunks & the code above is to handle the chunks and merge them when done and pass to the saveChunkFile function.
Picture:
The file is to be stored in the 2nd folder from top but there is not file that is why i think the error is thrown on size function and these files (chunks) are being generated and not stopping still.

How do I use the DSC package resource to install MongoDB?

I tried what seemed to be the straight-forward approach, and added a Package resource in my node configuration for the MongoDB MSI. I got the following error: "Could not get the https stream for file".
Here's the package configuration I tried:
package MongoDB {
Name = "MongoDB 3.6.11 2008R2Plus SSL (64 bit)"
Path = "https://fastdl.mongodb.org/win32/mongodb-win32-x86_64-2008plus-ssl-3.6.11-signed.msi"
ProductId = "88F7AA23-BDD2-4EBE-9985-EBB5D2E23E83"
Arguments = "ADDLOCAL=`"all`" SHOULD_INSTALL_COMPASS=`"0`" INSTALLLOCATION=`"C:\MongoDB\Server\3.6`""
}
(I had $ConfigurationData references in there, but substituted for literals for simplicity)
I get the following error:
Could not get the https stream for file
Possible TLS version issue? I found that Invoke-WebRequest needed the following to get it to work with that same mongo download URL. Is there a way to do this with the package resource?
[Net.ServicePointManager]::SecurityProtocol = "tls12, tls11, tls"
Using nmap to interrogate both nodejs.org and fastdl.mongodb.org (which is actually on cloudfront) it was indeed true that TLS support differed. Node still supports TLS version 1.0, which so happens to work with PowerShell. But MongoDB's site only supports TLS versions 1.1 or 1.2.
As I mentioned in my question, I suspected that setting the .Net security protocol work, and indeed it does. There's no way to add arbitrary script to the DSC package resource, so I needed to make a script block just to run this code, and have the package resource depend on it.
This is what I got to work:
Node $AllNodes.Where{$_.Role -contains 'MongoDBServer'}.NodeName {
Script SetTLS {
GetScript = { #{ Result = $true } }
SetScript = { [Net.ServicePointManager]::SecurityProtocol = "tls12, tls11, tls" }
TestScript = { $false } #Always run
}
package MongoDB {
Ensure = 'Present'
Name = 'MongoDB 3.6.11 2008R2Plus SSL (64 bit)'
Path = 'https://fastdl.mongodb.org/win32/mongodb-win32-x86_64-2008plus-ssl-3.6.11-signed.msi'
ProductId = ''
Arguments = 'ADDLOCAL="all" SHOULD_INSTALL_COMPASS="0" INSTALLLOCATION="C:\MongoDB\Server\3.6"'
DependsOn = '[Script]SetTLS'
}
...

Laravel SSH: Remote connection [] not defined

My code in routes.php is as follows:
Route::get('/pull/{key?}', array('as' => 'install', function($key = null) {
if($key == "JfjkGmn7JUIygNHf8jh&ygnfrYub"){
SSH::run(array(
'cd /var/www/',
'git pull https://myusername:mypass#bitbucket.org/mygroup/myrep.git'
));
echo 'Pull from Bitbucket.org is done... Do not forget to migrate though! Click here to continue';
} else {
App::abort(404);
}
}));
But I get the error InvalidArgumentException in RemoteManager.php line 156:
Remote connection [] not defined.. Can anyone tell wme where and when to set a connection? It should be local, so my guess was that I do not need to set it.
In Laravel 5 there is no more SSH. There is a separate package for that - SSH for Laravel 5 so looking at documentation you need to configure connection in config/remote.php. In Laravel 4.2 SSH was built in framework - documentation for SSH in Laravel 4.2

Resources