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

Cannot show output after running cell in R notebook with trailing comment #707

Open
williamcplai opened this issue Jul 7, 2024 · 9 comments
Labels
bug Something isn't working

Comments

@williamcplai
Copy link

Type: Bug

cannot show output after running cell in R notebook
how to configure ?

VS Code version: Positron 1.90.0 (d8da3ec9581aa7bcb9726babedacff4e3d528503, 2024-07-05T03:18:37.706Z)
OS version: Windows_NT x64 10.0.22631
Modes:

System Info
Item Value
CPUs 12th Gen Intel(R) Core(TM) i7-12700H (20 x 2688)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
Load (avg) undefined
Memory (System) 15.73GB (1.06GB free)
Process Argv
Screen Reader no
VM 0%
Extensions: none
@petetronic petetronic added the bug Something isn't working label Jul 7, 2024
@petetronic
Copy link
Contributor

petetronic commented Jul 7, 2024

Can you please share a little more information about the file you're running and the version of R you're using? Do you mean an R Markdown file? Or R cells in a Jupyter notebook?

@williamcplai
Copy link
Author

image

After click the cells , it cannot show the outputs

@juliasilge
Copy link
Contributor

Hmmm, we can't reproduce this problem on Windows or other OSes.

  • Can you share what version of R you are running?
  • Can you go to "Output" and choose the output channel for your notebook, then share the log file you find there? It will look something like this:

notebook-output

  • Can you use the command "Toggle Developer Tools" and see if there are any errors or warnings relevant to notebook execution in those logs? It will look something like this:

notebook-devtools

@williamcplai
Copy link
Author

R4.3.2

[R] *** Log started at Sun 14/07/2024 18:07:40.80
[R] *** Command line:
[R] "c:\Program Files\Positron\resources\app\extensions\positron-r\resources\ark\ark.exe" --connection_file C:\Users\William\AppData\Local\Temp\kernel-AX2jap\connection.json --log C:\Users\William\AppData\Local\Temp\kernel-AX2jap\kernel.log --startup-file "c:\Program Files\Positron\resources\app\extensions\positron-r\resources\scripts\startup.R" --session-mode notebook -- --interactive --no-restore-data
[Positron] Sending code to R: # The datasets package needs to be loaded to access our data

For a full list of these datasets, type library(help = "datasets")

