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

Error creating new scripts on W #196

Open
XtramCZ opened this issue Jul 2, 2023 · 5 comments
Open

Error creating new scripts on W #196

XtramCZ opened this issue Jul 2, 2023 · 5 comments

Comments

@XtramCZ
Copy link

XtramCZ commented Jul 2, 2023

Describe the bug
When i want to save a script on the Web UI, I get a crash

To Reproduce
Steps to reproduce the behavior:

  1. Go to Web UI
  2. Click on New Script
  3. Name the script and put some code in there
  4. See error

Expected behavior
I expected it to save my script

Screenshots
-//-

Debug info
Traceback (most recent call last):
File "asyncio/core.py", line 246, in run_until_complete
File "webapp.py", line 265, in startWebService
File "wsgiserver.py", line 165, in update_poll
File "adafruit_wsgi/wsgi_app.py", line 70, in call
File "webapp.py", line 211, in write_new_script
File "webapp.py", line 138, in cleanup_text
File "webapp.py", line 138, in
MemoryError: memory allocation failed, allocating 4168 bytes

Additional context
It may be because I am currently messing with the css a lot and stuff

@Computeroid
Copy link

I am currently working on debugging this with the Thonny IDE and the current issue is that it cannot edit the drive.

Debug Info
{'scriptData': 'SCRIPT+HELLO+THERE', 'scriptName': 'Test.dd'}

Traceback (most recent call last):
  File "asyncio/core.py", line 246, in run_until_complete
  File "webapp.py", line 242, in startWebService
  File "wsgiserver.py", line 165, in update_poll
  File "adafruit_wsgi/wsgi_app.py", line 70, in __call__
  File "webapp.py", line 198, in write_new_script
RuntimeError: Cannot remount '/' when visible via USB.

@XtramCZ
Copy link
Author

XtramCZ commented Aug 1, 2023

From my experience, your error only happens if you have USB mode enabled and try to modify a file

@Computeroid
Copy link

You're right. For my purposes I need USB mode enabled so I just deleted the drive mount lines in create_new_script() and added a try-catch. It's not 100% safe but it works for me as I have backups.

@dbisu
Copy link
Owner

dbisu commented Aug 9, 2023

If USB Mass Storage mode is enabled, then the webapp cannot write to the internal flash. this is a limitation of circuitpython.

As for the original issue, do you have an example script that causes the problem? I'll try to take a look at this issue in the next couple of weeks.

@XtramCZ
Copy link
Author

XtramCZ commented Aug 9, 2023

Nah, I haven't noticed this happening with a particular script, but it happens more with longer ones

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants