Error: Unprocessable Entity

Hello. I’m trying to deploy lumber-admin via Docker with remote database. And I getting an error:

Error: Unprocessable Entity

I’m using next command:

sudo docker run \
  -v `pwd`:/usr/src/app --init \
  -e DATABASE_SCHEMA="public" \
  -e DATABASE_SSL="false" \
  -e DATABASE_URL="postgres://postgres:123456@[ip]:5432/cleanandgreen" \
  -e APP_NAME="jopas_remote" \
  -e FOREST_EMAIL="[email]" \
  -e FOREST_TOKEN="[token]" \
  -e APPLICATION_HOST="[ip]" \
  -e APPLICATION_PORT="3310" \
  -ti forestadmin/lumber

I suspect problem on DB, but I cannot find any details or logs about this event. So, my main question is: where I can find any logs? Thx

Hi @John ! Welcome to the community :slight_smile:

Which version of lumber are you using ?
Can you connect to your database using this link (with postgres cli) ?

  1. Latest
  2. Yes, DB is available for connections:
  3. This is full command with our DB. Feel free to do what do you need with DB as it dev-DB:
sudo docker run \
  -v `pwd`:/usr/src/app --init \
  -e DATABASE_SCHEMA="public" \
  -e DATABASE_SSL="false" \
  -e DATABASE_URL="postgres://postgres:123456@" \
  -e APP_NAME="jopas_remote" \
  -e FOREST_EMAIL="" \
  -e APPLICATION_PORT="3310" \
  -ti forestadmin/lumber

I took the liberty to anonymise your post, be careful not to share sensitive information on public forums :wink:
Give me some time to look at your problem and get back to you !

Ok it seems to be because your endpoint (APPLICATION_HOST) is not set as https, see this part of the documentation to read about setting up forest on a remote environment with docker @John :slight_smile:

Do I need to enable ssl on DB?

You need to enable SSL on your remote server so that the requests to the app can be done through https

Thx. Now I’m using next command for deploying Forest Admin. How I can install my ssl cert?

    lumber generate "${APPLICATION_NAME:-$APP_NAME}" \
        -c "${DATABASE_URL}" \
        -S "${DATABASE_SSL:-false}" \
        -s "${DATABASE_SCHEMA}" \
        -H "${APPLICATION_HOST}" \
        -p "${APPLICATION_PORT}" \
    cd "${APPLICATION_NAME:-$APP_NAME}" && \
    npm install lumber-forestadmin -s --save && \
    lumber install lumber-forestadmin \
        --email "${FOREST_EMAIL}" \
        --password "${FOREST_PASSWORD}" \
        --projectName "${APPLICATION_NAME:-$APP_NAME}" && \
    npm install -s && \
    npm start

Unfortunately I can’t find any info about SSL-cert installation regarding vanila examples.

The ssl needs to be enabled on your server, redirect the traffic through the port 443 with ssl enabled.
Do you still have the same error after enabling ssl on your server ?

Are you talking about Forest Admin Backend Server? lumber-forestadmin relies on Node Server. I haven’t another servers. I’m looking for opportunity to set ssl certificates via lumber-cli.

No, I am talking about the server on which you are trying to run your lumber project, at the operating system level.

And how this help Forest to communicate with my-hosted backend via https? And how I can install some certs at the operating system level?

Forest’s frontend require your lumber project to be accessible via https, the lumber project is connected to your database (which is on the same server from what I see, so no need for ssl here) and it is not connected to your own backend.
What FA does is generate a backend to connect with FA’s frontend which give you an admin panel that you can customize following your needs. :slight_smile:

Right, lumber-cli does generate backend, which based on Node’s web-server on 80 port, and Forest cannot establish connection with https protocol of this web-server because your Node’s app.js haven’t configured any SSL to fit this requirement.

And now I see I need to deploy my own server to install SSL-certs for Forest Backend, or I need to make modifications in app.js. But I don’t see how I can just install certs without this dances to Node’s web-server.

Node.js doesn’t necessary need an https configuration, you can use a reverse proxy to route the request through https.
For exemple you can look at this thread.

So, finally I need my own web-server deployed?

Well if you are trying to deploy it on a remote server (where you database is) you already have it, you just need to configure it to have ssl :slight_smile:

I am ready to deploy it locally, but I do not understand how to use Forest Frontend in this case. Frontend need public-hosted backend to access. All of my services deployed locally and all the troubles because Forest Frontend cannot work without cloud

I’ll try to be more clear :slight_smile:
FA’s goal is to allow you to quickly setup an admin panel, to this end we scan your db and we generate a lumber project for you.
The error you are getting appears when you try to generate your lumber project.
We advise to first generate a development environment locally and then deploy it to a remote server for your production environment.
Remote environments needs to work through https to enforce security.
Local environment doesn’t need to since they run on your machine and you are accessing our frontend directly on this machine (the request are done on localhost).

Forest frontend is just the interface with whom your generated project communicates.
The lumber project is the “bridge” between forest and your database, where you put your logic.
Your own app (back and front) are not connected to FA, only your database.

Don’t hesitate if I explained badly :sweat_smile: I advise you to read the doc, it’s explained more clearly than what I can do here.

How I can directly access Forest Frontend - locally, without remotes? I could not find any way but Frontend on Forest servers. I don’t know how to use Forest without your servers.