Magento 2 - Error Running Setup:upgrade

When trying to update a Magento 2 database recently using: php bin/magento setup:upgrade I also tried: php bin/magento setup:upgrade --keep-generated I got the following error: [Exception] Warning: file_get_contents(.../var/di/setup.ser): failed to open stream: No such file or directory in .../vendor/magento/framework /App/ObjectManager/ConfigLoader/Compiled.php on line 28 It looks like a regression was introduced in 2.1.0 that stops you running setup:upgrade after running setup:di:compile. A temporary fix for this is to remove all contents from var/di and var/generation, run the update and then re-compile. Read On →

Magento 2 Migrations

Contents Introduction Magento 1.x Migrations Magento 2.x Migrations Edmonds Commerce Migrations Introduction Database Migrations See also: Database migrations are a way of setting database state pragmatically, it is used in various frameworks, platforms and ORMs like Laravel’s Eloquent, Symfony’s Doctrine among many. There are many different use cases for migrations during development, they can be used to reduce the technical debt to a database during development allowing it to be a decoupled part of the project. Read On →

Installing Libsodium and Pecl-libsodium on Centos7 and Php7

If you would like to work with state of the art encryption techniques in your PHP project then you need to check out libsodium and the corresponding PHP library, pecl-libsodium Getting it installed on your centos7 and PHP7 box though can be a little tricky Here is a bash script which will install all the required depencies and get it working: #!/usr/bin/env bash if [[ "$(whoami)" != "root" ]] then Read On →

Basic Clustat and Clusvcadm Usage

I had to work on one of UKFasts clustered servers today and learnt a few new commands. I wanted to record these here mainly for my future self but hopefully you’ll find them useful too. clustat This is the first command you’ll want to run (as root) on the server. This will give you the current status of all the cluster nodes and services. clusvcadm This is the command you’ll use to managage services (such as mysql). Read On →

Magento Api Logging

I recently had the need to debug the Magento API and instantly took to Google to see what solutions already existed. I found a few solutions on stackoverflow but these all involved either changing core files, adding code to index.php or setting up a proxy. After looking into this further I realised all the API calls come through a set of controllers in Mage_Api. In order to log all API calls I simply needed to rewrite the controllers, add my logging code and then call the original controller. Read On →

Portable System Update on Shutdown

Another Update on Shutdown Solution? While the other solutions on this blog (here and here) are probably more elegant they have dependencies on either the desktop (Gnome) or systemd. This solution should be portable across Linux distros and desktops. The Solution define a specification for application launchers. These launchers will run on all compatible desktops (which means almost all Linux desktops). The desktop launcher for update on shutdown can be created using the following command: cat <<'EOF' | bash echo "[Desktop Entry] Name=Shutdown Exec=gnome-terminal --command=\"sudo bash -c 'dnf -y upgrade; shutdown now'\" Type=Application Terminal=true" > ~/.local/share/applications/shutdown.desktop; chmod u+x ~/.local/share/applications/shutdown.desktop; ln -s ~/.local/share/applications/shutdown.desktop ~/Desktop/shutdown.desktop EOF This should give you a launcher on your desktop as well as in your normal application menu. Read On →