🐛I can't create an account
Describe the bug When I come to create an account i had this below problem
Hi @Mujanati13,
Could you please update your description to use the issue template. It will make finding the cause of your problem easier.
Thank you
I met the same problem. To Reproduce Steps to reproduce the behavior:
Go to 'http://localhost:8123/auth/register' fill out the form
Click on 'Register'
See error
in the console of navigator,
POST http://localhost:8123/api/auth/register 500 (Internal Server Error)
Expected behavior: register successfully
OS: WSL2 Browser chrome
@cannot-hero What guide did you follow? Are you using the all-in-one image?
@Mujanati13 @cannot-hero ; Make sure you generate the app secret and jwt secret from the readme. I had the same issue and that fixed it.
@daveearley Yes, i use the all-in-one guide, thanks to @astrolope , i made it.
@astrolope thanks for your help, i regenerate the secret key, and restart the docker container. it works
hi @daveearley , I am facing the same problem when using all-in-one image. Before I run docker-compose up -d I even generate the app secret and JWT following the instructions on README and revise the .env at docker/all-in-one , but still after running the docker compose command above, and go to localhost:8123/auth/register , and create an user, it shows exactly the same screenshot above. Please help or shed the light on this issue. Thanks!
@huibrian What do you see in the network tab in the browsers dev tools? Can you see what URL is failing?
@huibrian
Did you copy the entire thing including base64:. I had the same issue and it was because of thinking I didn't need this bit.
@huibrian What do you see in the network tab in the browsers dev tools? Can you see what URL is failing?
@daveearley First of all, when going to the front page, i.e. http://localhost:8123/, it says GET http://localhost:8123/api/users/me net::ERR_CONNECTION_REFUSED GET "http://localhost:8123/api/users/me". Failed to load resource: net::ERR_CONNECTION_REFUSED
then when I go to "http://localhost:8123/api/auth/register", after filling in the login details to create an account, it says XHR failed loading: POST "http://localhost:8123/api/auth/register". POST http://localhost:8123/api/auth/register net::ERR_CONNECTION_REFUSED
@GBHU753 I copy the entire base64: until the = character. I used Laravel often and so now I couldn't find any error log in Laravel / nodejs. I saw the database and it is set up properly, just that when I do a registration, there is no additional row for users table
@huibrian What OS are you using? Also, can you access http://localhost:8123/api in the browser?
@huibrian What OS are you using? Also, can you access http://localhost:8123/api in the browser?
@daveearley yes, it works, saying, 'Congratulations 🎉
If you're seeing this Hi.events API is running'
I'm using Ubuntu 22.04
@huibrian That's a good sign. Do you see any errors in the browser dev tools console? Anything related to CORS?
@huibrian That's a good sign. Do you see any errors in the browser dev tools console? Anything related to CORS?
@daveearley there is no CORS stuff or others. Here is the screenshot:
Anyway, this website is hosted on a server running Ubuntu and I access this from my laptop. No matter the URL is "http://<IP address>:8123/auth/register" or "https://<hostname with SSL cert>:8123/auth/register" , it shows the same
My .env in the all-in-one folder only has those records APP_KEY and JWT_SECRET without specifying the HOST, do I need to add such record in this .env or other .env file if I use all-in-one docker?
@daveearley Currently we are hosting the all in one server using docker compose in our domain (e.g. https://event.example.com/) So we update VITE_API_URL_SERVER and VITE_FRONTEND_URL in frontend/.env to use our domain, then when we navigate to https://event.example.com/auth/register, it's still calling http://localhost:8123/api/auth/register We found out that in docker/all-in-one/docker-compose.yml, you are hard-coding the environment values like this environment: - VITE_FRONTEND_URL=http://localhost:8123/ - VITE_API_URL_CLIENT=http://localhost:8123/api - VITE_API_URL_SERVER=http://localhost:80/api - VITE_STRIPE_PUBLISHABLE_KEY=pk_test Is it possible to use docker/all-in-one/.env to specify VITE env as well? Otherwise, no matter we modify the .env at frontend folder, it is replaced by VITE_FRONTEND_URL etc when using all-in-one
Thank you!
@huibrian, while the all-in-one image can be used in a production environment, the docker-compose.yml in the all-in-one directory is not intended for production. I suggest creating a new docker-compose.yml with the specific values you need.
You can check out some examples of how to use the all-in-one image in the following repositories:
I will update the compose file, as it doesn't make sense to have some values hardcoded and others not.
Cheers
Hello! I'm experiencing the original error in this Issue as well. A simple 500 when attempting to register.
TL:DR: The underlying error for me is relation "accounts" does not exist
Here are the full details from my encounter with the error:
Payload:
{
"first_name": "Darin",
"last_name": "Webb",
"email": "[email protected]",
"password": "password123!",
"password_confirmation": "password123!",
"timezone": "America/Chicago",
"locale": "en"
}
Response:
{
"message": "Server Error"
}
I'm running the all-in-one container locally. I generated a keys prior to running docker compose up.
The Laravel logs show the actual error I'm getting, which I haven't seen anyone else post (easy way to watch them is to skip the -d in your docker compose up so you can watch the logs live and see your error happen)
postgres | 2024-10-26 12:27:32.077 UTC [79] ERROR: relation "accounts" does not exist at character 13
postgres | 2024-10-26 12:27:32.077 UTC [79] STATEMENT: insert into "accounts" ("timezone", "currency_code", "name", "email", "short_id", "account_verified_at", "updated_at", "created_at") values ($1, $2, $3, $4, $5, $6, $7, $8) returning "id"
all-in-one | [2024-10-26 12:27:32] production.ERROR: SQLSTATE[42P01]: Undefined table: 7 ERROR: relation "accounts" does not exist
all-in-one | LINE 1: insert into "accounts" ("timezone", "currency_code", "name",...
all-in-one | ^ (Connection: pgsql, SQL: insert into "accounts" ("timezone", "currency_code", "name", "email", "short_id", "account_verified_at", "updated_at", "created_at") values (America/Chicago, USD, Darin Webb, [email protected], acc_l14h0jD0YSubl, 2024-10-26 12:27:32, 2024-10-26 12:27:32, 2024-10-26 12:27:32) returning "id") {"exception":"[object] (Illuminate\\Database\\QueryException(code: 42P01): SQLSTATE[42P01]: Undefined table: 7 ERROR: relation \"accounts\" does not exist
all-in-one | LINE 1: insert into \"accounts\" (\"timezone\", \"currency_code\", \"name\",...
all-in-one | ^ (Connection: pgsql, SQL: insert into \"accounts\" (\"timezone\", \"currency_code\", \"name\", \"email\", \"short_id\", \"account_verified_at\", \"updated_at\", \"created_at\") values (America/Chicago, USD, Darin Webb, [email protected], acc_l14h0jD0YSubl, 2024-10-26 12:27:32, 2024-10-26 12:27:32, 2024-10-26 12:27:32) returning \"id\") at /app/backend/vendor/laravel/framework/src/Illuminate/Database/Connection.php:813)
[stack trace follows]
Upon more digging, it seems like my database migrations didn't properly complete the first time. After trashing my postgres database container and volume, then launching only the postgres container, waiting for it to stablize, then running the regular docker compose up, it worked. Unfortunately I don't have a lot of time to debug this further right now, but hopefully it provides a clue for others. the main thing is to check those docker logs if you're running locally!
i have encountered the same issue
production.ERROR: SQLSTATE[42P01]: Undefined table: 7 ERROR: relation "users" does not exist
when i check the container log it says
ERROR: Migrations could not complete. Check the error above. Ensure DATABASE_URL is set.
but the problem is not the database url, its from the database folder
when i try to migrate the database, it shows an error
SQLSTATE[42P07]: Duplicate table: 7 ERROR: relation "question_and_answer_views" already exists
this time the problem is in schema.sql file from line 773, i comment the code from 773 line cause the error says it create something that already exist, so i got this idea
-- create view question_and_answer_views
-- (question_id, event_id, belongs_to, question_type, first_name, last_name, attendee_id, order_id, title,
-- answer)
-- as
-- SELECT q.id AS question_id,
-- q.event_id,
-- q.belongs_to,
-- q.type AS question_type,
-- a.first_name,
-- a.last_name,
-- a.id AS attendee_id,
-- qa.order_id,
-- q.title,
-- qa.answer
-- FROM question_answers qa
-- LEFT JOIN attendees a ON a.id = qa.attendee_id
-- JOIN orders o ON qa.order_id = o.id
-- JOIN questions q ON q.id = qa.question_id;
or you can do this
create or replace view question_and_answer_views
(question_id, event_id, belongs_to, question_type, first_name, last_name, attendee_id, order_id, title,
answer)
as
SELECT q.id AS question_id,
q.event_id,
q.belongs_to,
q.type AS question_type,
a.first_name,
a.last_name,
a.id AS attendee_id,
qa.order_id,
q.title,
qa.answer
FROM question_answers qa
LEFT JOIN attendees a ON a.id = qa.attendee_id
JOIN orders o ON qa.order_id = o.id
JOIN questions q ON q.id = qa.question_id;
when i try to migrate again, it shows another error
SQLSTATE[42701]: Duplicate column: 7 ERROR: column "start_collapsed" of relation "tickets" already exists
the problem is in 2024_10_14_232118_add_start_collapsed_to_tickets.php file, i fixed it temporarily by deleting the file, cause when i look up in schema.sql the relation has already been declared
after that the migration is success and i can create an account, however its a temporary solution and maybe can cause some error later,
*edit
there is an error too in startup.sh script where the script trying to migrate when database is not ready yet, so you can put some sleep until the database is ready
the db seeder error too
Hi there, got the same Issue as stated above and broke my head yesterday trying to set this up and fix it. No success for now, so bumping this Issue.
Thanks for the info @hasyimashari. There was a regression introduced in the last release which has now been fixed.
I'm going to close this report as it appears the issues have been addressed.
Thanks all.