library(datasets)
data(iris)
summary(iris)
[Positron] SEND execute_request to Shell: {"buffers":[],"content":{"code":"# The datasets package needs to be loaded to access our data \n# For a full list of these datasets, type library(help = "datasets")\nlibrary(datasets)\ndata(iris)\nsummary(iris)","allow_stdin":true,"silent":false,"store_history":true,"user_expressions":{},"stop_on_error":true},"header":{"msg_id":"positron-notebook-cell-34","msg_type":"execute_request","version":"5.0","date":"2024-07-14T10:07:57.314Z","session":"57cab38faca1b653054ad9edb568b074","username":"William"},"metadata":{},"parent_header":{}}
[Positron] SEND execute_request: OK
[Positron] R kernel status changed: idle => busy
[Positron] RECV status/busy from iopub: {"header":{"msg_id":"467c404b-1030-4714-94ca-30ce60b73f0a","session":"15316e9f-2b4f-4bd9-8c78-35bd410127ce","username":"kernel","date":"2024-07-14T10:07:57.315305600+00:00","msg_type":"status","version":"5.3"},"parent_header":{"msg_id":"positron-notebook-cell-34","session":"57cab38faca1b653054ad9edb568b074","username":"William","date":"2024-07-14T10:07:57.314Z","msg_type":"execute_request","version":"5.0"},"metadata":{},"content":{"execution_state":"busy"},"buffers":[]}
[Positron] RECV execute_input from iopub: {"header":{"msg_id":"ab911983-544f-417e-af18-2516090560ab","session":"15316e9f-2b4f-4bd9-8c78-35bd410127ce","username":"kernel","date":"2024-07-14T10:07:57.315526600+00:00","msg_type":"execute_input","version":"5.3"},"parent_header":{"msg_id":"positron-notebook-cell-34","session":"57cab38faca1b653054ad9edb568b074","username":"William","date":"2024-07-14T10:07:57.314Z","msg_type":"execute_request","version":"5.0"},"metadata":{},"content":{"code":"# The datasets package needs to be loaded to access our data \n# For a full list of these datasets, type library(help = "datasets")\nlibrary(datasets)\ndata(iris)\nsummary(iris)","execution_count":1},"buffers":[]}
[Positron] RECV comm_msg/positron-ui-r-9-c9099c32/undefined from iopub: {"header":{"msg_id":"04dfcfd7-a75d-4d4b-9a93-e031e80927f8","session":"15316e9f-2b4f-4bd9-8c78-35bd410127ce","username":"kernel","date":"2024-07-14T10:07:57.315679100+00:00","msg_type":"comm_msg","version":"5.3"},"parent_header":{},"metadata":{},"content":{"comm_id":"positron-ui-r-9-c9099c32","data":{"method":"busy","params":{"busy":true}}},"buffers":[]}
[Positron] RECV comm_msg/positron-ui-r-9-c9099c32/undefined from iopub: {"header":{"msg_id":"9c2dc0d4-dc0d-4b4d-99f0-7d80c0f0600f","session":"15316e9f-2b4f-4bd9-8c78-35bd410127ce","username":"kernel","date":"2024-07-14T10:07:57.323966+00:00","msg_type":"comm_msg","version":"5.3"},"parent_header":{},"metadata":{},"content":{"comm_id":"positron-ui-r-9-c9099c32","data":{"method":"busy","params":{"busy":false}}},"buffers":[]}
[Positron] RECV comm_msg/positron-ui-r-9-c9099c32/undefined from iopub: {"header":{"msg_id":"b7e3555b-f19f-4cbb-9b17-34f8f195dbb7","session":"15316e9f-2b4f-4bd9-8c78-35bd410127ce","username":"kernel","date":"2024-07-14T10:07:57.324019500+00:00","msg_type":"comm_msg","version":"5.3"},"parent_header":{},"metadata":{},"content":{"comm_id":"positron-ui-r-9-c9099c32","data":{"method":"prompt_state","params":{"input_prompt":"> ","continuation_prompt":"+ "}}},"buffers":[]}
[Positron] RECV execute_result from iopub: {"header":{"msg_id":"2fe5be71-b6ad-43d0-9c27-701f6a08bb47","session":"15316e9f-2b4f-4bd9-8c78-35bd410127ce","username":"kernel","date":"2024-07-14T10:07:57.324031800+00:00","msg_type":"execute_result","version":"5.3"},"parent_header":{"msg_id":"positron-notebook-cell-34","session":"57cab38faca1b653054ad9edb568b074","username":"William","date":"2024-07-14T10:07:57.314Z","msg_type":"execute_request","version":"5.0"},"metadata":{},"content":{"data":{"text/plain":" Sepal.Length Sepal.Width Petal.Length Petal.Width Species \n Min. :4.300 Min. :2.000 Min. :1.000 Min. :0.100 setosa :50 \n 1st Qu.:5.100 1st Qu.:2.800 1st Qu.:1.600 1st Qu.:0.300 versicolor:50 \n Median :5.800 Median :3.000 Median :4.350 Median :1.300 virginica :50 \n Mean :5.843 Mean :3.057 Mean :3.758 Mean :1.199 \n 3rd Qu.:6.400 3rd Qu.:3.300 3rd Qu.:5.100 3rd Qu.:1.800 \n Max. :7.900 Max. :4.400 Max. :6.900 Max. :2.500 "},"execution_count":1,"metadata":{}},"buffers":[]}
[Positron] R kernel status changed: busy => idle
[Positron] RECV status/idle from iopub: {"header":{"msg_id":"efc254c5-372d-4d82-86cd-3638a66a4a90","session":"15316e9f-2b4f-4bd9-8c78-35bd410127ce","username":"kernel","date":"2024-07-14T10:07:57.324092300+00:00","msg_type":"status","version":"5.3"},"parent_header":{"msg_id":"positron-notebook-cell-34","session":"57cab38faca1b653054ad9edb568b074","username":"William","date":"2024-07-14T10:07:57.314Z","msg_type":"execute_request","version":"5.0"},"metadata":{},"content":{"execution_state":"idle"},"buffers":[]}
[Positron] RECV execute_reply from shell: {"header":{"msg_id":"b4e1fc7f-0dcf-4fc1-98a1-1c57db6db8d2","session":"15316e9f-2b4f-4bd9-8c78-35bd410127ce","username":"kernel","date":"2024-07-14T10:07:57.324044700+00:00","msg_type":"execute_reply","version":"5.3"},"parent_header":{"msg_id":"positron-notebook-cell-34","session":"57cab38faca1b653054ad9edb568b074","username":"William","date":"2024-07-14T10:07:57.314Z","msg_type":"execute_request","version":"5.0"},"metadata":{},"content":{"status":"ok","execution_count":1,"user_expressions":{}},"buffers":[]}
[Positron] RECV comm_msg/positron-variables-r-10-ba2b1da1/undefined from iopub: {"header":{"msg_id":"bd56de09-9eb7-4824-8e5d-405f7b35b05f","session":"15316e9f-2b4f-4bd9-8c78-35bd410127ce","username":"kernel","date":"2024-07-14T10:07:57.333867800+00:00","msg_type":"comm_msg","version":"5.3"},"parent_header":{},"metadata":{},"content":{"comm_id":"positron-variables-r-10-ba2b1da1","data":{"method":"update","params":{"assigned":[{"access_key":"iris","display_name":"iris","display_value":"[150 rows x 5 columns] <data.frame>","display_type":"data.frame [150, 5]","type_info":"","size":7256,"kind":"table","length":5,"has_children":true,"has_viewer":true,"is_truncated":false,"updated_time":1720951677333}],"unevaluated":[],"removed":[],"version":2}}},"buffers":[]}
[Positron] SEND heartbeat with timeout of 30 seconds
[Positron] Sending code to R: names(iris) <- tolower(names(iris))
library(dplyr)
[Positron] SEND execute_request to Shell: {"buffers":[],"content":{"code":"names(iris) <- tolower(names(iris))\nlibrary(dplyr)","allow_stdin":true,"silent":false,"store_history":true,"user_expressions":{},"stop_on_error":true},"header":{"msg_id":"positron-notebook-cell-35","msg_type":"execute_request","version":"5.0","date":"2024-07-14T10:08:12.995Z","session":"57cab38faca1b653054ad9edb568b074","username":"William"},"metadata":{},"parent_header":{}}
[Positron] SEND execute_request: OK
[Positron] R kernel status changed: idle => busy
[Positron] RECV status/busy from iopub: {"header":{"msg_id":"bb0e1d66-21d8-4136-a55f-7a5ea3357f94","session":"15316e9f-2b4f-4bd9-8c78-35bd410127ce","username":"kernel","date":"2024-07-14T10:08:12.996067100+00:00","msg_type":"status","version":"5.3"},"parent_header":{"msg_id":"positron-notebook-cell-35","session":"57cab38faca1b653054ad9edb568b074","username":"William","date":"2024-07-14T10:08:12.995Z","msg_type":"execute_request","version":"5.0"},"metadata":{},"content":{"execution_state":"busy"},"buffers":[]}
[Positron] RECV execute_input from iopub: {"header":{"msg_id":"c9d0bead-6cf6-433e-939f-e92757ddce1f","session":"15316e9f-2b4f-4bd9-8c78-35bd410127ce","username":"kernel","date":"2024-07-14T10:08:12.996124700+00:00","msg_type":"execute_input","version":"5.3"},"parent_header":{"msg_id":"positron-notebook-cell-35","session":"57cab38faca1b653054ad9edb568b074","username":"William","date":"2024-07-14T10:08:12.995Z","msg_type":"execute_request","version":"5.0"},"metadata":{},"content":{"code":"names(iris) <- tolower(names(iris))\nlibrary(dplyr)","execution_count":2},"buffers":[]}
[Positron] RECV comm_msg/positron-ui-r-9-c9099c32/undefined from iopub: {"header":{"msg_id":"34bc18dc-ec0e-4155-9718-4fff680dd4c0","session":"15316e9f-2b4f-4bd9-8c78-35bd410127ce","username":"kernel","date":"2024-07-14T10:08:12.996310800+00:00","msg_type":"comm_msg","version":"5.3"},"parent_header":{},"metadata":{},"content":{"comm_id":"positron-ui-r-9-c9099c32","data":{"method":"busy","params":{"busy":true}}},"buffers":[]}
[Positron] RECV comm_msg/positron-ui-r-9-c9099c32/undefined from iopub: {"header":{"msg_id":"4e3a5675-ef2e-494c-b21a-22a1ecd3cb0d","session":"15316e9f-2b4f-4bd9-8c78-35bd410127ce","username":"kernel","date":"2024-07-14T10:08:13.305744100+00:00","msg_type":"comm_msg","version":"5.3"},"parent_header":{},"metadata":{},"content":{"comm_id":"positron-ui-r-9-c9099c32","data":{"method":"busy","params":{"busy":false}}},"buffers":[]}
[Positron] RECV comm_msg/positron-ui-r-9-c9099c32/undefined from iopub: {"header":{"msg_id":"aae60f94-9232-4bd9-9163-62fb3c061ed5","session":"15316e9f-2b4f-4bd9-8c78-35bd410127ce","username":"kernel","date":"2024-07-14T10:08:13.305772800+00:00","msg_type":"comm_msg","version":"5.3"},"parent_header":{},"metadata":{},"content":{"comm_id":"positron-ui-r-9-c9099c32","data":{"method":"prompt_state","params":{"input_prompt":"> ","continuation_prompt":"+ "}}},"buffers":[]}
[Positron] RECV stream from iopub: {"header":{"msg_id":"db7778d3-9d6a-44b4-a938-0cd2a3c122b8","session":"15316e9f-2b4f-4bd9-8c78-35bd410127ce","username":"kernel","date":"2024-07-14T10:08:13.305782100+00:00","msg_type":"stream","version":"5.3"},"parent_header":{"msg_id":"positron-notebook-cell-35","session":"57cab38faca1b653054ad9edb568b074","username":"William","date":"2024-07-14T10:08:12.995Z","msg_type":"execute_request","version":"5.0"},"metadata":{},"content":{"name":"stdout","text":"\nAttaching package: ‘dplyr’\n\nThe following objects are masked from ‘package:stats’:\n\n filter, lag\n\nThe following objects are masked from ‘package:base’:\n\n intersect, setdiff, setequal, union\n\n"},"buffers":[]}
[Positron] R kernel status changed: busy => idle
[Positron] RECV status/idle from iopub: {"header":{"msg_id":"9814e41f-d6a1-4d01-96c7-87dbf6d97e46","session":"15316e9f-2b4f-4bd9-8c78-35bd410127ce","username":"kernel","date":"2024-07-14T10:08:13.305803200+00:00","msg_type":"status","version":"5.3"},"parent_header":{"msg_id":"positron-notebook-cell-35","session":"57cab38faca1b653054ad9edb568b074","username":"William","date":"2024-07-14T10:08:12.995Z","msg_type":"execute_request","version":"5.0"},"metadata":{},"content":{"execution_state":"idle"},"buffers":[]}
[Positron] RECV execute_reply from shell: {"header":{"msg_id":"9b7dcfbc-37e8-42df-8346-85550e9a93b1","session":"15316e9f-2b4f-4bd9-8c78-35bd410127ce","username":"kernel","date":"2024-07-14T10:08:13.305677+00:00","msg_type":"execute_reply","version":"5.3"},"parent_header":{"msg_id":"positron-notebook-cell-35","session":"57cab38faca1b653054ad9edb568b074","username":"William","date":"2024-07-14T10:08:12.995Z","msg_type":"execute_request","version":"5.0"},"metadata":{},"content":{"status":"ok","execution_count":2,"user_expressions":{}},"buffers":[]}
[Positron] RECV comm_msg/positron-variables-r-10-ba2b1da1/undefined from iopub: {"header":{"msg_id":"2fc99dc4-760c-44e2-83b0-1ff0414a1f3c","session":"15316e9f-2b4f-4bd9-8c78-35bd410127ce","username":"kernel","date":"2024-07-14T10:08:13.390118600+00:00","msg_type":"comm_msg","version":"5.3"},"parent_header":{},"metadata":{},"content":{"comm_id":"positron-variables-r-10-ba2b1da1","data":{"method":"update","params":{"assigned":[{"access_key":"iris","display_name":"iris","display_value":"[150 rows x 5 columns] <data.frame>","display_type":"data.frame [150, 5]","type_info":"","size":7256,"kind":"table","length":5,"has_children":true,"has_viewer":true,"is_truncated":false,"updated_time":1720951693389}],"unevaluated":[],"removed":[],"version":3}}},"buffers":[]}
[Positron] Sending code to R: # filter() the data for species virginica
virginica <- filter(iris, species == "virginica")
head(virginica) # This dispalys the first six rows
[Positron] SEND execute_request to Shell: {"buffers":[],"content":{"code":"# filter() the data for species virginica\nvirginica <- filter(iris, species == "virginica")\nhead(virginica) # This dispalys the first six rows","allow_stdin":true,"silent":false,"store_history":true,"user_expressions":{},"stop_on_error":true},"header":{"msg_id":"positron-notebook-cell-36","msg_type":"execute_request","version":"5.0","date":"2024-07-14T10:08:16.939Z","session":"57cab38faca1b653054ad9edb568b074","username":"William"},"metadata":{},"parent_header":{}}
[Positron] SEND execute_request: OK
[Positron] R kernel status changed: idle => busy
[Positron] RECV status/busy from iopub: {"header":{"msg_id":"5c3ff9b5-86dc-4c13-a9ab-7808b1e10748","session":"15316e9f-2b4f-4bd9-8c78-35bd410127ce","username":"kernel","date":"2024-07-14T10:08:16.940888400+00:00","msg_type":"status","version":"5.3"},"parent_header":{"msg_id":"positron-notebook-cell-36","session":"57cab38faca1b653054ad9edb568b074","username":"William","date":"2024-07-14T10:08:16.939Z","msg_type":"execute_request","version":"5.0"},"metadata":{},"content":{"execution_state":"busy"},"buffers":[]}
[Positron] RECV execute_input from iopub: {"header":{"msg_id":"5d9c17b9-a320-4d34-9c15-07faec9276be","session":"15316e9f-2b4f-4bd9-8c78-35bd410127ce","username":"kernel","date":"2024-07-14T10:08:16.940949400+00:00","msg_type":"execute_input","version":"5.3"},"parent_header":{"msg_id":"positron-notebook-cell-36","session":"57cab38faca1b653054ad9edb568b074","username":"William","date":"2024-07-14T10:08:16.939Z","msg_type":"execute_request","version":"5.0"},"metadata":{},"content":{"code":"# filter() the data for species virginica\nvirginica <- filter(iris, species == "virginica")\nhead(virginica) # This dispalys the first six rows","execution_count":3},"buffers":[]}
[Positron] RECV comm_msg/positron-ui-r-9-c9099c32/undefined from iopub: {"header":{"msg_id":"60796f6b-f557-40c8-99b7-b7f07a70f1c7","session":"15316e9f-2b4f-4bd9-8c78-35bd410127ce","username":"kernel","date":"2024-07-14T10:08:16.941151300+00:00","msg_type":"comm_msg","version":"5.3"},"parent_header":{},"metadata":{},"content":{"comm_id":"positron-ui-r-9-c9099c32","data":{"method":"busy","params":{"busy":false}}},"buffers":[]}
[Positron] RECV comm_msg/positron-ui-r-9-c9099c32/undefined from iopub: {"header":{"msg_id":"f21b8175-0a1e-4617-841c-b2f14ae1a1b3","session":"15316e9f-2b4f-4bd9-8c78-35bd410127ce","username":"kernel","date":"2024-07-14T10:08:16.941210200+00:00","msg_type":"comm_msg","version":"5.3"},"parent_header":{},"metadata":{},"content":{"comm_id":"positron-ui-r-9-c9099c32","data":{"method":"prompt_state","params":{"input_prompt":"+ ","continuation_prompt":"+ "}}},"buffers":[]}
[Positron] R kernel status changed: busy => idle
[Positron] RECV status/idle from iopub: {"header":{"msg_id":"bede5ccc-1b70-401b-a451-ff1507d8606f","session":"15316e9f-2b4f-4bd9-8c78-35bd410127ce","username":"kernel","date":"2024-07-14T10:08:16.941234200+00:00","msg_type":"status","version":"5.3"},"parent_header":{"msg_id":"positron-notebook-cell-36","session":"57cab38faca1b653054ad9edb568b074","username":"William","date":"2024-07-14T10:08:16.939Z","msg_type":"execute_request","version":"5.0"},"metadata":{},"content":{"execution_state":"idle"},"buffers":[]}
[Positron] RECV execute_reply from shell: {"header":{"msg_id":"e396b705-3d86-42d0-ad89-5fe49d023118","session":"15316e9f-2b4f-4bd9-8c78-35bd410127ce","username":"kernel","date":"2024-07-14T10:08:16.941140+00:00","msg_type":"execute_reply","version":"5.3"},"parent_header":{"msg_id":"positron-notebook-cell-36","session":"57cab38faca1b653054ad9edb568b074","username":"William","date":"2024-07-14T10:08:16.939Z","msg_type":"execute_request","version":"5.0"},"metadata":{},"content":{"status":"error","execution_count":3,"ename":"IncompleteInput","evalue":"Code fragment is not complete: # filter() the data for species virginica\nvirginica <- filter(iris, species == "virginica")\nhead(virginica) # This dispalys the first six rows","traceback":[]},"buffers":[]}
[Positron] Sending code to R: ginica <- filter(iris, species == "virginica")
head(virginica) # This dispalys the first six rows
[Positron] SEND execute_request to Shell: {"buffers":[],"content":{"code":"ginica <- filter(iris, species == "virginica")\nhead(virginica) # This dispalys the first six rows","allow_stdin":true,"silent":false,"store_history":true,"user_expressions":{},"stop_on_error":true},"header":{"msg_id":"positron-notebook-cell-37","msg_type":"execute_request","version":"5.0","date":"2024-07-14T10:08:19.089Z","session":"57cab38faca1b653054ad9edb568b074","username":"William"},"metadata":{},"parent_header":{}}
[Positron] SEND execute_request: OK
[Positron] R kernel status changed: idle => busy
[Positron] RECV status/busy from iopub: {"header":{"msg_id":"c13d0599-e08e-49a4-9f07-ae3d07ec3818","session":"15316e9f-2b4f-4bd9-8c78-35bd410127ce","username":"kernel","date":"2024-07-14T10:08:19.091191400+00:00","msg_type":"status","version":"5.3"},"parent_header":{"msg_id":"positron-notebook-cell-37","session":"57cab38faca1b653054ad9edb568b074","username":"William","date":"2024-07-14T10:08:19.089Z","msg_type":"execute_request","version":"5.0"},"metadata":{},"content":{"execution_state":"busy"},"buffers":[]}
[Positron] RECV execute_input from iopub: {"header":{"msg_id":"05b01bbe-4283-43c3-b9e0-3349b2e6f14a","session":"15316e9f-2b4f-4bd9-8c78-35bd410127ce","username":"kernel","date":"2024-07-14T10:08:19.091258+00:00","msg_type":"execute_input","version":"5.3"},"parent_header":{"msg_id":"positron-notebook-cell-37","session":"57cab38faca1b653054ad9edb568b074","username":"William","date":"2024-07-14T10:08:19.089Z","msg_type":"execute_request","version":"5.0"},"metadata":{},"content":{"code":"ginica <- filter(iris, species == "virginica")\nhead(virginica) # This dispalys the first six rows","execution_count":4},"buffers":[]}
[Positron] RECV comm_msg/positron-ui-r-9-c9099c32/undefined from iopub: {"header":{"msg_id":"571aee23-4bb6-4a94-bb31-3c40bddc70db","session":"15316e9f-2b4f-4bd9-8c78-35bd410127ce","username":"kernel","date":"2024-07-14T10:08:19.091462600+00:00","msg_type":"comm_msg","version":"5.3"},"parent_header":{},"metadata":{},"content":{"comm_id":"positron-ui-r-9-c9099c32","data":{"method":"busy","params":{"busy":false}}},"buffers":[]}
[Positron] RECV comm_msg/positron-ui-r-9-c9099c32/undefined from iopub: {"header":{"msg_id":"f1b24198-1b7e-454d-a7fd-2c8604785d7f","session":"15316e9f-2b4f-4bd9-8c78-35bd410127ce","username":"kernel","date":"2024-07-14T10:08:19.091507500+00:00","msg_type":"comm_msg","version":"5.3"},"parent_header":{},"metadata":{},"content":{"comm_id":"positron-ui-r-9-c9099c32","data":{"method":"prompt_state","params":{"input_prompt":"+ ","continuation_prompt":"+ "}}},"buffers":[]}
[Positron] R kernel status changed: busy => idle
[Positron] RECV status/idle from iopub: {"header":{"msg_id":"a5d0eb12-09a7-4d7b-b2e5-d9c214336c61","session":"15316e9f-2b4f-4bd9-8c78-35bd410127ce","username":"kernel","date":"2024-07-14T10:08:19.091552200+00:00","msg_type":"status","version":"5.3"},"parent_header":{"msg_id":"positron-notebook-cell-37","session":"57cab38faca1b653054ad9edb568b074","username":"William","date":"2024-07-14T10:08:19.089Z","msg_type":"execute_request","version":"5.0"},"metadata":{},"content":{"execution_state":"idle"},"buffers":[]}
[Positron] RECV execute_reply from shell: {"header":{"msg_id":"56b4f5b1-e4ac-4725-b140-61248033b0b7","session":"15316e9f-2b4f-4bd9-8c78-35bd410127ce","username":"kernel","date":"2024-07-14T10:08:19.091498600+00:00","msg_type":"execute_reply","version":"5.3"},"parent_header":{"msg_id":"positron-notebook-cell-37","session":"57cab38faca1b653054ad9edb568b074","username":"William","date":"2024-07-14T10:08:19.089Z","msg_type":"execute_request","version":"5.0"},"metadata":{},"content":{"status":"error","execution_count":4,"ename":"IncompleteInput","evalue":"Code fragment is not complete: ginica <- filter(iris, species == "virginica")\nhead(virginica) # This dispalys the first six rows","traceback":[]},"buffers":[]}
[Positron] Sending code to R: sepalLength6 <- filter(iris, species == "virginica", sepal.length > 6)
tail(sepalLength6) # compare this to head()
[Positron] SEND execute_request to Shell: {"buffers":[],"content":{"code":"sepalLength6 <- filter(iris, species == "virginica", sepal.length > 6)\ntail(sepalLength6) # compare this to head()","allow_stdin":true,"silent":false,"store_history":true,"user_expressions":{},"stop_on_error":true},"header":{"msg_id":"positron-notebook-cell-38","msg_type":"execute_request","version":"5.0","date":"2024-07-14T10:08:21.082Z","session":"57cab38faca1b653054ad9edb568b074","username":"William"},"metadata":{},"parent_header":{}}
[Positron] SEND execute_request: OK
[Positron] R kernel status changed: idle => busy
[Positron] RECV status/busy from iopub: {"header":{"msg_id":"b0e16d96-3688-4693-8a6a-4307b976437a","session":"15316e9f-2b4f-4bd9-8c78-35bd410127ce","username":"kernel","date":"2024-07-14T10:08:21.083027100+00:00","msg_type":"status","version":"5.3"},"parent_header":{"msg_id":"positron-notebook-cell-38","session":"57cab38faca1b653054ad9edb568b074","username":"William","date":"2024-07-14T10:08:21.082Z","msg_type":"execute_request","version":"5.0"},"metadata":{},"content":{"execution_state":"busy"},"buffers":[]}
[Positron] RECV execute_input from iopub: {"header":{"msg_id":"204635f2-63a3-45f1-b0fe-ca8ca7ec0927","session":"15316e9f-2b4f-4bd9-8c78-35bd410127ce","username":"kernel","date":"2024-07-14T10:08:21.083074500+00:00","msg_type":"execute_input","version":"5.3"},"parent_header":{"msg_id":"positron-notebook-cell-38","session":"57cab38faca1b653054ad9edb568b074","username":"William","date":"2024-07-14T10:08:21.082Z","msg_type":"execute_request","version":"5.0"},"metadata":{},"content":{"code":"sepalLength6 <- filter(iris, species == "virginica", sepal.length > 6)\ntail(sepalLength6) # compare this to head()","execution_count":5},"buffers":[]}
[Positron] RECV execute_reply from shell: {"header":{"msg_id":"cca46ef0-a32e-4384-9e27-1e1774cd5565","session":"15316e9f-2b4f-4bd9-8c78-35bd410127ce","username":"kernel","date":"2024-07-14T10:08:21.083315400+00:00","msg_type":"execute_reply","version":"5.3"},"parent_header":{"msg_id":"positron-notebook-cell-38","session":"57cab38faca1b653054ad9edb568b074","username":"William","date":"2024-07-14T10:08:21.082Z","msg_type":"execute_request","version":"5.0"},"metadata":{},"content":{"status":"error","execution_count":5,"ename":"IncompleteInput","evalue":"Code fragment is not complete: sepalLength6 <- filter(iris, species == "virginica", sepal.length > 6)\ntail(sepalLength6) # compare this to head()","traceback":[]},"buffers":[]}
[Positron] RECV comm_msg/positron-ui-r-9-c9099c32/undefined from iopub: {"header":{"msg_id":"cd0e9ef4-dff0-4d3d-af4a-ff6387ef4115","session":"15316e9f-2b4f-4bd9-8c78-35bd410127ce","username":"kernel","date":"2024-07-14T10:08:21.083346600+00:00","msg_type":"comm_msg","version":"5.3"},"parent_header":{},"metadata":{},"content":{"comm_id":"positron-ui-r-9-c9099c32","data":{"method":"busy","params":{"busy":false}}},"buffers":[]}
[Positron] RECV comm_msg/positron-ui-r-9-c9099c32/undefined from iopub: {"header":{"msg_id":"1ebfea6d-ea89-4fc6-8e27-4802b47e51c5","session":"15316e9f-2b4f-4bd9-8c78-35bd410127ce","username":"kernel","date":"2024-07-14T10:08:21.083374600+00:00","msg_type":"comm_msg","version":"5.3"},"parent_header":{},"metadata":{},"content":{"comm_id":"positron-ui-r-9-c9099c32","data":{"method":"prompt_state","params":{"input_prompt":"+ ","continuation_prompt":"+ "}}},"buffers":[]}
[Positron] R kernel status changed: busy => idle
[Positron] RECV status/idle from iopub: {"header":{"msg_id":"ac165976-77dc-4112-a822-1ec7b0ed116f","session":"15316e9f-2b4f-4bd9-8c78-35bd410127ce","username":"kernel","date":"2024-07-14T10:08:21.083384+00:00","msg_type":"status","version":"5.3"},"parent_header":{"msg_id":"positron-notebook-cell-38","session":"57cab38faca1b653054ad9edb568b074","username":"William","date":"2024-07-14T10:08:21.082Z","msg_type":"execute_request","version":"5.0"},"metadata":{},"content":{"execution_state":"idle"},"buffers":[]}

