Tech Home The Bacon

Technology Blog

Month: November 2018

Magento 2.2 SQL Rollback Failed

Problem:

I took a SQL backup of my Magento 2.2 dev site before I did some testing. The testing didn’t go as planned so I tried the rollback feature from inside the Magento admin panel. The rollback process started, but then the page just went blank. 

When I did a refresh the page said I was in maintenance mode. I decided to SSH into the AWS instance and see what was going on. The server seemed okay, but it was stuck in maintenance mode. I disable maintenance mode and decided to run the rollback from the terminal

Continue reading

Magento 2 and AWS SES – Password Resets Not Sending

Problem: 

I’ve setup the SMTP extension from Mageplaza and successfully sent and email with AWS SES. I tried resetting a user’s password, but the end user never receives the password reset email. 

Solution: 

The password reset emails use the Customer Support email address. If this is not configured SES will not deliver it. 

Go to Stores –> Configuration –> General –> Store Email Addresses and configure your customer support sender email address that is authorized to send through SES. 

Python 3 & Wget – Download Images from CSV.

Objective

I wanted to download a list of files from an S3 bucket using python 3. I used a standard CSV in UTF-8 format. Here is an example CSV. It’s one column with just the filenames. 

I could have built out the full url in the CSV, but I decided to just do it in the code.  Below is the full python script. 

import csv
import wget
#open import file
with open("c:\\csv\\files-to-download.csv", newline='', encoding='utf-8') as f:
#Assign the import file to the DictReader "reader"    
    reader = csv.DictReader(f)
    #Now loop through all rows and build out variables    
    for row in reader:
        filename = row['name']
        print('Beginning file download with wget module')
        url = 'http://www.example.com/images/'
        wget.download(url + filename, 'c:\\csv\\images\\' + filename) 

Continue reading

© 2018 Tech Home The Bacon

Theme by Anders NorenUp ↑