Annoying error: Server error: could not upload file. Please try again later!

They are 2 possible options. In my opinion if the app is not too big the balance between advantages/disadvantages is on the side of mutiple VerticalArrangements. The app where I have the problem discussed in this post was originally thougth to be done with multiple screens and then was developed with multiple VerticalArrangements.... yes there are some things to analyze better as duplications, how to pass data between screens, using databases (expecially TinyDB), action bar(s) and so on. The main limit I see to use screens is that there is no way to share data (it is possible using DB and pass the data from the caller and the called screen) and code (I do not know and I do not find a way to do, the docs seems to say that the code inside a screen is private to that screen) among them.
So, actually my approach is opened to use both. I think that a screen may have multiple "pages" inside and the pages may be realized using VerticalArrangements or any type of "container" that may be enabled/disabled so that it is not possible to have more than one container active and visible. This approach permits to use multiple screens also, the only rule is that only one screen and only one page of that screen may be active at the same time.

Unfortunately in this case copy and paste the screen (I have only Screen1) does not work. Simply it does not paste anything, after the copy and paste the Screen1 on the destination project is empty. To be sure that is the real result I tryed to repeat the operation with less files uploaded and I found that the highest number of files that works is the same as if I add them in having the complete project. So, generally speaking, copy and paste works until I do not exceed the limit related in some unknown way to the uploaded files.

I agree with you: AI2 SHOULD be able to handle dozen or more small files in the media folder but seems it does not. Also your idea was very good and simple to do but unfortunately does not work. Surely it is a quicker way to update the project than upload many files one by one but returns this error: Server error: could not upload project. Please try again later! As always I tried many times and also using AI2Offline but with the same results. If the problem is related to the app size or to the size reserved to the assets I think there is no much more to do at the moment apart contacting someone at MIT development team to understand better the situation. Instead, if it is related to the number of files, the last thing coming in my mind is to use a DB as SQLite for instance and upload just the DB. The aia file is only 354KB in size so I am quite surprised to have this annoying problem.

I ran a test, adding 40 images of less than 100kb each to an aia project. The project was 1.1mb in size.
This was imported successfully on the production server and opened up OK in AI2, and successfully compiled as well.

Shows it can work. Are you certain your project is not corrupted in some way ?

You could share it, by Private Message if you wish, for testing.

1 Like

This is a good news, it means there is a solution. Yes, the project is not corrupted with 0 warnings and 0 errors. It is a little project, I had only little problems related to how realize some features but it took really few hours to see it working without setting the "look and feel" part. After I see it working well I start to implement how it looks so no change in the code apart uploading images for the buttons and associating them to the buttons... nothing more...

too many assets is a known issue, see also

as workaround you can try the code server http://code.appinventor.mit.edu/ which does not have these Google limitations

another workaround is to put your assets into a zip file, add only the zip file into the assets and unzip the file in the ASD on first run of the app... this extension can help: App Inventor Extensions: Zip/Unzip | Pura Vida Apps

Taifun


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by icon24 Taifun.

How do you know this ?

How many asset files in your project ?

But that link only shows that the user had a project that was too large (44mb) in size for the server (max 30mb). I do not disagree that there have been instances where having a large number of assets has caused problems. The OP only has an aia project size of 1.9mb.

:sweat_smile:
see this for example old Google Groups thread https://groups.google.com/g/mitappinventortest/c/vHM1hWp5AT8/m/XgOvcvp4BQAJ

EDIT: see also this statement by @ewpatton https://groups.google.com/g/mitappinventortest/c/FUqaR2roqlk/m/LjZPEjW0AAAJ

There's a hard limit at 10 MB per project to send it to the build server. This is enforced by the Google App Engine runtime--if we go over, it will kill the transfer. Another challenge is that a project with many files (screens + assets + extensions) will take a long time to load out of Google Cloud Storage. There is a hard limit of 1 minute runtime so if there are too many files then that can end up killing the transfer to the build server as well. If you are running into problems at ai2.appinventor.mit.edu you can try loading your projects into code.appinventor.mit.edu and try there. The latter server runs at Amazon rather than Google and so doesn't have the same restrictions.

Taifun

1 Like

This is why I have asked the OP for the number of asset files, we then get a feel for the problem. :slight_smile:

1 Like

I know this is a debated point but the problem arises also with AI2Offline that is nb187b so a little bit outdated (end of August) and AI2 the beginning of September.

The problem arises with th 24th file I tried to add, I mean 23 files were already uploaded and I added the 24th.

From what you say, your average file size is @ 65kb, unless you have one or more really big files, and lots of small ones? If you have a really big image file in there, try removing it...

There were 23 files already uploaded. I was not able to upload the 24th but this happened some days later.

No, my 23 files were between 3KB and 8KB with a couple of them of 11KB. The aia file is between 350 and 387KB.

Because with 23 files the project works perfectly without any error.

Oh, in your OP you said 1.9mb :wink:

And just to confirm, AI2 will happily load your project, in full, just not allow the addition of another file in the Media folder?

Not sure there is much more I can do without getting hands on with your aia project.

At the moment i don't have time to read the whole thread, but have you tried loading the project into code.appinventor.mit.edu? The server hosted at ai2.appinventor.mit.edu runs in Google's App Engine and it puts a number of constraints on the running processes. In particular, there is a hard 1 minute runtime to receiving the project, unpacking it, and storing its files into the datastore. The latter operation is linear in the number of files in the project (each Screen is 2 files), plus a metadata object, plus an object for each of the assets. If you get the error after about 1 minute it's likely that you're hitting that hard limit.

The code.appinventor.mit.edu server runs on our own custom server code running out of AWS. Since we control the runtime there isn't an upper bound the running time, so even if you have a slow connection it should be able to receive your project successfully.

Taifun is there a known limit on the number or on the size of asset files? I will try to upload on the other server, what should be interesting also if a little bit off topic is to know if they differs in source code and what of the 2 is the origin for AI2Offline.

No, I will try, I did not know there were different limitations between the 2. Also if a little bit off topic, as I wrote in the thread, I tested my app also with AI2Offline and it has the same problem.