enso-org / enso

Hybrid visual and textual functional programming.
https://enso.org
Apache License 2.0
7.36k stars 324 forks source link

IPC error: "panicked at 'Failed to read configuration: Error(Parser(InvalidLength #7679

Closed xvcgreg closed 7 months ago

xvcgreg commented 1 year ago

Discord username

No response

What type of issue is this?

Transient – Occurring only once

Is this issue blocking you from using Enso?

Is this a regression?

What issue are you facing?

I have created new project, and renamed it while opening. Worked a bit on it - then I have stopped the project by returning to the dashboard and stopping it via stop button. When I launched it again (w/o exiting Enso) I got panic in the log and project didn't load (even the BG wasn't loaded): image

[31884:0828/201346.430:ERROR:logger.cc(46)] Too many GL errors, not reporting any more for this context. use --disable-gl-error-limit to see all errors.
[info] [2023-08-28T18:13:47.905Z] [org.enso.runtimeversionmanager.components.RuntimeVersionManager] The engine [2023.2.1-nightly.2023.8.28] found.
[info] [2023-08-28T18:13:48.184Z] [org.enso.runtimeversionmanager.components.RuntimeVersionManager] Found GraalVM runtime [GraalVM 23.0.0-java17.0.7].
IPC error: "panicked at 'Failed to read configuration: Error(Parser(InvalidLength { expected: Any([36, 32]), found: 16 }))\n\nFailed to parse project ID from string: '101 - Navigation'.', app/gui/src/lib.rs:181:56\n\nStack:\n\nError\n    at imports.wbg.__wbg_new_abda76e883ba8a5f (eval at <anonymous> (http://localhost:8080/index.js:67:4238), <anonymous>:17728:17)\n    at http://localhost:8080/pkg-opt.wasm:wasm-function[32858]:0x17d98d4\n    at http://localhost:8080/pkg-opt.wasm:wasm-function[15628]:0x14e8780\n    at http://localhost:8080/pkg-opt.wasm:wasm-function[28326]:0x17140bb\n    at http://localhost:8080/pkg-opt.wasm:wasm-function[18162]:0x15f5821\n    at http://localhost:8080/pkg-opt.wasm:wasm-function[32910]:0x17dd0ba\n    at WN.runEntryPoints (http://localhost:8080/index.js:70:2819)\n    at async WN.run (http://localhost:8080/index.js:67:3997)\n\n"
[info] [2023-08-28T18:13:53.313Z] [org.enso.languageserver.runtime.RuntimeKiller] Shutting down the runtime server [Actor[akka://language-server/user/runtime-connector#1888662156]].
[info] [2023-08-28T18:13:53.321Z] [org.enso.languageserver.runtime.RuntimeKiller] Shutting down the Truffle context [org.graalvm.polyglot.Context@26e2ad56]. Attempt #1.
[info] [2023-08-28T18:13:53.437Z] [org.enso.languageserver.boot.LanguageServerComponent] Terminated truffle context.
[info] [2023-08-28T18:13:53.441Z] [org.enso.languageserver.boot.LanguageServerComponent] Terminated json connections.
[info] [2023-08-28T18:13:53.443Z] [org.enso.languageserver.boot.LanguageServerComponent] Terminated binary connections.
[info] [2023-08-28T18:13:53.463Z] [akka.actor.CoordinatedShutdown] Running CoordinatedShutdown with reason [ActorSystemTerminateReason]
[info] [2023-08-28T18:13:53.549Z] [org.enso.languageserver.boot.LanguageServerComponent] Terminated actor system.
[info] [2023-08-28T18:13:53.552Z] [org.enso.languageserver.boot.MainModule] Closed Language Server main module.
[info] [2023-08-28T18:13:53.553Z] [org.enso.languageserver.boot.LanguageServerComponent] Terminated main module.
[info] [2023-08-28T18:13:53.74Z] [org.enso.projectmanager.infrastructure.languageserver.LanguageServerController] Language server shut down successfully [Project(e77a950a-7487-43fb-a008-7ee44ecd2714,New_Project_16,New_Project_16,local,UserProject,2023-08-28T17:56:22.837230200Z,Some(Edition(Some(2023.2.1-nightly.2023.8.28),None,Map(),Map())),C:\Users\xvc\enso\projects\New_Project_16_1,Some(2023-08-28T17:56:23.982105800Z),Some(2023-08-28T17:56:23.7533474Z))].
[warn] [2023-08-28T18:13:53.74Z] [org.enso.projectmanager.infrastructure.languageserver.ShutdownHookActivator] Shutdown hook activator has no recollection of project e77a950a-7487-43fb-a008-7ee44ecd2714. Either it was closed already or it never existed. Ignoring.
[error] [2023-08-28T18:14:06.379Z] [org.enso.projectmanager.requesthandler.ProjectCloseHandler] Request ProjectClose with Number(8) timed out.

Expected behaviour

project opening w/o panic

How we can reproduce it?

No response

Screenshots or screencasts

No response

Logs

No response

Enso Version

2023.8.28 nightly

Browser or standalone distribution

Standalone distribution (local project)

Browser Version or standalone distribution

standalone

Operating System

Windows

Operating System Version

Win11pro 22H2 22621.2134

Hardware you are using

12th Gen Intel(R) Core(TM) i9-12900HK / RTX3060 Laptop / Nvidia Drivers 537.13

xvcgreg commented 1 year ago

From what I have investigated somehow during rename of project Enso created second one. Firstly I have created New Project 16 and then renamed it to "101 - Navigation" - somehow I have now 2 folders inside projects folder:

image

both created the same time but one (the renamed to 101 - Navigation - with folder name "New_Project_16") is a fresh project (with just the starting node) and one not renamed with all the nodes I have created (folder name: "New_Project_16_1").

Renamed project throws the above-mentioned panic, the not renamed opens w/o a problem.

https://github.com/enso-org/enso/assets/108271897/b567ab4f-bbb2-4d2d-9638-df22b41cb431

xvcgreg commented 1 year ago

Just zipped project: New_Project_16.zip

vitvakatu commented 1 year ago

We have the following lines in our code:

    fn from_str(s: &str) -> Result<Self, Self::Err> {
        // While in theory it is possible that Uuid string representation is a valid project name,
        // in practice it is very unlikely. Additionally, Uuid representation used by us is
        // hyphenated, which will never be the case for project name. This, we can use this as a
        // heuristic to determine whether the provided string is a project name or a project ID.
        if s.contains('-') {
            let id = Uuid::from_str(s)
                .context(format!("Failed to parse project ID from string: '{s}'."))?;
            Ok(ProjectToOpen::Id(id))
        } else {
            Ok(ProjectToOpen::Name(ProjectName::new_unchecked(s)))
        }
    }

And the comment is no longer valid – ProjectName can contain hyphens now. We need to review our logic of parsing web arguments in GUI.

Issues with renaming and duplicated project seem to be not connected with that, though.

farmaazon commented 1 year ago

Created a separate task for duplicated project problem: https://github.com/enso-org/enso/issues/7705

farmaazon commented 7 months ago

No longer reproducible in GUI2