@juliasilge
Copy link
Contributor

For me locally, where something like head(iris) works correctly, I see:

  1. SEND execute_request: OK
  2. R kernel status changed: idle => busy
  3. RECV status/busy from iopub
  4. RECV execute_input from iopub
  5. RECV comm_msg/positron-ui-r-3-ae6ecc73/undefined from iopub
  6. RECV execute_result from iopub that has the content in it that needs to be displayed

In these logs from @williamcplai where it is not working correctly, we see steps 1 through 5 that look correct, but then there is no execute_result that comes through. Looks like the info is not getting sent over.

@seeM
Copy link
Contributor

seeM commented Jul 16, 2024

I think this is an ARK bug. Executing code that has a trailing comment when using 'stop' runtime behavior stops the execute_result message from coming through.

If I then shutdown the kernel, I see this backtrace:

[R] Process exit code 134
[R] 
[R] Backtrace:
[R]    0: std::backtrace::Backtrace::create
[R]    1: ark::main::{{closure}}::{{closure}}
[R]    2: ark::main::{{closure}}
[R]    3: std::panicking::rust_panic_with_hook
[R]    4: std::panicking::begin_panic_handler::{{closure}}
[R]    5: std::sys_common::backtrace::__rust_end_short_backtrace
[R]    6: _rust_begin_unwind
[R]    7: core::panicking::panic_fmt
[R]    8: core::result::unwrap_failed
[R]    9: ark::interface::RMain::refresh_lsp
[R]   10: ark::interface::RMain::read_console
[R]   11: harp::exec::try_catch::callback
[R]   12: R_withCallingErrorHandler
[R]              at /Volumes/Builds/R4/R-4.3.2/src/main/errors.c:2613:16
[R]   13: harp::exec::top_level_exec::callback
[R]   14: R_ToplevelExec
[R]              at /Volumes/Builds/R4/R-4.3.2/src/main/context.c:799:2
[R]   15: harp::exec::r_sandbox
[R]   16: _r_read_console
[R]   17: Rf_ReplIteration
[R]              at /Volumes/Builds/R4/R-4.3.2/src/main/main.c:210:10
[R]   18: R_ReplConsole
[R]              at /Volumes/Builds/R4/R-4.3.2/src/main/main.c:314:11
[R]   19: run_Rmainloop
[R]              at /Volumes/Builds/R4/R-4.3.2/src/main/main.c:1200:5
[R]   20: ark::interface::start_r
[R]   21: ark::main
[R]   22: std::sys_common::backtrace::__rust_begin_short_backtrace
[R]   23: std::rt::lang_start::{{closure}}
[R]   24: std::rt::lang_start_internal
[R]   25: _main
[R] 
[R]     at crates/ark/src/main.rs:488
[R] 
[R] 

Details

If I run an R notebook cell with code 1, the output shows as expected.

But if I add a trailing comment, the output doesn't show: 1 #. As Julia pointed out, the execute_result is missing for some reason.

The console handles the trailing comment fine. The only difference that I see between console and notebook is that the notebook uses 'stop' runtime behavior and the console uses 'continue'.

I'm not sure why the console uses 'continue', I would've thought that 'stop' is more intuitive – maybe it's a Python vs R thing?

@juliasilge juliasilge changed the title cannot show output after running cell in R notebook Cannot show output after running cell in R notebook with trailing comment Jul 16, 2024
@juliasilge
Copy link
Contributor

Ah thank you so much @seeM! We'll get this planned for fixes in ark.

@williamcplai for a short term workaround, you could avoid trailing comments, so remove # This dispalys the first six rows or put it on the previous line.

@jmcphers
Copy link
Contributor

Also reported in posit-dev/positron#4789.

@DavisVaughan
Copy link
Contributor

We have a guess that we are doing autobracing like {1 # } when really it needs to be like {\n1 # \n}

@DavisVaughan DavisVaughan transferred this issue from posit-dev/positron Feb 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants