APP using CloudDB (Cloud Redis DB) works from IA Companion (so far only one issue) but when I use APK, app got Error 908

Hello App Inventor team.
I am just starting to learn about App Inventor, few days ago I started to create an APP, it must save data in Cloud Redis Server.

I got two issues I can't fixed them so far...If you can help me to fixed or understand what is happening I will appreciate it.

First issue (when I am developing the APP):
when I test the APP using AI COMPANION, the APP works fine, it is getting some TAGs (user) and then APP decide to accept or reject de login, for some reason, there is one opcion that is failing, but I can not understand why.
last user erabalf fail always.....according to APP the user is not defined, but it is. all other user work fine.

Second and more important Issue is when the APK is generated and and installed on my mobile (Samsung A31), the APK reports an error 908: the permission WRITE_EXTERNAL_STORAGE has been denied.
image
I was checking the APP installed on my mobile, but is has not any option to enabled permissions.

this is the APP, I am attaching here the CloudDB_REDIS_Error908.aia (1.5 MB) AIA File

Any comment, Advice is welcome.

Thanks in advance
Alfredo

For item number 2, see here

This might solve item number 1?

Hi TIMAI2.
firstable , THANKs your your answer and advice.
Issue N° 2 (ERROR 908) now is fixed (DefaultFileScope from APP to LEGACY).

yesterday i saw the "ewpatton" recommendation but did not work (for sure at this point i was having other issues), now it is working, i power off /on my mobile and it is still working, no more Error 908.

my mobile is using Android 11 too.

so, i will try to think how to see APP is sending to REDIS when TAG is "erabalf"


I removed the TAG erabalf on REDIS server, and create again, but is still falling....it is like query is not leaving the APP (from my mobile)..

once again, thanks alot for your help.

Br
Alfredo (from Argentina)

Please show your relevant blocks. It appears that your error is related to a listview or listpicker, not CloudDB

Hi TIMAI2

Here is the block where query is handle.....in Screen1

Answer from Redis Server...

Thanks for your help!!!!

Br
Alfredo

What happens if you remove this listview block?
image

It is quite likely that a AI2 list is not being returned. If it is a csv row or csv table then use the list blocks to convert to an AI2 list.

Hi TIMAI2
I removed the ListView and NOW IT IS WORKING.

Why this block in GOTVALUE generate and executing in "WHEN bnt_Login CLICK"?

I am not sure if I set this thread as SOLVED you can answered me, I will wait any comments some hours and I will set this to SOLVED.

Thanks a lot for your help

br
Alfredo

bad news TIMAI2.
after some test, the issue comeback....

Same issue, when erabalf is used is not working

when you said: remove listview, I did it, and tested from companion and APk too, a lest 10 times using erabalf tag (user) and works fine....

few minutes later, when i decide to start again working on this app, I run a test and failt, failt in companion and APK too....

app is like this....

one "non_good" solution could be not use erabalf tag, but why this issue happened?

br
Alfredo

Have a look at "value" (from the GotValue event) on its own, what does it look like? You probably need to convert this to a list, if it can be converted to a list?

OK, I will load answered data to a list and then I will show it in a listview...

when gotValue event happen, I check Data Answered from REDIS DB, just getting index N° 3, but I will load all Data into a list.

I will update you as soon as can.

Br
Alfredo

Hi TIMIA2.
I did what do you recommend to do it.

I try two option:

  1. using data RX to Label
  2. Data Rx load into a LIST and show in a LABEL, here first TEST WORKs, but from 2° test is failing again

Information for case 1:

  1. send data RX to a LABEL, we can see the data, please see the pictures below for user aaaaa who is OK and erabalf who is failing without any obvious reason


test result:

user "aaaaa" who is fine allways

user "erabalf" who fail always

here is Redis definition for both users:


Information for case 2: using a LIST, once works, please see the pictures below:

First test with user aaaaa (is is fine alway)

and user erabalf who WORKS!!!!!

