Details I missed from this guide while setting up.
Intro (skippable)
I was trying to set up Focalboard Personal Server. Guide overall is straight forward, but I was struggluing BIG TIME. Maybe because I'm frontend rat, maybe because I'm stupid, maybe one is the consequence of another.
I figured it out in the end, but couple parts of in this guide got me good. Don't repeat my mistakes and be careful with these:
Mistake 1. Install the correct version
Those who wrote this guide knew what they were doing, I'm not. Guide says:
The example below uses the link for v0.15.0, but you’re encouraged to use the latest version in the release list
I've missed that initially and just copied command.
wget https://github.com/mattermost/focalboard/releases/download/v0.15.0/focalboard-server-linux-amd64.tar.gz
Don't be like me, install appropriate version from GitHub.
In the time of writing this guide, latest version was v7.10.6.
So, for this case correct command would be:
wget https://github.com/mattermost-community/focalboard/releases/download/v7.10.6/focalboard-server-linux-amd64.tar.gz
BONUS to Mistake 1! Don't mix up releases
As I understood from docs, Focalboard can be:
- plugin for Mattermost
- standalone personal/development server
For example, release 8.0.0 is plugin ONLY. If you are setting personal server, use focalboard-server from the list of release assets.
Mistake 2. Use correct user/password in PostgreSQL
Being unfamiliar with postgres syntax, this command really confused me.
CREATE USER <b>boardsuser</b> WITH PASSWORD '<b>boardsuser-password</b>';
<b> tags are necessary? Are we doing HTML now? Should I be using quotes?
PostgreSQL docs informed me:
Create a user with a password:
CREATE USER davide WITH PASSWORD 'jw8s0F4';
So, if you want to create user "dude" with password "cool" you should:
CREATE USER dude WITH PASSWORD 'cool';
Password should be in quotes.
Mistake 3. Don't miss sneaky config
In the same step, you are setting up Focalboard config by adding next info:
"dbtype": "postgres", "dbconfig": "postgres://boardsuser:boardsuser-password@localhost/boards?sslmode=disable&connect_timeout=10",
If you noticed - congrats. I didn't. You have to write your username and password you set up previously, not this boards-fella.
"dbtype": "postgres",
"dbconfig": "postgres://dude:cool@localhost/boards?sslmode=disable&connect_timeout=10",
Mistake 4. Configure db properly
Do I know how to do it properly? No.
But when I got to point of guide: curl localhost:8000
it returned me this majectic error.
curl: (7) Failed to connect to localhost port 8000 after 0 ms: Couldn't connect to server
I got no idea what was going on. Thanks for this helpful answer I learned command that could help me.
cd /opt/focalboard
./bin/focalboard-server
Output of this command was very informative. From it I learned that I messed the config (Mistake 3), but I also learned that:
error [2024-09-20 17:08:26.194 Z] Table creation / migration failed caller="sqlstore/sqlstore.go:75" error="pq: permission denied for schema public"
fatal [2024-09-20 17:08:26.194 Z] server.NewStore ERROR caller="main/main.go:136" error="pq: permission denied for schema public"
So, something is wrong in db permission department. With a little bit help of fellow developers from SO, I found solution.
!WARNING! I don't know Postgres, so it might be some security issue, but at least it works.
postgres=# \c boards
postgres=# GRANT CREATE ON SCHEMA public TO dude;
How I understand it - I needed to select correct target database (in our case - boards
) and then grant CREATE to our user from previous steps(in our case - dude
).
Conclusion
After all this hustle, I was able to access my Focalboard server.
I hope that helps (if not - good luck in further research).
Thank you for reading.