Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTML 500 error when trying to signup #418

Closed
ProfessorVarox opened this issue Dec 14, 2020 · 8 comments
Closed

HTML 500 error when trying to signup #418

ProfessorVarox opened this issue Dec 14, 2020 · 8 comments

Comments

@ProfessorVarox
Copy link

I recently installed Kutt on my server and everything worked fine but when I tried to signup I get the message An error occurred
Screenshot

Chrome Developer Console output:
Failed to load resource: the server responded with a status of 500 () api/v2/auth/signup:1
Sometimes I also get this error in Chrome Console:
POST https://url.infinity-systems.eu/api/v2/auth/signup 500 _next/static/chunks/2b26bdeb7491974facd25746912241b815a721eb.b9ac63e96ca9aab19faa.js

When I try to reach api/v2/auth/signup I get the following error:
Screenshot

npm run build Output:

root@saas-07.infinity.infrastructure:/var/www/kutt# npm run build

> kutt@2.7.1 build /var/www/kutt
> rimraf production-server && tsc --project tsconfig.json && copyfiles -f "server/mail/*.html" production-server/mail && next build client/ 

Browserslist: caniuse-lite is outdated. Please run:
npx browserslist@latest --update-db
> Using external babel configuration
> Location: "/var/www/kutt/.babelrc"
Creating an optimized production build  

Compiled successfully.

Warning: You have opted-out of Automatic Static Optimization due to `getInitialProps` in `pages/_app`. This does not opt-out pages with `getStaticProps`
Read more: https://err.sh/next.js/opt-out-auto-static-optimization

Automatically optimizing pages  

Page                                                           Size     First Load JS
┌ λ /                                                          24.9 kB         178 kB
├   /_app                                                      31.1 kB         113 kB
├ λ /404                                                       2.56 kB         116 kB
├ λ /banned                                                    1.5 kB          140 kB
├ λ /login                                                     2.3 kB          145 kB
├ λ /logout                                                    320 B           114 kB
├ λ /protected/[id]                                            1.19 kB         144 kB
├ λ /report                                                    1.42 kB         144 kB
├ λ /reset-password                                            1.54 kB         144 kB
├ λ /settings                                                  16.8 kB         160 kB
├ λ /stats                                                     158 kB          307 kB
├ λ /terms                                                     1.17 kB         140 kB
├ λ /url-info                                                  1.37 kB         140 kB
├ λ /verify                                                    985 B           140 kB
└ λ /verify-email                                              1.7 kB          140 kB
+ First Load JS shared by all                                  113 kB
  ├ static/pages/_app.js                                       31.1 kB
  ├ chunks/2b26bdeb7491974facd25746912241b815a721eb.b9ac63.js  23.4 kB
  ├ chunks/commons.cf1be3.js                                   10.7 kB
  ├ chunks/framework.b2ec32.js                                 41.1 kB
  ├ runtime/main.cce77c.js                                     6.25 kB
  └ runtime/webpack.1c5199.js                                  746 B

λ  (Server)  server-side renders at runtime (uses getInitialProps or getServerSideProps)
○  (Static)  automatically rendered as static HTML (uses no initial props)
●  (SSG)     automatically generated as static HTML + JSON (uses getStaticProps)

npm start Output:

root@saas-07.infinity.infrastructure:/var/www/kutt# npm start

> kutt@2.7.1 start /var/www/kutt
> npm run migrate && cross-env NODE_ENV=production node production-server/server.js


> kutt@2.7.1 migrate /var/www/kutt
> knex migrate:latest --env production

Requiring external module @babel/register
Using environment: production
Already up to date
> Ready on http://localhost:3000

.env file

# App port to run on
PORT=3000

# The name of the site where Kutt is hosted
SITE_NAME=url4you

# The domain that this website is on
DEFAULT_DOMAIN=url.infinity-systems.eu

# Generated link length
LINK_LENGTH=6

# Postgres database credential details
DB_HOST=localhost
DB_PORT=5432
DB_NAME=url
DB_USER=kutt
DB_PASSWORD=removed
DB_SSL=false

# ONLY NEEDED FOR MIGRATION !!1!
# Neo4j database credential details
# NEO4J_DB_URI=bolt://localhost
# NEO4J_DB_USERNAME=neo4j
# NEO4J_DB_PASSWORD=BjEphmupAf1D5pDD

