#[SOLVED] appwrite self host ubuntu server, Flutter

46 messages · Page 1 of 1 (latest)

ocean current
#

i use ubuntu server and install appwrite (docker)
when i login in flutter: account.createEmailPasswordSession(email: email, password: password)
Error: Unhandled Exception: type 'Null' is not a subtype of type 'bool'
the error in appwrite 14.0.0 package target.dart file (targets: List<Target>.from(map['targets'].map((p) => Target.fromMap(p))),)

factory Target.fromMap(Map<String, dynamic> map) {
return Target(
$id: map['$id'].toString(),
$createdAt: map['$createdAt'].toString(),
$updatedAt: map['$updatedAt'].toString(),
name: map['name'].toString(),
userId: map['userId'].toString(),
providerId: map['providerId']?.toString(),
providerType: map['providerType'].toString(),
identifier: map['identifier'].toString(),
expired: map['expired'], // this is null
);
}

clever nexus
#

And the SDK version?

ocean current
#

all Last version

#

when i send request to /account/sessions/email
the response dosn't have target expired

clever nexus
#

This appwrite instance had any other version installed previously?
Like 1.6.0 or 1.5.11?

ocean current
#

how i can know ?

#

i installed it using docker

#

in ubuntu server

clever nexus
ocean current
#

it is a recent clean

#

i buy server, domain then insatll appwrite using docker

ocean current
clever nexus
#

I think not

clever nexus
#

Could you check in the console if that user has a target?

ocean current
#

no i just use
Future<void> login(String email, String password) async {
await widget.account.createEmailPasswordSession(email: email, password: password);
final user = await widget.account.get();
setState(() {
loggedInUser = user;
});
}

clever nexus
#

It should have at least one target that is the email

ocean current
#

yes it's have

clever nexus
#

Okay, just to confirm, try creating another user (can be a fake user with a fake email) and then try to login with those credentials.

Confirm if the problem persist with that new user

ocean current
#

same ))

ocean current
# ocean current

the response map not have expired. throw error (Unhandled Exception: type 'Null' is not a subtype of type 'bool')
i think this is because of server

clever nexus
#

@ocean current You're using appwrite 1.6.0?

ocean current
#

how i can know ?

clever nexus
ocean current
#

yes it's 1.6.0

ocean current
#

and you ?

clever nexus
#

Okay, looks like appwrite 1.6.0 is not adding the expired param.
Consequently, you need to use the previous SDK version or upgrade your appwrite instance

clever nexus
ocean current
#

how i can update ?

clever nexus
#

Make sure to have working backups before proceeding

#

Also, note that self-hosting requires mainteneance (apart from backup and upgrading appwrite) like upgrading docker, ubuntu, etc. 😅

#

In case you're new to server administration/management 🙂

ocean current
#

Fortunately, I don't have any data now. 😂

clever nexus
#

Tell me if upgrading the appwrite version solves the issue

clever nexus
ocean current
ocean current
#

And when update. I did not lose data

clever nexus