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
341 stars 38 forks source link

"Unknown error" when attempting to register on fresh server #50

Open Leaguesman opened 3 years ago

Leaguesman commented 3 years ago

Service Versions (please complete the following information):

             Container                          Repository                 Tag         Image Id      Size  
-----------------------------------------------------------------------------------------------------------
api-gateway-standalone                standardnotes/api-gateway         1.25.1       b29b29a5a88c   602 MB 
auth-standalone                       standardnotes/auth                1.22.1       3ae071814b36   811 MB 
auth-worker-standalone                standardnotes/auth                1.22.1       3ae071814b36   811 MB 
cache-standalone                      redis                             6.0-alpine   6960a2858b36   29.9 MB
db-standalone                         mysql                             5.6          8d06d2d16232   289 MB 
syncing-server-js-standalone          standardnotes/syncing-server-js   1.42.1       7543b99652cd   920 MB 
syncing-server-js-worker-standalone   standardnotes/syncing-server-js   1.42.1       7543b99652cd   920 MB 

Describe the issue There are a number of other issues on this topic, but unfortunately none of them have any information that has helped me resolve this. I've attempted to deploy a fresh server via the script as per the instructions. The status shows as up for all containers, the healthcheck works, the logs don't show any errors, the database migrations all appear to have worked. However, from both the Android mobile app and the Linux desktop app, I just get the dreaded "Unknown error" when trying to register an account.

The only thing I've changed is the MySQL port to a different one, as I have an existing MySQL installation on this machine using the default port. As such, I've changed the DB_PORT env var in the .env file, and in the compose file I changed the various entrypoint references to my new port. Is there some other hardcoded references to port 3306 somewhere that would make this solution untenable?

My other suspicion is that I'm trying to just use an internal IP reference over http for connecting (e.g. http://10.0.0.6:3000). I don't plan on using this service outside my LAN, so I won't have a domain name or certificate. Does Standard Notes support such a configuration?

moughxyz commented 3 years ago

Hmm internal IP should work from the desktop app (but probably not Android or web). What do you see in the logs when trying to register from the desktop app?

Leaguesman commented 3 years ago

On the server logs I get nothing actually. I don't know that the request is even reaching the server. On the client app, opening the inspector I see errors in the console:

app.js:2 POST http://10.0.0.6:3000/v1/users 500 (Internal Server Error)
(anonymous) @ app.js:2
runRequest @ app.js:2
runHttp @ app.js:2
request @ app.js:2
register @ app.js:2
register @ app.js:2
async function (async)
register @ app.js:2
register @ app.js:2
register @ app.js:2
(anonymous) @ app.js:2
j @ app.js:2
k @ app.js:2
app.js:2 SyntaxError: Unexpected token c in JSON at position 0
    at JSON.parse (<anonymous>)
    at Lt.stateChangeHandlerForRequest (app.js:2)
    at XMLHttpRequest.e.onreadystatechange (app.js:2)
stateChangeHandlerForRequest @ app.js:2
e.onreadystatechange @ app.js:2
XMLHttpRequest.send (async)
(anonymous) @ app.js:2
runRequest @ app.js:2
runHttp @ app.js:2
request @ app.js:2
register @ app.js:2
register @ app.js:2
async function (async)
register @ app.js:2
register @ app.js:2
register @ app.js:2
(anonymous) @ app.js:2
j @ app.js:2
k @ app.js:2
karolsojko commented 3 years ago

Hi @Leaguesman

if you're getting POST http://10.0.0.6:3000/v1/users 500 (Internal Server Error) then the request is definitely making the server. Can you try ./server.sh logs and paste the output?