# Redis host and port
REDIS_HOST=127.0.0.1
REDIS_PORT=6379
REDIS_PASSWORD=

# Disable registration
DISALLOW_REGISTRATION=false

# Disable anonymous link creation
DISALLOW_ANONYMOUS_LINKS=false

# The daily limit for each user
USER_LIMIT_PER_DAY=50

# Create a cooldown for non-logged in users in minutes
# Would be ignored if DISALLOW_ANONYMOUS_LINKS is set to true
# Set 0 to disable
NON_USER_COOLDOWN=0

# Max number of visits for each link to have detailed stats
DEFAULT_MAX_STATS_PER_LINK=5000

# Use HTTPS for links with custom domain
CUSTOM_DOMAIN_USE_HTTPS=true

# A passphrase to encrypt JWT. Use a long and secure key.
JWT_SECRET=removed

# Admin emails so they can access admin actions on settings page
# Comma seperated
ADMIN_EMAILS=removed@removed.com

RECAPTCHA_SITE_KEY=removed
RECAPTCHA_SECRET_KEY=removed

# Google Cloud API to prevent from users from submitting malware URLs.
# Get it from https://developers.google.com/safe-browsing/v4/get-started
GOOGLE_SAFE_BROWSING_KEY=removed

# Google Analytics tracking ID for universal analytics.
# Example: UA-XXXX-XX
GOOGLE_ANALYTICS=
GOOGLE_ANALYTICS_UNIVERSAL=

# Google Analytics tracking ID for universal analytics
# This one is used for links
# GOOGLE_ANALYTICS_UNIVERSAL=

# Your email host details to use to send verification emails.
# More info on http://nodemailer.com/
# Mail from example "Kutt <support@kutt.it>". Leave empty to use MAIL_USER
MAIL_HOST=removed.com
MAIL_PORT=25
MAIL_SECURE=false
MAIL_USER=no-reply@infinity-systems.eu
MAIL_FROM="Infinity URL <removed@removed.com>"
MAIL_PASSWORD=removed

# The email address that will receive submitted reports.
REPORT_EMAIL=removed@removed.com

# Support email to show on the app
CONTACT_EMAIL=removed@removed.com

Server details
OS: Ubuntu 20.04.1 LTS
Web Server: nginx/1.18.0
node Version: v12.20.0
npm Version: 6.14.8

If you need more information please let me know

I needed to resubmit because @poeti8 closed #415 without waiting for my response if his solution worked. The mail credentials are correct, I verified them three times

@WaterKnight1998
Copy link

@ProfessorVarox did you find any solution? I am getting the same error!

@ProfessorVarox
Copy link
Author

No, I'm sorry. I tried it a fews days ago on another server but the same error

@ProfessorVarox
Copy link
Author

I tried using docker today but the same problem

@SplatDev
Copy link

SplatDev commented Jan 8, 2021

Same issue here. Just set it up via docker compose and everything is correct as far as I see.

@wissamataleh
Copy link

I faced the same issue when trying to deploy it using docker compose. It was related to SMTP settings, apparently I miss configured it. After setting MAIL_PORT=587 and MAIL_SECURE=false in my environment, everyting worked fine with no related issues.

MAIL_HOST=host.example.com
MAIL_PORT=587
MAIL_USER=user@example.com
MAIL_PASSWORD=password
MAIL_SECURE=false

@vec-tor-void
Copy link

Hi @ProfessorVarox , can you also share your nginx config for this? wanted to understand how this is being deployed

@AlexandreBonneau
Copy link

Thank you @wissamataleh ; setting MAIL_SECURE=false instead of the default MAIL_SECURE=true saved the day when using the STARTTLS port 587.

@StarWhiz
Copy link

I faced the same issue when trying to deploy it using docker compose. It was related to SMTP settings, apparently I miss configured it. After setting MAIL_PORT=587 and MAIL_SECURE=false in my environment, everyting worked fine with no related issues.

MAIL_HOST=host.example.com
MAIL_PORT=587
MAIL_USER=user@example.com
MAIL_PASSWORD=password
MAIL_SECURE=false

My savior!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants