0

I am trying to upload my laravel project to AWS using elastic beanstalk. However, every time I upload the project (using the UI button "upload and deploy") I get the following error during deployment:

[Instance: i-064b98ad84a27d750] Command failed on instance. Return code: 1 Output: chmod: cannot access ‘/var/app/current/storage’: No such file or directory. Hook /opt/elasticbeanstalk/hooks/appdeploy/post/99_make_storage_writable.sh failed. For more detail, check /var/log/eb-activity.log using console or EB CLI.

My .ebextensions file (named: "04postdeploy.config") looks like this:

files:
  "/opt/elasticbeanstalk/hooks/appdeploy/post/99_make_storage_writable.sh":
    mode: "000755"
    owner: root
    group: root
    content: |
      #!/usr/bin/env bash
      chmod -R 777 /var/app/current/storage

Can someone please point me out what I am doing wrong?

Thanks in advance!

SagarB
  • 31
  • 5
  • To be sure, does `/var/app/current/storage` actually exist within you application's source code? – progfan Jul 19 '18 at 19:35

2 Answers2

2

I try to answer, even if it's been a while, but maybe need someone else. The same problem happened to me, on an environment already in production on AWS. In my case the error was in the zip file that I was loading, instead of creating it inside the folder, it created me a higher directory.

Myfox
  • 51
  • 4
  • This happened to me as well. I compressed the higher directory instead of selecting all files and creating a zip file from that. – Olusola Omosola Dec 13 '19 at 01:47
0

After running eb logs, I found, by following the order of the downloads, that i got an error while i was downloading the requirement pkg-resources==0.0.0. I found here that adding this requirement to the requirements.txt is a bug in Ubuntu, after I removed this line from my requirements.txt file, I was able to successfully deploy my application.