# Can't finish deployment on Heroku

**URL:** https://community.forestadmin.com/t/cant-finish-deployment-on-heroku/3104
**Category:** Help me!
**Tags:** setup
**Created:** [August 13, 2021, 10:28pm UTC](https://community.forestadmin.com/t/cant-finish-deployment-on-heroku/3104 "2021-08-13T22:28:32Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![Zigfrid](https://avatars.discourse-cdn.com/v4/letter/z/838e76/32.png) [@Zigfrid](https://community.forestadmin.com/u/Zigfrid)
#### Post date: [August 13, 2021, 10:28pm UTC](https://community.forestadmin.com/t/cant-finish-deployment-on-heroku/3104/1 "2021-08-13T22:28:32Z")

</div>

This is a template you can use to report issues. You can also drag images, videos and include `Preformatted text`

## Expected behavior

Get a “Finish” when deploying to production.

## Actual behavior

“Waiting for your environment variables to be correctly set. If this error persists, please check your server logs.” stays there forever

## Failure Logs

Here the logs from Heroku:

```javascript
2021-08-13T22:11:58.660075+00:00 app[api]: Set FOREST_AUTH_SECRET config vars by user admin@getsmarto.com
2021-08-13T22:11:58.660075+00:00 app[api]: Release v19 created by user admin@getsmarto.com
2021-08-13T22:11:59.899244+00:00 heroku[web.1]: Restarting
2021-08-13T22:11:59.964303+00:00 heroku[web.1]: State changed from up to starting
2021-08-13T22:12:01.012307+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2021-08-13T22:12:01.523868+00:00 heroku[web.1]: Process exited with status 143
2021-08-13T22:12:03.494937+00:00 heroku[web.1]: Starting process with command `npm start`
2021-08-13T22:12:06.536155+00:00 app[web.1]:
2021-08-13T22:12:06.536186+00:00 app[web.1]: > smarto-forestadmin@0.0.1 start /app
2021-08-13T22:12:06.536188+00:00 app[web.1]: > node ./server.js
2021-08-13T22:12:06.536188+00:00 app[web.1]:
2021-08-13T22:12:07.836256+00:00 heroku[web.1]: State changed from starting to up
2021-08-13T22:12:07.757738+00:00 app[web.1]: Your application is listening on port xxxxx.
2021-08-13T22:12:07.788862+00:00 app[web.1]: [forest] 🌳🌳🌳 The .forestadmin-schema.json file does not exist.
2021-08-13T22:12:07.788865+00:00 app[web.1]: {}
2021-08-13T22:12:07.789560+00:00 app[web.1]: [forest] 🌳🌳🌳 The schema cannot be synchronized with Forest Admin servers.
2021-08-13T22:12:07.789560+00:00 app[web.1]: {}
2021-08-13T22:12:07.879011+00:00 app[web.1]: Your admin panel is available here: https://app.forestadmin.com/projects
2021-08-13T22:12:08.410496+00:00 heroku[router]: at=info method=OPTIONS path="/forest" host=smarto-forestadmin.herokuapp.com request_id=xxxx fwd="xxxxxx" dyno=web.1 connect=0ms service=7ms status=204 bytes=406 protocol=https
2021-08-13T22:12:08.448234+00:00 heroku[router]: at=info method=GET path="/forest" host=smarto-forestadmin.herokuapp.com request_id=xxxx fwd="xx.xxx.xxx.xx" dyno=web.1 connect=0ms service=12ms status=204 bytes=218 protocol=https
2021-08-13T22:12:08.417104+00:00 app[web.1]: OPTIONS /forest 204 0 - 2.167 ms
2021-08-13T22:12:08.453636+00:00 app[web.1]: GET /forest 204 - - 11.096 ms
2021-08-13T22:12:09.665408+00:00 heroku[router]: at=info method=GET path="/forest" host=smarto-forestadmin.herokuapp.com request_id=xxxx fwd="xxx" dyno=web.1 connect=0ms service=9ms status=204 bytes=218 protocol=https
2021-08-13T22:12:09.667294+00:00 app[web.1]: GET /forest 204 - - 7.179 ms

```

## Context

I use Docker and Heroku.

I set up all required env vars in Heroku. Doesn’t help. I restart the Heroku app manually. Doesn’t help. I tried deleting and recreating Forestadmin projects. Doesn’t help. I tried using another browser for finishing the deployment. Doesn’t help.

Also, [https://smarto-forestadmin.herokuapp.com/](https://smarto-forestadmin.herokuapp.com/) shows a blank page.

- Database Dialect: Postgres
- Project Name: smarto-forestadmin

---

<div class="post-metadata">

### Author: ![anon39848301](https://avatars.discourse-cdn.com/v4/letter/a/b9e5f3/32.png) [@anon39848301](https://community.forestadmin.com/u/anon39848301)
#### Post date: [August 16, 2021, 7:56am UTC](https://community.forestadmin.com/t/cant-finish-deployment-on-heroku/3104/2 "2021-08-16T07:56:28Z")

</div>

Hi @Zigfrid, and welcome to our community 👋

The fact that you are getting a blank page is a bug on our end. I’ve just open a PR to fix it, but on your end, the file `views/index.html` is missing a closing `</title>`. That should fix your second issue.

In your logs, I can see you are missing the `.forestadmin-schema.json` - is this file commited/available in the code you are deploying on Heroku? (This file is mandatory for the deploy to production flow to work as expected).

Let me know 🙏

---

<div class="post-metadata">

### Author: ![Zigfrid](https://avatars.discourse-cdn.com/v4/letter/z/838e76/32.png) [@Zigfrid](https://community.forestadmin.com/u/Zigfrid)
#### Post date: [August 16, 2021, 8:27am UTC](https://community.forestadmin.com/t/cant-finish-deployment-on-heroku/3104/3 "2021-08-16T08:27:54Z")

</div>

> [@Zigfrid](#):
>
> `The .forestadmin-schema.json file does not exist.`

Hi @anon39848301, thank you for your answer!  
I fixed the frontend issue but how am I supposed to generate `.forestadmin-schema.json`? It doesn’t exists in my local repo.

---

<div class="post-metadata">

### Author: ![anon39848301](https://avatars.discourse-cdn.com/v4/letter/a/b9e5f3/32.png) [@anon39848301](https://community.forestadmin.com/u/anon39848301)
#### Post date: [August 16, 2021, 8:34am UTC](https://community.forestadmin.com/t/cant-finish-deployment-on-heroku/3104/4 "2021-08-16T08:34:49Z")

</div>

Good to know for the first point 👍

Following a “classic” way of on-boarding, you should have your generated backend running on your local machine. Could you confirm if it’s working?

If that’s the case, you should have a generated `.forestadmin-schema.json` at the root of your project folder, containing infos about your models, actions, …  
This file needs to be versionned in your VSS, and deployed in Heroku with your code.

To be more explicit on how it works:

- On development, we generate and update this file on each server start-up.
- On production, the generation step is skipped, and your server will use the one already generated in development.

Hope this helps.

---

<div class="post-metadata">

### Author: ![Zigfrid](https://avatars.discourse-cdn.com/v4/letter/z/838e76/32.png) [@Zigfrid](https://community.forestadmin.com/u/Zigfrid)
#### Post date: [August 16, 2021, 8:39am UTC](https://community.forestadmin.com/t/cant-finish-deployment-on-heroku/3104/5 "2021-08-16T08:39:41Z")

</div>

Using Docker installation, I get this:

```javascript
docker run --rm --init -it -v `pwd`:/usr/src/app -v ~/.forest.d:/usr/src/cli/.forest.d -e TOKEN_PATH="/usr/src/cli" forestadmin/toolbelt projects:create "smarto-forestadmin" --databaseConnectionURL "xxx" --databaseSchema "public" --applicationHost "localhost" --applicationPort "3310"
√ Connecting to your database
√ Analyzing the database
√ Disconnecting from your database
√ Creating your project on Forest Admin
  create config/databases.js
  create forest/table1.js
  create forest/table2.js
  create forest/table3.js
  create forest/table4.js
  create forest/table5.js
  create forest/table6.js
  create forest/table7.js
  create forest/table8.js
  create middlewares/forestadmin.js
  create middlewares/welcome.js
  create models/index.js
  create models/table1.js
  create models/table2.js
  create models/table3.js
  create models/table4.js
  create models/table5.js
  create models/table6.js
  create models/table7.js
  create models/table8.js
  create public/favicon.png
  create routes/table1.js
  create routes/table2.js
  create routes/table3.js
  create routes/table4.js
  create routes/table5.js
  create routes/table6.js
  create routes/table7.js
  create routes/table8.js
  create views/index.html
  create .dockerignore
  create .env
  create .gitignore
  create app.js
  create docker-compose.yml
  create Dockerfile
  create package.json
  create server.js
√ Creating your project files
√ Hooray, installation success!

```

So there’s no `.forestadmin-schema.json` 😟

The generated backend is running correctly locally.

---

<div class="post-metadata">

### Author: ![anon39848301](https://avatars.discourse-cdn.com/v4/letter/a/b9e5f3/32.png) [@anon39848301](https://community.forestadmin.com/u/anon39848301)
#### Post date: [August 16, 2021, 8:44am UTC](https://community.forestadmin.com/t/cant-finish-deployment-on-heroku/3104/6 "2021-08-16T08:44:59Z")

</div>

Theses are the logs for the generation step - Your `.forestadmin-schema.json` is not generated here, but on **server start-up**.

Also, are you generating a new project for your production environment?  
If you have a backend running on your local machine, you shouldn’t have to create a new one for your production.

Could you share with me your project name, so I can check on my end the configuration of your project?

Thanks in advance?

---

<div class="post-metadata">

### Author: ![Zigfrid](https://avatars.discourse-cdn.com/v4/letter/z/838e76/32.png) [@Zigfrid](https://community.forestadmin.com/u/Zigfrid)
#### Post date: [August 16, 2021, 8:53am UTC](https://community.forestadmin.com/t/cant-finish-deployment-on-heroku/3104/7 "2021-08-16T08:53:54Z")

</div>

Sure!

- Project Name: smarto-forestadmin

I followed the usual steps: run a couple of docker commands, then deploy the generated code to Heroku and set all the environment variables. I’m not generating a new project for my production environment.

Thank you!

---

<div class="post-metadata">

### Author: ![anon39848301](https://avatars.discourse-cdn.com/v4/letter/a/b9e5f3/32.png) [@anon39848301](https://community.forestadmin.com/u/anon39848301)
#### Post date: [August 16, 2021, 9:05am UTC](https://community.forestadmin.com/t/cant-finish-deployment-on-heroku/3104/8 "2021-08-16T09:05:26Z")

</div>

👍

Please note that this file is hidden (starting with a `.`), so it can definitely cause issue, especially in a docker setup. If everything is running as expected locally, then you have a `.forestadmin-schema.json` somewhere.

On my end, I can see that your Local environment is configured correctly.  
However, I can’t see your production URL. Could you please double check in your “Project Settings \> Environment” tab that everything is configured correctly?

---

<div class="post-metadata">

### Author: ![Zigfrid](https://avatars.discourse-cdn.com/v4/letter/z/838e76/32.png) [@Zigfrid](https://community.forestadmin.com/u/Zigfrid)
#### Post date: [August 16, 2021, 9:11am UTC](https://community.forestadmin.com/t/cant-finish-deployment-on-heroku/3104/9 "2021-08-16T09:11:10Z")

</div>

Still can’t find it. Checked all `.`-files. After which command it is supposed to be generated?

 ![s](https://europe1.discourse-cdn.com/flex013/uploads/forest/original/2X/a/ad2ebb21658ceae048534eb3e94a0570a641faf5.png)  
I guess you can’t see my production URL because I can’t move forward on this step (probably because `.forestadmin-schema.json` is missing)…

---

<div class="post-metadata">

### Author: ![anon39848301](https://avatars.discourse-cdn.com/v4/letter/a/b9e5f3/32.png) [@anon39848301](https://community.forestadmin.com/u/anon39848301)
#### Post date: [August 16, 2021, 9:16am UTC](https://community.forestadmin.com/t/cant-finish-deployment-on-heroku/3104/10 "2021-08-16T09:16:43Z")

</div>

> Still can’t find it. Checked all `.` -files. After which command it is supposed to be generated?

As stated above, this file is generated & update on each server start-up on a local/development environment.

> I guess you can’t see my production URL because I can’t move forward on this step (probably because `.forestadmin-schema.json` is missing)…

That’s the issue indeed.  
However, I can clearly see that you have a `.forestadmin-schema.json` somewhere on my end. (Since you confirmed that your project is running locally & I can see that the file is synced on our server for your local environment).

Could you check the value of `NODE_ENV` inside your running container? (It must be something like `dev`/`development` locally for this file to be generated)  
Did you check both the shared volume on your host & in your running local container?

---

<div class="post-metadata">

### Author: ![Zigfrid](https://avatars.discourse-cdn.com/v4/letter/z/838e76/32.png) [@Zigfrid](https://community.forestadmin.com/u/Zigfrid)
#### Post date: [August 16, 2021, 9:24am UTC](https://community.forestadmin.com/t/cant-finish-deployment-on-heroku/3104/11 "2021-08-16T09:24:43Z")

</div>

The generated `.env` file didn’t have `NODE_ENV` variable. I manually added `NODE_ENV=development` and finally `.forestadmin-schema.json` appeared.

---

<div class="post-metadata">

### Author: ![anon39848301](https://avatars.discourse-cdn.com/v4/letter/a/b9e5f3/32.png) [@anon39848301](https://community.forestadmin.com/u/anon39848301)
#### Post date: [August 16, 2021, 9:29am UTC](https://community.forestadmin.com/t/cant-finish-deployment-on-heroku/3104/12 "2021-08-16T09:29:22Z")

</div>

Ok, good to know.

Default nodejs installation should not set any value in `NODE_ENV` (That’s also an allowed value for the schema to be generated). Did you setup a default value for `NODE_ENV` on your host or in your docker setup? That would explain why it was not working.

Let me know 🙏

---

<div class="post-metadata">

### Author: ![Zigfrid](https://avatars.discourse-cdn.com/v4/letter/z/838e76/32.png) [@Zigfrid](https://community.forestadmin.com/u/Zigfrid)
#### Post date: [August 16, 2021, 9:33am UTC](https://community.forestadmin.com/t/cant-finish-deployment-on-heroku/3104/13 "2021-08-16T09:33:39Z")

</div>

If I’m not mistaken, I didn’t touch .env on my host and I definitely didn’t change any Docker configs. Strange.

Anyways, I was able to deploy it, thank you for your help!
