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

Cannot create new subscription on fresh install #98

Closed dm5n closed 1 year ago

dm5n commented 1 year ago

Service Versions (please complete the following information): Paste the output of ./server.sh version. For example:

Container                             Repository                        Tag                 Image Id            Size
api-gateway-standalone                standardnotes/api-gateway         latest              149a12253f4b        202MB
auth-standalone                       standardnotes/auth                latest              610aa58dd945        216MB
auth-worker-standalone                standardnotes/auth                latest              610aa58dd945        216MB
cache-standalone                      redis                             6.0-alpine          ddf87e4ac647        24.4MB
db-standalone                         mysql                             8                   4b61a400e877        550MB
files-standalone                      standardnotes/files               latest              07af9015366f        203MB
syncing-server-js-standalone          standardnotes/syncing-server-js   latest              5e394e15d18c        214MB
syncing-server-js-worker-standalone   standardnotes/syncing-server-js   latest              5e394e15d18c        214MB
workspace-standalone                  standardnotes/workspace           latest              5d32f0691615        213MB
workspace-worker-standalone           standardnotes/workspace           latest              5d32f0691615        213MB

Describe the issue

Attempting to create a new subscription using command:

sudo ./server.sh create-subscription user@example.com
./server.sh: 85: [[: not found
ERROR 1048 (23000) at line 1: Column 'user_uuid' cannot be null

I have run

sudo ./server.sh cleanup
sudo ./server.sh update

Please note that I changed mysql version to 8 in docker-compose.yml to enable install on ARM64 architecture.

Additionally – Have not been able to setup new account on SN webapp with the same email.

Logs logs.pdf

jackyzy823 commented 1 year ago

Ref: https://github.com/standardnotes/self-hosted/issues/78

Just curiously, did you register/create a user before create a subscription for it??

dm5n commented 1 year ago

I followed the docs and first tried to create an account on the SN web app then create a subscription with that email on my selfhosted instance.

jackyzy823 commented 1 year ago

Have you changed the "custom sync server" url in SN web app to you selfhosted one when registering account?

dm5n commented 1 year ago

That's the problem – it wouldn't accept the registration. Throwing up errors – including 'Unknown error' and then asking for 2FA when that wasn't setup. As well as 'Error: A server error occurred while trying to register. Please try again.'

I've reached out to SN team to check it out – perhaps I should delete that account and start over. But also tried with another email and same problems.

jackyzy823 commented 1 year ago

Could you provide your browser's log (like web request and repsonse which status is 4xx/5xx console error output) via Developer Tools and server log when registering.

dm5n commented 1 year ago

I tried to relogin on the web app but got error msg that 'Error: An existing request is already in progress.'

Browser log from previous attempt:

chrome-extension://invalid/:1          Failed to load resource: net::ERR_FAILED
chrome-extension://invalid/:1          Failed to load resource: net::ERR_FAILED
companion-bubble.js:1465 Uncaught (in promise) TypeError: Cannot convert undefined or null to object
    at Function.keys (<anonymous>)
    at companion-bubble.js:1465:19726
    at Generator.next (<anonymous>)
    at Ln (companion-bubble.js:1465:19144)
chrome-extension://invalid/:1          Failed to load resource: net::ERR_FAILED
chrome-extension://invalid/:1          Failed to load resource: net::ERR_FAILED
chrome-extension://invalid/:1          Failed to load resource: net::ERR_FAILED
chrome-extension://invalid/:1          Failed to load resource: net::ERR_FAILED
chrome-extension://invalid/:1          Failed to load resource: net::ERR_FAILED
​ Running Ginger Widget v2.0.189
chrome-extension://invalid/:1          Failed to load resource: net::ERR_FAILED
chrome-extension://invalid/:1          Failed to load resource: net::ERR_FAILED
chrome-extension://invalid/:1          Failed to load resource: net::ERR_FAILED
chrome-extension://invalid/:1          Failed to load resource: net::ERR_FAILED
chrome-extension://invalid/:1          Failed to load resource: net::ERR_FAILED
chrome-extension://invalid/:1          Failed to load resource: net::ERR_FAILED
content.vendor.js:2 Running Ginger Widget v2.0.189
KeyboardService.ts:89 Uncaught TypeError: e.getModifierState is not a function
    at t.KeyboardService.updateAllModifiersFromEvent (KeyboardService.ts:89:23)
    at handleKeyDown (KeyboardService.ts:55:18)
KeyboardService.ts:89 Uncaught TypeError: e.getModifierState is not a function
    at t.KeyboardService.updateAllModifiersFromEvent (KeyboardService.ts:89:23)
    at handleKeyUp (KeyboardService.ts:59:18)
KeyboardService.ts:89 Uncaught TypeError: e.getModifierState is not a function
    at t.KeyboardService.updateAllModifiersFromEvent (KeyboardService.ts:89:23)
    at handleKeyDown (KeyboardService.ts:55:18)
KeyboardService.ts:89 Uncaught TypeError: e.getModifierState is not a function
    at t.KeyboardService.updateAllModifiersFromEvent (KeyboardService.ts:89:23)
    at handleKeyUp (KeyboardService.ts:59:18)
app.standardnotes.com/:1 Access to XMLHttpRequest at 'https://notes.example.com/v2/login-params' from origin 'https://app.standardnotes.com' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
SignIn.tsx:102 Error: Unknown error.
    at SignIn.tsx:96:23
(anonymous) @ SignIn.tsx:102
notes.example.com/v2/login-params:1          Failed to load resource: net::ERR_FAILED
KeyboardService.ts:89 Uncaught TypeError: e.getModifierState is not a function
    at t.KeyboardService.updateAllModifiersFromEvent (KeyboardService.ts:89:23)
    at handleKeyDown (KeyboardService.ts:55:18)
KeyboardService.ts:89 Uncaught TypeError: e.getModifierState is not a function
    at t.KeyboardService.updateAllModifiersFromEvent (KeyboardService.ts:89:23)
    at handleKeyUp (KeyboardService.ts:59:18)
KeyboardService.ts:89 Uncaught TypeError: e.getModifierState is not a function
    at t.KeyboardService.updateAllModifiersFromEvent (KeyboardService.ts:89:23)
    at handleKeyDown (KeyboardService.ts:55:18)
KeyboardService.ts:89 Uncaught TypeError: e.getModifierState is not a function
    at t.KeyboardService.updateAllModifiersFromEvent (KeyboardService.ts:89:23)
    at handleKeyUp (KeyboardService.ts:59:18)
app.standardnotes.com/:1 Access to XMLHttpRequest at 'https://notes.example.com/v2/login-params' from origin 'https://app.standardnotes.com' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
SignIn.tsx:102 Error: Unknown error.
    at SignIn.tsx:96:23
(anonymous) @ SignIn.tsx:102
notes.example.com/v2/login-params:1          Failed to load resource: net::ERR_FAILED
KeyboardService.ts:89 Uncaught TypeError: e.getModifierState is not a function
    at t.KeyboardService.updateAllModifiersFromEvent (KeyboardService.ts:89:23)
    at handleKeyDown (KeyboardService.ts:55:18)
KeyboardService.ts:89 Uncaught TypeError: e.getModifierState is not a function
    at t.KeyboardService.updateAllModifiersFromEvent (KeyboardService.ts:89:23)
    at handleKeyUp (KeyboardService.ts:59:18)
KeyboardService.ts:89 Uncaught TypeError: e.getModifierState is not a function
    at t.KeyboardService.updateAllModifiersFromEvent (KeyboardService.ts:89:23)
    at handleKeyDown (KeyboardService.ts:55:18)
KeyboardService.ts:89 Uncaught TypeError: e.getModifierState is not a function
    at t.KeyboardService.updateAllModifiersFromEvent (KeyboardService.ts:89:23)
    at handleKeyUp (KeyboardService.ts:59:18)
app.standardnotes.com/:1 Unchecked runtime.lastError: This request exceeds the MAX_WRITE_OPERATIONS_PER_MINUTE quota.
app.standardnotes.com/:1 Access to XMLHttpRequest at 'https://notes.example.com/v1/users' from origin 'https://app.standardnotes.com' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
CreateAccount.tsx:80 Error: A server error occurred while trying to register. Please try again.
    at t.UserApiService.<anonymous> (snjs.js:21919:39)
    at Generator.throw (<anonymous>)
    at s (snjs.js:21847:55)
S @ CreateAccount.tsx:80
notes.example.com/v1/users:1          Failed to load resource: net::ERR_FAILED
DevTools failed to load source map: Could not load content for chrome-extension://kdfieneakcjfaiglcfcgkidlkmlijjnh/content/js/bundle.tracing.min.js.map: System error: net::ERR_FILE_NOT_FOUND
2CreateAccount.tsx:80 Error: An existing request is already in progress.
    at t.UserApiService.lockOperation (snjs.js:21925:35)
    at t.UserApiService.<anonymous> (snjs.js:21907:34)
    at Generator.next (<anonymous>)
    at snjs.js:21856:87
    at new Promise (<anonymous>)
    at r (snjs.js:21836:28)
    at t.UserApiService.register (snjs.js:21906:32)
    at z.register (snjs.js:42577:76)
    at async Tt.register (snjs.js:36946:35)
    at async S (CreateAccount.tsx:74:9)

Not sure what server log is appropriate – this is console log from the VPS instance:

console.pdf

jackyzy823 commented 1 year ago

The reason is already there : Access to XMLHttpRequest at 'https://notes.example.com/v2/login-params' from origin 'https://app.standardnotes.com' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.

so check you instance if return with header like "access-control-allow-origin: *" via curl -I https://notes.example.com/v2/login-params

If Your instance's response lack of header "access-control-allow-origin: ", please check you revese proxy configuration to see if it drops/filters it (by default api-gateway returns with "access-control-allow-origin: ")

dm5n commented 1 year ago

Thankyou. Solved by terminating the cloud server and starting from scratch – this time paying attention to the Virtual Public and Private Network configuration.

Have not been able to register new account on the SN webapp and add subscriber on my server.