after that, i decide to run a test (10 times, but did work after that, I did not change anything between last test where erabalf worked and next test where it failed....

Resume:
after user LIST in GotValue, first test with user erabalf work, but next test no........
when erabalf user failed, user aaaaa works, it means there is not issue between APP and Redis DB Server.

I don´t know why sometime works and sometime not...( at the beginning erabafl was working)

Is there any way to see a trace in order to know what is happening?

I drop here the APP, if you want/can load it, you can run it just using login button.

CloudDB_REDIS_Error908_SCR_Legacy.aia (1.5 MB)
i changed the screen name when the user y psw are ok, in order to don´t change screen and see the info sent and received from Redis DB (as you can see in picture above)

User aaaaa password 12345 it works always
User erabalf password 1234 it does not work (work sometime)

br
Alfredo

Hi TIMIA2.
me again...

As I told you, i have several TAGs defined on RedisLaB DB Server, like:

so, tag erabalf 99,99% times Failed.......and I define eraball ( doble LL) and it works always.

My user used in APP INVENTOR is erabalf@gmail.com, could be the reason of this issue?

I download the AIA file, renamed it to .zip and then I was looking for my user erabalf (Gmail account) and I found it in to places:

  1. in project.properties

#Thu Aug 26 21:18:18 UTC 2021
defaultfilescope=Legacy
showlistsasjson=True
main=appinventor.ai_erabalf.CloudDB_REDIS_Error908_SCR_Legacy.Screen1
color.accent=&HFFFF4081

  1. as name of a directory
    \src\appinventor\ai_erabalf\CloudDB_REDIS_Error908_SCR_Legacy

I changed from erabalf to reabalf it, zipped and rename to .AIA, but MIT APP INVENTOR WEB Site is not recognizing it as AIA file....

as all TAGs are working fine and just my user (my account used when I logged in APP INVENTOR) is falling, it is like there is a conflict there.
what do you think about that?

Br
Alfredo

As you have found, messing with the contents of the aia project file is not a good idea. Leave this alone, this is not where your problem lies, redis/cloudDB doesn't really know anything about your package name.

I do not know why your erabalf data is not working on your cloudDB.

You could export all your redis data and show that here, we might be able to see something ....

Why not set up a separate aia project using the MIT cloudDB, send it the same erabalf data and see if that works? If it fails, there could be an issue with the data.

or

Completely delete the erabalf data from your app and cloudDB and try again, perhaps using different details - erabalf1?

hi TIMAI2.
Yes, it has no sense (what i was seeing into AIA file), but as i am trying to understand the reason of this issue...

I DELETED TAG erabalf in REDIS Server several times and the issue continue....

here is the DB from REDIS, using export tool(export to JSON):
{"User:12345":{"key":"User:12345","ttl":-1,"ttlh":"none","type":"string","size":64,"value":"["aaaaa","aaaaa","12345","12345","08\/24\/2021 11:14:05 p. m."]"},"User:aaaaa":{"key":"User:aaaaa","ttl":-1,"ttlh":"none","type":"string","size":64,"value":"["aaaaa","aaaaa","12345","12345","08\/24\/2021 11:16:57 p. m."]"},"User:aaaaaa":{"key":"User:aaaaaa","ttl":-1,"ttlh":"none","type":"string","size":68,"value":"["aaaaaa","aaaaaa","123456","123456","08\/24\/2021 11:14:38 p. m."]"},"User:aaaaaaa":{"key":"User:aaaaaaa","ttl":-1,"ttlh":"none","type":"string","size":72,"value":"["aaaaaaa","aaaaaaa","1234567","1234567","08\/24\/2021 11:15:18 p. m."]"},"User:aaaaaaaa":{"key":"User:aaaaaaaa","ttl":-1,"ttlh":"none","type":"string","size":76,"value":"["aaaaaaaa","aaaaaaaa","12345678","12345678","08\/24\/2021 11:16:00 p. m."]"},"User:b":{"key":"User:b","ttl":-1,"ttlh":"none","type":"string","size":48,"value":"["b","b","b","b","08\/24\/2021 11:05:32 p. m."]"},"User:d":{"key":"User:d","ttl":-1,"ttlh":"none","type":"string","size":49,"value":"["b","c","1","1@","08\/24\/2021 05:06:09 p. m."]"},"User:erabalf":{"key":"User:erabalf","ttl":-1,"ttlh":"none","type":"string","size":78,"value":"["Alfredo","Rabago","1234","erabalf@gmail.com","08\/27\/2021 11:59:10 a. m."]"},"User:eraball":{"key":"User:eraball","ttl":-1,"ttlh":"none","type":"string","size":78,"value":"["Alfredo","Rabago","1234","erabalf@gmail.com","08\/27\/2021 11:57:29 a. m."]"}}

Is it possible to enable an output from APP showing all protocols/message/data used for it? like an sniffer/tcpdump, could be nice if we can see protocols at least when companion is used...

I will try to use Port mirroring in my house....I am not sure if this feature is available on Switch/router i have....but I will check it.

Br
Alfredo

I tidied up your data output so that you can see any differences, which only seem to be the use of an email address, and that the two users erabalf and eraball were created three days later, and in the morning....none of these should be an issue as they are all just plain text.

{
"User:12345":   {"key":"User:12345",   "ttl":-1,"ttlh":"none","type":"string","size":64,"value":"["aaaaa",   "aaaaa",   "12345",   "12345",            "08\/24\/2021 11:14:05 p. m."]"},
"User:aaaaa":   {"key":"User:aaaaa",   "ttl":-1,"ttlh":"none","type":"string","size":64,"value":"["aaaaa",   "aaaaa",   "12345",   "12345",            "08\/24\/2021 11:16:57 p. m."]"},
"User:aaaaaa":  {"key":"User:aaaaaa",  "ttl":-1,"ttlh":"none","type":"string","size":68,"value":"["aaaaaa",  "aaaaaa",  "123456",  "123456",           "08\/24\/2021 11:14:38 p. m."]"},
"User:aaaaaaa": {"key":"User:aaaaaaa", "ttl":-1,"ttlh":"none","type":"string","size":72,"value":"["aaaaaaa", "aaaaaaa", "1234567", "1234567",          "08\/24\/2021 11:15:18 p. m."]"},
"User:aaaaaaaa":{"key":"User:aaaaaaaa","ttl":-1,"ttlh":"none","type":"string","size":76,"value":"["aaaaaaaa","aaaaaaaa","12345678","12345678",         "08\/24\/2021 11:16:00 p. m."]"},
"User:b":       {"key":"User:b",       "ttl":-1,"ttlh":"none","type":"string","size":48,"value":"["b",       "b",       "b",       "b",                "08\/24\/2021 11:05:32 p. m."]"},
"User:d":       {"key":"User:d",       "ttl":-1,"ttlh":"none","type":"string","size":49,"value":"["b",       "c",       "1",       "1@",               "08\/24\/2021 05:06:09 p. m."]"},
"User:erabalf": {"key":"User:erabalf", "ttl":-1,"ttlh":"none","type":"string","size":78,"value":"["Alfredo", "Rabago",  "1234",    "erabalf@gmail.com","08\/27\/2021 11:59:10 a. m."]"},
"User:eraball": {"key":"User:eraball", "ttl":-1,"ttlh":"none","type":"string","size":78,"value":"["Alfredo", "Rabago",  "1234",    "erabalf@gmail.com","08\/27\/2021 11:57:29 a. m."]"}
}

Perhaps try deleting those two users, and create one without the email address. Does that work ?

Hi TIMAI2.

without any change, now is working tag erabalf, I run 10 test and all were successful...i delete all tags except erabalf and it worked too...I deleted erabalf, so no tag in DB and I had created a TAG from APP, using same info :

"["Alfredo","Rabago","1234","erabalf@gmail.com ","08\/27\/2021 12:54:11 p. m."]"

and it is still working....so, I have not idea what is happening, but is working.......

thanks for your patience and help.

if the issue comeback, I will post a new "request for help" adding protocols capture, I guess, that will help us to know if the issue is in APP or outside of it.

Best Regards, Have a nice weekend!!!!!

Alfredo

thumbsup2

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.