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

Laravel 11 | Warning 1265 Data truncated for 'user_id' #1431

Open
1 task done
alex32 opened this issue Jun 11, 2024 · 6 comments
Open
1 task done

Laravel 11 | Warning 1265 Data truncated for 'user_id' #1431

alex32 opened this issue Jun 11, 2024 · 6 comments
Labels
bug Something isn't working

Comments

@alex32
Copy link

alex32 commented Jun 11, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

When I access the login page I get error 500 below.
https://www.example.com/canvas/login

Note: 'sessions.user_id' is a bigint (20)

SQLSTATE[01000]: Warning: 1265 Data truncated for column 'user_id' at row 1 (Connection: mysql, SQL: update sessionssetpayload= YTo0OntzOjY6Il90b2tlbiI7czo0MDoiZmtGMWs3RUdsVEJVY3VESmRXTzRLUDVYMlliM3dIeGJ1Q0Z5NGxNeiI7czo5OiJfcHJldmlvdXMiO2E6MTp7czozOiJ1cmwiO3M6MzI6Imh0dHBzOi8vd3d3LmtsYXlyaXZlci5jb20vY2FudmFzIjt9czo2OiJfZmxhc2giO2E6Mjp7czozOiJvbGQiO2E6MDp7fXM6MzoibmV3IjthOjA6e319czo1MzoibG9naW5fY2FudmFzXzU5YmEzNmFkZGMyYjJmOTQwMTU4MGYwMTRjN2Y1OGVhNGUzMDk4OWQiO3M6MzY6IjkwOGIzNGIxLTZkYWEtNGYxMC1iYWI5LWE1NWI4NjM0NTNlYyI7fQ==,last_activity= 1718115707,user_id= 908b34b1-6daa-4f10-bab9-a55b863453ec,ip_address= 84.71.26.63,user_agent= Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36 OPR/110.0.0.0 whereid = b46ZFoRfsccM5IIvvGJhHBQOK3DYpHWDIhTxAyqm)

Expected Behavior

I expected the home page to load.

Steps To Reproduce

I've installed laravel 11 on my live server (no jetstream), then:

cd /laravel
composer require austintoddj/canvas
php artisan canvas:install   
 // got login credentials
 email: email@example.com  psw: password
php artisan storage:link

Environment

php 8.2
laravel 11
Ubuntu 22.04
Canvas: latest (6.0.54)

Anything else?

Please help, thanks.

#1094
#851

@alex32 alex32 added the bug Something isn't working label Jun 11, 2024
@kusman28
Copy link

Just create a new migration

public function up(): void
{
Schema::table('sessions', function (Blueprint $table) {
$table->string('user_id', length: 255)->change()->nullable();
});
}

@phil-hudson
Copy link

+1 this breaks on new installs

@kusman28
Copy link

kusman28 commented Aug 1, 2024

+1 this breaks on new installs

Have u tried my solution? #1431 (comment)

@phil-hudson
Copy link

yep but it likely needs to be addressed in the package itself

@naxis
Copy link

naxis commented Aug 19, 2024

The solution:
changing the users table
$table->foreignID('user_id')->nullable()->index();
to
$table->uuid('user_id')->nullable()->index();

Worked for me

@austintoddj
Copy link
Owner

This looks like a similar issue to #851 and #1022. @alex32 are you using a file session driver or DB?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants