Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error After Upgrading Docker Container #1235

Closed
dwmunster opened this issue Mar 8, 2018 · 9 comments
Closed

Error After Upgrading Docker Container #1235

dwmunster opened this issue Mar 8, 2018 · 9 comments

Comments

@dwmunster
Copy link

I am running Firefly III version 4.7.1.4.

Description of my issue:

After upgrading from 4.7.0, an unrecoverable error is generated every time I attempt to visit my Firefly instance.

file_put_contents(/var/www/firefly-iii/storage/framework/cache/data/79/42/7942698bef726131c5478e8a9c79d865c6c9ad9a): failed to open stream: No such file or directory

Steps Attempted

  1. Start with working 4.7.0 instance deployed through docker-compose.
  2. docker-compose down
  3. docker pull jc5x/firefly-iii
  4. docker-compose -f docker-compose.yml up -d
docker exec -it <container> php artisan migrate
docker exec -it <container> php artisan firefly:upgrade-database
docker exec -it <container> php artisan firefly:verify
docker exec -it <container> php artisan passport:install
  1. Despite above steps all reporting success, unable to access instance.
docker exec -it <container> php artisan cache:clear
docker exec -it <container> php artisan config:clear
docker exec -it <container> php artisan route:clear
docker exec -it <container> php artisan view:clear
  1. Clear all browser cookies and local files.
  2. Still unable to access instance.

Other important details (log files, system info):

The apache2handler log file:
[2018-03-08 15:40:44] local.ERROR: file_put_contents(/var/www/firefly-iii/storage/framework/cache/data/79/42/7942698bef726131c5478e8a9c79d865c6c9ad9a): failed to open stream: No such file or directory {"exception":"[object] (ErrorException(code: 0): file_put_contents(/var/www/firefly-iii/storage/framework/cache/data/79/42/7942698bef726131c5478e8a9c79d865c6c9ad9a): failed to open stream: No such file or directory at /var/www/firefly-iii/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php:122)"}

@JC5
Copy link
Member

JC5 commented Mar 8, 2018

Wait, you use docker compose but still pull the image?

@dwmunster
Copy link
Author

dwmunster commented Mar 8, 2018

docker-compose pull does the same thing (or would have if it wasn't already up to date). Just restarting the container didn't seem to pull the latest image when I tried.

Pulling firefly_iii_app (jc5x/firefly-iii:latest)...
latest: Pulling from jc5x/firefly-iii
Digest: sha256:6ab64391700b93eff591fc062c4412aba1cde7a12b93601008c1096a0d4412e8
Status: Image is up to date for jc5x/firefly-iii:latest

@setevoy2
Copy link

setevoy2 commented Mar 8, 2018

@dwmunster Try to add directory manually - I had a similar issue.
Login to your container with:
docker exec -ti <COTAINER_ID> bash
Create dir:
mkdir -p /var/www/firefly-iii/storage/framework/cache/data/79/42/
After this - FF-II will be able to create file 7942698bef726131c5478e8a9c79d865c6c9ad9a (not sure for what it's needed, @JC5 can know better).
Also worth to try to chmod whole /var/www/firefly-iii/storage/framework/cache/data/ to 777 to avoid such errors in future.

@setevoy2
Copy link

setevoy2 commented Mar 8, 2018

@JC5

Wait, you use docker compose but still pull the image?

Same thing.
I have to run docker-compose pull first, then re-create containers.
If you remember my issue with the partial upgrade to 4.7.0 from 4.6.3 - I had same with 4.7.0 => 4.7.1.2 upgrade (a new image was pulled, a database was upgraded but the Version in the bottom right corner still was 4.7.0).
Solved by deleting (!) old container and its volumes and by creating new.
In fact, I just did update in my docker-compose.yml file by changing service name.
I.e. it was:

...
  firefly_iii_app_prod_4_7_0:
    image: jc5x/firefly-iii
...

Now it's is:

...
  firefly_iii_app_prod_4_7_1_2:
    image: jc5x/firefly-iii
...

Then I started FF with docker-compose up -d - and uprade was finished.

@dwmunster
Copy link
Author

Since the owner of storage/framework/cache/data was root:root, I did chown -R www-data:www-data storage/framework/cache/data which seems to have resolved the issue.

@JC5
Copy link
Member

JC5 commented Mar 8, 2018

I'm surprised this was necessary and I'll have to test this further. The whole point of Docker is that such operations are not necessary. After all, you should be able to simple delete your Docker instance and reload it and it works.

I'll keep an eye on this issue for the future and improve the docker container if I can.

@JC5 JC5 closed this as completed Mar 8, 2018
@techytuppers-zz
Copy link

@JC5 I know this is a closed ticket, but just to add that I experienced the exact same issue, and @dwmunster chown fixed the problem completely =/

@JC5
Copy link
Member

JC5 commented Jun 1, 2018

Strange. The current docker entry point contains a chown routine:

# make sure we own the volumes:
chown -R www-data:www-data -R $FIREFLY_PATH/storage/export $FIREFLY_PATH/storage/upload $FIREFLY_PATH/storage/logs $FIREFLY_PATH/storage/cache

@NanneHuiges
Copy link

I ran into this issue and giving a comment on above line for stray googlers that pass here: this line has an error in it I think:

chown -R www-data:www-data [...] $FIREFLY_PATH/storage/cache

as it should be /storage/framework/cache as far as i know.

This is a mood point for newer versions, as the line we are talking about currently reads:

# make sure we own the volumes:
chown -R www-data:www-data -R $FIREFLY_PATH/storage
chmod -R 775 $FIREFLY_PATH/storage

which should be enough for everyone. (apart from the fact this error did just occur and I had to google the error and manually run the chown, but that's not what I came to say :) )
So if you want to manually chown, don't run that comment from the 1 jun reply, but run the newer one or update the path :)

@lock lock bot locked as resolved and limited conversation to collaborators Jan 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants