Ubuntu Server 18.04 LTS with all the latest updates (as of today).
I tried running php upgrade.php
and got:
Welcome to the Snipe-IT upgrader.
Please note that this script will not download the latest Snipe-IT
files for you unless you have git installed.
It simply runs the standard composer and artisan
commands needed to finalize the upgrade after.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! WARNING !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! If you have any encrypted custom fields, BE SURE TO run the recrypter if upgrading from v3 to v4.
!! See the Snipe-IT documentation for help:
!! https://snipe-it.readme.io/docs/upgrading-to-v4
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! WARNING !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
--------------------------------------------------------
STEP 1: Backing up database:
--------------------------------------------------------
-- Starting backup...
Dumping database snipeit_data...
Backup failed because The dump process failed with exitcode 2 : Misuse of shell builtins : sh: 1: cannot create /var/www/snipe-it/storage/laravel-backups/temp//snipeit_data.sql: Directory nonexistent
.
Backup failed because: The stream or file "/var/www/snipe-it/storage/logs/laravel.log" could not be opened: failed to open stream: Permission denied.
In StreamHandler.php line 107:
The stream or file "/var/www/snipe-it/storage/logs/laravel.log" could not be opened: f
ailed to open stream: Permission denied
--------------------------------------------------------
STEP 2: Putting application into maintenance mode:
--------------------------------------------------------
--
In StreamHandler.php line 107:
The stream or file "/var/www/snipe-it/storage/logs/laravel.log" could not be opened: f
ailed to open stream: Permission denied
--------------------------------------------------------
STEP 3: Pulling latest from Git (master branch):
--------------------------------------------------------
Git is installed.
fatal: Unable to create '/var/www/snipe-it/.git/index.lock': Permission denied
fatal: Unable to create '/var/www/snipe-it/.git/index.lock': Permission denied
Cannot save the current index state
error: cannot open .git/FETCH_HEAD: Permission denied
-- -- -- --------------------------------------------------------
Step 4: Cleaning up old cached files:
--------------------------------------------------------
-- No bootstrap/cache/compiled.php, so nothing to delete.
-- Deleting bootstrap/cache/services.php. It it no longer used.
-- No bootstrap/cache/config.php, so nothing to delete.
-- Configuration cache cleared!
-- Cache cleared successfully.
-- Route cache cleared!
-- Compiled views cleared!
--------------------------------------------------------
Step 5: Updating composer dependencies:
(This may take an moment.)
--------------------------------------------------------
-- We couldn't find a local composer.phar - trying globally.
Cannot create cache directory /home/jcoombes/.composer/cache/repo/https---repo.packagist.org/, or directory is not writable. Proceeding without cache
Cannot create cache directory /home/jcoombes/.composer/cache/files/, or directory is not writable. Proceeding without cache
Generating optimized autoload files
^C
You can see I killed it at the end there. So I moved onto trying to update manually, so I started by running php artisan snipeit:backup
and got:
Starting backup...
Dumping database snipeit_data...
Backup failed because The dump process failed with exitcode 2 : Misuse of shell builtins : sh: 1: cannot create /var/www/snipe-it/storage/laravel-backups/temp//snipeit_data.sql: Directory nonexistent
.
Backup failed because: The stream or file "/var/www/snipe-it/storage/logs/laravel.log" could not be opened: failed to open stream: Permission denied.
In StreamHandler.php line 107:
The stream or file "/var/www/snipe-it/storage/logs/laravel.log" could not be opened: f
ailed to open stream: Permission denied
So I am reasonably sure that this is a permissions issue, though I cannot for the life of me think how those got screwed up, and I am absolutely not sure what they should be set to.
Can anyone help me with this?
Here is the ls output for the folder:
ls -alh
total 1016K
drwxr-xr-x 16 www-data www-data 4.0K Jan 15 2019 .
drwxr-xr-x 4 root root 4.0K Nov 1 2018 ..
-rw-r--r-- 1 www-data www-data 44K Nov 1 2018 .all-contributorsrc
drwxr-xr-x 17 www-data www-data 4.0K Nov 1 2018 app
-rw-r--r-- 1 www-data www-data 1.7K Nov 1 2018 artisan
drwxr-xr-x 3 www-data www-data 4.0K Nov 1 2018 bootstrap
-rw-r--r-- 1 www-data www-data 875 Nov 1 2018 bower.json
-rw-r--r-- 1 www-data www-data 9.0K Nov 1 2018 c3.php
-rw-r--r-- 1 www-data www-data 373 Nov 1 2018 codeception.yml
-rw-r--r-- 1 www-data www-data 3.2K Nov 1 2018 CODE_OF_CONDUCT.md
-rw-r--r-- 1 www-data www-data 2.3K Nov 1 2018 composer.json
-rw-r--r-- 1 www-data www-data 227K Nov 1 2018 composer.lock
drwxr-xr-x 2 www-data www-data 4.0K Jan 15 2019 config
-rw-r--r-- 1 www-data www-data 317 Nov 1 2018 CONTRIBUTING.md
-rw-r--r-- 1 www-data www-data 90 Nov 1 2018 crowdin.yml
drwxr-xr-x 5 www-data www-data 4.0K Nov 1 2018 database
drwxr-xr-x 2 www-data www-data 4.0K Nov 1 2018 docker
-rw-r--r-- 1 www-data www-data 3.2K Nov 1 2018 Dockerfile
-rw-r--r-- 1 www-data www-data 67 Nov 1 2018 .dockerignore
-rw-r--r-- 1 www-data www-data 2.8K Nov 1 2018 .env
-rw-r--r-- 1 root root 2.9K Jan 15 2019 .env.example
-rw-r--r-- 1 www-data www-data 1.8K Nov 1 2018 .env.testing
-rw-r--r-- 1 www-data www-data 1.8K Nov 1 2018 .env.testing-ci
-rw-r--r-- 1 www-data www-data 536 Nov 1 2018 .env.tests
-rw-r--r-- 1 www-data www-data 491 Nov 1 2018 .env.unit-tests
-rw-r--r-- 1 www-data www-data 1.7K Nov 1 2018 gh-changelog.php
drwxr-xr-x 8 www-data www-data 4.0K Jan 15 2019 .git
-rwxr-xr-x 1 www-data www-data 11 Nov 1 2018 .gitattributes
drwxr-xr-x 3 www-data www-data 4.0K Nov 1 2018 .github
-rwxr-xr-x 1 www-data www-data 1.1K Nov 1 2018 .gitignore
-rw-r--r-- 1 www-data www-data 251 Nov 1 2018 .htaccess
-rw-r--r-- 1 www-data www-data 956 Nov 1 2018 index.html
-rwxr-xr-x 1 www-data www-data 371 Nov 1 2018 install.sh
-rwxr-xr-x 1 www-data www-data 34K Nov 1 2018 LICENSE
-rw-r--r-- 1 www-data www-data 441K Nov 1 2018 npm-shrinkwrap.json
-rw-r--r-- 1 www-data www-data 1.8K Nov 1 2018 package.json
-rw-r--r-- 1 www-data www-data 1.1K Nov 1 2018 phpunit.xml
drwxr-xr-x 8 www-data www-data 4.0K Jan 15 2019 public
-rw-r--r-- 1 www-data www-data 45K Nov 1 2018 README.md
drwxr-xr-x 6 www-data www-data 4.0K Nov 1 2018 resources
drwxr-xr-x 3 www-data www-data 4.0K Nov 1 2018 routes
drwxr-xr-x 2 www-data www-data 4.0K Nov 1 2018 sample_csvs
-rw-r--r-- 1 www-data www-data 567 Nov 1 2018 server.php
-rwxr-xr-x 1 www-data www-data 22K Nov 1 2018 snipeit.sh
drwxrwxr-x 7 www-data www-data 4.0K Nov 1 2018 storage
drwxr-xr-x 10 www-data www-data 4.0K Nov 1 2018 tests
-rw-r--r-- 1 root root 2.8K Jan 15 2019 .travis.yml
-rw-r--r-- 1 www-data www-data 6.1K Nov 1 2018 upgrade.php
-rw-r--r-- 1 www-data www-data 3.4K Nov 1 2018 Vagrantfile
drwxr-xr-x 51 www-data www-data 4.0K Nov 1 2018 vendor
-rw-r--r-- 1 www-data www-data 2.1K Nov 1 2018 webpack.mix.js
EDIT: I just changed the permissions on everything in the /var/www/snipe-it folder to 755, and made sure that everything is owned by www-data and the group is www-data. I am still getting all these permission errors when trying to upgrade.