standardnotes / self-hosted

[Legacy] Self-host your own Standard Notes server for end-to-end encrypted notes and files
https://github.com/standardnotes/server
GNU Affero General Public License v3.0
343 stars 39 forks source link

Latest api-gateway error #93

Closed spider-one closed 1 year ago

spider-one commented 1 year ago

Latest version of the standardnotes/api-gateway docker image (tag b283bbaca97a0acb3739a1aaffe5914ca4f343b7) produces the following log error

Error: Environment variable REVISIONS_SERVER_URL not set

Reverting to previous image tag 47119fb34641ff6febb30537ce78f27eaa0d3398 works fine

Perhaps this variable needs to be added to the api-gateway.env.sample but I was not sure of what value to use

macdonaldj commented 1 year ago

Getting the same, did not hit this last week when doing fresh installs

macdonaldj commented 1 year ago

Is there a way to download and host the docker images myself, so that i can always have a stable version?

spider-one commented 1 year ago

Is there a way to download and host the docker images myself, so that i can always have a stable version?

I typically use Watchtower for auto updates of non-critical containers but I exclude Standard Notes due to the nature of it's update script. Unfortunately the Standard Notes team doesn't appear to be using the :stable tag for docker images. To resolve this for the time being I adjusted my docker-compose.yml to specify the previous image version with standardnotes/api-gateway:47119fb34641ff6febb30537ce78f27eaa0d3398

Docker Hub api-gateway tags

Once a new image posts I'll likely try again. I don't want to go too far back because just two days ago there were still standing issues with Markdown in the Android app. Those were resolved for me with updates yesterday.

macdonaldj commented 1 year ago

thanks! i feel the pain on no common tags across all the containers used.

jackyzy823 commented 1 year ago

They introduced a new microservice: revsions, however compose file for self hosting has not been updated yet.

You need to add a revisions service and revisions-worker service and edit api-gateway's env add REVISIONS_SERVER_URL if you updated latest tag to latest.

Caution: Revisions use a same table name revisions with the origin database but have some slight different columns (user_uuid column removed) and index. So Currently you may 1) let revisions use another database name, and manually transfer columns (without user_uuid) from origin databases' revisions table to new database 2) backup old table like (create table backup_revision as select * from revisions ) and drop this tableand let revisions services create the table in the origin database , and then manualy import columns(without user_uuid) from backup_revision to new table.

So i recommend to use a previous working git-commit-hash based tag.

My grumble about THE LATEST tag : https://github.com/standardnotes/self-hosted/issues/84#issuecomment-1233643968

robertrud commented 1 year ago

@Spider-One Thank you! I was frustrated for the last few hours untill I read this thread. It seems to be working now.

eric-pierce commented 1 year ago

Revisions doesn't appear to be a required microservice (at least yet). If you include the environment variable in your env, it should work:

REVISIONS_SERVER_URL=http://revisions:3000

See https://github.com/standardnotes/e2e/blob/main/docker/api-gateway.env.sample for example.

I'm not using the update/maintenance script but implementing directly in docker-compose, and adding this environment variable resolved this for me. Of course who knows if this will be a required microservice in the future.

robertrud commented 1 year ago

@eric-pierce Yep. It works now. Thank you :)

michelangelo136 commented 1 year ago

THANK YOU! for the past 2 days I'm stuck on this. why would someone release something that doesn't work? they need to implement a tag feature to have at least a known working config.

eric-pierce commented 1 year ago

@michelangelo136 I believe the intent is for the "latest" to include compatible tags, and this just seems to be a bug. I opened an issue about adding a docker hub tag, but closed it when they moved to support the "latest" tag - before that I was manually maintaining the versions based on what they had in their docker-compose file on this repo

karolsojko commented 1 year ago

Issue with revisions server url should be resolved now. It is an optional value now