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

Unable to compile S3 projects #74

Closed
zfi opened this issue Aug 27, 2019 · 22 comments
Closed

Unable to compile S3 projects #74

zfi opened this issue Aug 27, 2019 · 22 comments
Assignees
Labels
bug Something isn't working task/verify Bug or feature is ready to be tested and verified

Comments

@zfi
Copy link
Contributor

zfi commented Aug 27, 2019

Compiling any S3 program fails with a generic server 500 error message. Project for all other board type appear to compile without incident.

@zfi zfi self-assigned this Aug 27, 2019
@zfi
Copy link
Contributor Author

zfi commented Aug 27, 2019

Unable to reproduce the error. The compiler logs are inconclusive.

@ataylor-parallax
Copy link

I just tested this in v1.3.477 and I was able to reproduce it

@zfi
Copy link
Contributor Author

zfi commented Aug 29, 2019

Can you attach the project svg file so we can test it on a dev box? We need to find the root cause for the intermittent performance on S3 projects.

@MatzElectronics
Copy link
Collaborator

MatzElectronics commented Aug 29, 2019 via email

@zfi
Copy link
Contributor Author

zfi commented Aug 29, 2019

I'm sorry but I am not connecting the dots here. This issue only occurs with S3 board type. All other board types, including the Activity Board, do not exhibit this error. What exactly is it that we are looking for in the C libraries?

@MatzElectronics
Copy link
Collaborator

MatzElectronics commented Aug 29, 2019 via email

@zfi
Copy link
Contributor Author

zfi commented Aug 29, 2019

The issue as reported is discussing S3 board type projects, not Activity Board projects.

Still, I followed the steps you outlined and this project compiles without error.
2019-08-29_09-26-00

// ------ Libraries and Definitions ------
#include "simpletools.h"
#include "s3.h"



// ------ Main Program ------
int main() {


  // Comment

}


[Activity-S3.svg.zip](https://github.com/parallaxinc/solo/files/3556537/Activity-S3.svg.zip)

@MatzElectronics
Copy link
Collaborator

image

Huh. I tried this because I was trying to isolate the problem by adding only one piece to the code at a time. The s3 type adds a few different things automatically, so by choosing the ActivityBoard type, it allows you to test smaller pieces.

@zfi
Copy link
Contributor Author

zfi commented Aug 29, 2019

Which system are you using when you see this error? For example, the svg file runs without error on my dev system but not on production Solo. To be transparent, I have been working to clean up the code on the compiler system and may have inadvertently corrected whatever is triggering the 500 error.

It would also be helpful to know exactly what is being sent to the compiler server. The URL including any query strings, and the request body.

@MatzElectronics
Copy link
Collaborator

MatzElectronics commented Aug 29, 2019 via email

@zfi
Copy link
Contributor Author

zfi commented Aug 30, 2019

The problem appears to the in the S3 header file.

UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 1018: ordinal not in range(128)

@zfi
Copy link
Contributor Author

zfi commented Aug 30, 2019

I don't see anything in the s3.h file that might trigger the decode. I am deploying an update to the cloud compiler that will provide more details in this area of the code.

@zfi
Copy link
Contributor Author

zfi commented Aug 30, 2019

I can confirm that the issue is in Simple Libraries. Version 1.4.122 does not exhibit the issue. Version 1.4.131 does exhibit the issue. I have an older version of the library on my dev system, which is why it was working there and not in the production system.

I am going to open an issue over in the Simple Libraries repo and leave this issue open until it is resolved.

@MatzElectronics
Copy link
Collaborator

MatzElectronics commented Aug 30, 2019 via email

@zfi
Copy link
Contributor Author

zfi commented Aug 30, 2019

The file open function in Python 3 is, as a default, quite strict about the characters it will accept when the file is open in it's default text mode. This same code worked successfully in Python 2.7. A more complete explanation is available in the parallaxinc/Simple-Libraries#200 issue.

I updated the code in the cloud compiler to accept the full Latin-1 character set and it now is able to parse the s3.h file successfully.

@zfi zfi added the task/verify Bug or feature is ready to be tested and verified label Aug 30, 2019
@Steph-Parallax
Copy link
Collaborator

In 1.3.477, I can verify that S3 programs compile with one exception: the factory reset/restore S3 demo block returns this error:

Compile... Aw snap. A server error 500 has been detected.

This may in fact be a separate issue, if the error is actually a missing binary called in the generated C code:

// ------ Libraries and Definitions ------
#include "simpletools.h"
#include "s3.h"
#pragma load_default_scribbler_binary

// ------ Main Program ------
int main() {
s3_setup();
pause(100);

}

@Steph-Parallax Steph-Parallax added bug Something isn't working and removed task/verify Bug or feature is ready to be tested and verified labels Sep 3, 2019
@zfi
Copy link
Contributor Author

zfi commented Sep 4, 2019

I am not able to reproduce this error on Solo or in my dev environment. The compiler reports that the binary was successfully delivered to the client browser. Perhaps I need to actually have an S3 plugged in first?

@zfi
Copy link
Contributor Author

zfi commented Sep 4, 2019

I found an event in the compiler logs that indicates that the demo init binary is not getting bundled into the Docker container. I'm investigating that now.

@zfi
Copy link
Contributor Author

zfi commented Sep 4, 2019

I updated the Cloud Compiler to include the missing S3 demo initialization binary. I'm not sure how that was omitted initially.

Can someone in possession of an S3 retry the demo init routine to verify that this works as expected now?

@zfi zfi added the task/verify Bug or feature is ready to be tested and verified label Sep 4, 2019
@Steph-Parallax
Copy link
Collaborator

Hard-cleared my Chrome cache, restarted my computer, and re-tested with actual S3 connected to my reawakened computer:

  • I can compile and load regular projects.
  • I can Verify Code (checkmark button) a project with just the Restore block in it.
  • I cannot Load and Run (downward arrow button) with just the Restore block in it. I get this result:

image

So while the presence of that binary is necessary of course, there is still something else afoot.

@zfi
Copy link
Contributor Author

zfi commented Sep 4, 2019

Thanks for that feedback. Once the binary was made available, the compiler had an issue in converting the binary file to a json object. This is another artifact of migrating from Python2 to 3. The latest version of the compiler (v1.3.7) addresses this error.

Let's test this again and verify that I have it right this time.

@Steph-Parallax
Copy link
Collaborator

That did the trick! Restore block is working now also.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working task/verify Bug or feature is ready to be tested and verified
Projects
None yet
Development

No branches or pull requests

4 participants