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 500: this app is not Heroku friendly #1893

Closed
hadifarnoud opened this issue Jun 4, 2016 · 13 comments
Closed

error 500: this app is not Heroku friendly #1893

hadifarnoud opened this issue Jun 4, 2016 · 13 comments
Milestone

Comments

@hadifarnoud
Copy link

hadifarnoud commented Jun 4, 2016

Cachet version 2.2.2
Database Postgres
PHP version 7.0.7

I'm running into all kinds of issues with Cachet. I managed to solve most issues myself but have no idea how to solve this one.

it seems like Cachet relies on dotenv package to load environment variables even in production. This is creating issue with Heroku.

in order to get over dotenv issue I committed an empty .env, but still can't manage to fix this 500 error

[2016-06-04 13:39:47] production.ERROR: InvalidArgumentException: View [setup] not found. in /app/bootstrap/cache/compiled.php:14326

@jbrooksuk
Copy link
Member

You need to run rm -rf bootstrap/cache/* to fix the view not found issue.

@hadifarnoud
Copy link
Author

I have done that @jbrooksuk with heroku run rm -rf bootstrap/cache/* I checked afterwards and the directory was empty.

@hadifarnoud
Copy link
Author

the real issue is this:
[04-Jun-2016 13:58:08 UTC] [2016-06-04 13:58:08] production.ERROR: Dotenv\Exception\InvalidPathException: Unable to read the environment file at /app/.env. in /app/vendor/vlucas/phpdotenv/src/Loader.php:75

for some reason, it looks for .env in production, which is not how Heroku works. I have to commit an empty .env file to fix this and that led to the issue I mentioned above.

@hadifarnoud
Copy link
Author

it seems like ENV variables are not read from Heroku

@jbrooksuk
Copy link
Member

That's how Laravel works. Laravel reads the .env file.

Unfortunately, we don't support Heroku out of the box :)

@hadifarnoud
Copy link
Author

there seems to be a solution to this. not exactly sure how should this apply it to Cachet

@hadifarnoud
Copy link
Author

this is not how you should use Dotenv. I don't know why you're loading it here for example.

I'm going to fork this and fix it.

@jbrooksuk
Copy link
Member

Like I said, this is how Laravel works.

During the setup we have to write to the file, so we do have to load Dotenv.

If you have a PR that can fix this on Heroku and remain working for everybody else, I'm happy to take a look :)

@GrahamCampbell GrahamCampbell added this to the V2.3.0 milestone Jun 5, 2016
@anonrig
Copy link

anonrig commented Aug 25, 2016

It would be really good if Heroku was supported.

@yoyosan
Copy link
Contributor

yoyosan commented Aug 26, 2016

I can take a swing at this.

@jbrooksuk
Copy link
Member

I can take a swing at this.

Sure, thanks.

@cjthomp
Copy link

cjthomp commented Oct 16, 2016

Sure wish I'd seen this before I wasted two hours setting it up.

@jbrooksuk
Copy link
Member

@cjthomp did you manage to get setup? We dropped Heroku support over a year ago now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants