Open homer3018 opened 1 year ago
I just tried to upgrade and use shiny_1.7.4
but no luck.
However the search labels bar is working. As I type something I know is there, it's bringing the topper to the appropriate timestamp. I still can't see a thing though...
Thank you for the reactlog.txt
file! I am able to reprex the display issue.
Opening the chrome debugger, r155
is depending on r3
. r155
is defined as:
list(action = "define", reactId = "r155",
label = structure("output$cycle_table", srcfile = "server.R")
I can see a successful definition of cycle_data_inter
(r128
), so it is not that specific reactive value.
Does your output$cycle
depend on something that is not in your server
definition?
Does your reactlog work if you call shiny::reactlogShow()
? (This shows all reactive knowledge, not just a specific reactive session.)
Thanks for helping out !
So output$cycle
is just a plot depending on cycle_data
, which in turn depends on cycle_data_ref
and cycle_data_inter
.
shiny::reactlogShow()
launch the browser but with the same display issue.
> shiny::reactlogShow()
warning messages from top-level task callback '1'
Warning message:
In is.call(expr) && as.character(expr[[1]]) %in% c("<-", "=") :
'length(x) = 3 > 1' in coercion to 'logical(1)'
Everything lies in my server file and the UI is pretty basic, only displaying UIOutput
and conditionalPanel
etc.
Upon testing a little bit, calling output$cycle
(the plot) works fine, and I can see the log up to that point.
output$cycle_table
trigger the display issue and as I refresh the page once I've called it, the entire tree is not there anymore.
output$cycle_time_clustering
does the same.
How and where is cycle_data_ref
defined?
Can you try calling the code below and let me know the output?
options(warn = 2)
shiny::reactlogShow()
traceback()
If it's a ok with you, may I have your app code? 😃😃😃
> options(warn = 2)
> shiny::reactlogShow()
> traceback()
11: execCallbacks(timeoutSecs, all, loop$id)
10: run_now(timeoutMs/1000, all = FALSE)
9: service(timeout)
8: serviceApp()
7: ..stacktracefloor..(serviceApp())
6: withCallingHandlers(expr, error = doCaptureStack)
5: domain$wrapSync(expr)
4: promises::with_promise_domain(createStackTracePromiseDomain(),
expr)
3: captureStackTraces({
while (!.globals$stopped) {
..stacktracefloor..(serviceApp())
}
})
2: ..stacktraceoff..(captureStackTraces({
while (!.globals$stopped) {
..stacktracefloor..(serviceApp())
}
}))
1: shiny::runApp("CD00_67_Shiny")
I'd love to share my code but unfortunately I can't do that.
As for cycle_data_ref
, it is a relatively easy transformation of cycle_data_inter
.
cycle_data
is then a join of cycle_data_inter
and cycle_data_ref
.
Does that answer your question ? (Where is it defined ?)
Thank you. Please call options(warn = 0)
to reset it
Can you paste the code for the definition of cycle_data_ref
? I'm trying to figure out why the {reactlog}
is not defining it. {shiny}
/{reactlog}
knows output$cycle
depends on cycle_data_ref
, but there is no definition for it. I'm curious how cycle_data_ref
can be created while not being defined.
Where in your code is cycle_data_ref
written? Within your server
function? Outside of your server
function?
Debugging for the warning...
The logs above didn't give anything, it is just the {promise}
package (which {shiny}
uses for the runtime loop).
I found this issue: https://github.com/r-lib/testthat/issues/1620 which is fixed in https://github.com/r-dbi/odbc/pull/494 . Installing r-dbi/odbc
from GitHub should make the warning go away until the next release of {odbc}
.
... maybe it'll make {reactlog}
work? 🤷♂️
Yes cycle_data_ref
is defined within the server function, nothing really fancy in there :
cycle_data_ref <- reactive({
data <- cycle_data_inter() %>%
filter(!GANTRY) %>%
group_by(STATION_GROUP) %>%
count(REF) %>%
filter(!is.na(REF), REF != "") %>%
mutate(ORDER = rank(-n)) %>%
arrange(STATION_GROUP, ORDER)
if (nrow(data) > 0) {
data <- data %>%
mutate(TOP_REF = paste0("#", ORDER, " OP", STATION_GROUP, " - ", REF))
}
return(data)
})
(After install r-dbi/odbc
from GitHub, be sure to restart your R session)
Thank you for the code! You're correct. Nothing there that shouldn't make it work.
For fun, can you try adding label = "cycle_data_ref"
to the reactive()
function call?
Ex:
cycle_data_ref <- reactive(label = "cycle_data_ref", {
data <- cycle_data_inter() %>%
filter(!GANTRY) %>%
group_by(STATION_GROUP) %>%
count(REF) %>%
filter(!is.na(REF), REF != "") %>%
mutate(ORDER = rank(-n)) %>%
arrange(STATION_GROUP, ORDER)
if (nrow(data) > 0) {
data <- data %>%
mutate(TOP_REF = paste0("#", ORDER, " OP", STATION_GROUP, " - ", REF))
}
return(data)
})
The install from GitHub is failing 😞 :
** testing if installed package can be loaded from temporary location
Error: package or namespace load failed for ‘odbc’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/private/var/folders/lj/mbj_rxz12wvdp8kfmcpj14f00000gq/T/Rtmpentrfn/Rinst1d364288a867/00LOCK-odbc/00new/odbc/libs/odbc.so':
dlopen(/private/var/folders/lj/mbj_rxz12wvdp8kfmcpj14f00000gq/T/Rtmpentrfn/Rinst1d364288a867/00LOCK-odbc/00new/odbc/libs/odbc.so, 0x0006): Library not loaded: @rpath/libodbc.2.dylib
Referenced from: <BC5426D7-1EBE-34E4-A40F-3B8B6E0E2856> /private/var/folders/lj/mbj_rxz12wvdp8kfmcpj14f00000gq/T/Rtmpentrfn/Rinst1d364288a867/00LOCK-odbc/00new/odbc/libs/odbc.so
Reason: tried: '/System/Volumes/Preboot/Cryptexes/OS@rpath/libodbc.2.dylib' (no such file), '/Library/Frameworks/R.framework/Resources/lib/libodbc.2.dylib' (no such file), '/Library/Java/JavaVirtualMachines/jdk-17.0.1+12/Contents/Home/lib/server/libodbc.2.dylib' (no such file)
Error: loading failed
Execution halted
ERROR: loading failed
─ removing ‘/private/var/folders/lj/mbj_rxz12wvdp8kfmcpj14f00000gq/T/Rtmpentrfn/Rinst1d364288a867/odbc’
-----------------------------------
ERROR: package installation failed
Error: Failed to install 'odbc' from GitHub:
The label label = "cycle_data_ref"
does not change anything.
Worth a try to install {odbc}
from GitHub. Thank you.
Don't know if the macOS instructions here would help: https://github.com/r-dbi/odbc#macos . Don't know if libodbc
is installed via unixodbc
.
Unfortunately without an minimal Shiny app to test on my side, it makes debugging very hard.
I'll leave the issue open, but I don't think we'll find the original reason why 😭
I'll have a closer look at odbc
and unixodbc
(I do think libodbc
comes with it but I'd have to double check on this one...).
I'm not fully convinced at this stage that this would change anything, but worth trying I agree.
I know and I'm sorry, I simply can't share this. It might be partly my fault in the sense that I used to use quite regularly the reactlog and at some point stopped. Now a whole lot of commits have been pushed, and all I want is a clear flowchart of all the relationships and for some reason it's not working. It might have been easier to look into that as soon as I'd have noticed this... I'll keep investigating and report should I find something worth mentioning.
Thanks for your help so far. Very much appreciated :)
Hey, since cycle_table
breaks the display, would it help if I just export the reactlog calling just this one ? It is rather a "simple" one as it only depends on cycle_data_inter
.
The reactlog.txt
you have was when I called every single outputs in my app to have the full blown flowchart.
I'm not fully convinced at this stage that this would change anything, but worth trying I agree.
I agree. It will probably only get rid of the warning.
If you can share any Shiny app that has the unexpected behavior, that'd be great! (...But that is easier said than done.)
I'd like to know how the reactlog is being recorded improperly.
Playback issue
Hello. I seem to have a playback issue where the reactlog shows blank in my browser, while the top bar definitely shows steps. I have no nodes and can't do anything. Tried with Safari and Edge, results is the same. I've tried while the app is running, and after having stopped it, same results.
Screenshot attached:
I have also exported it with
dput(shiny::reactlog(), file = "reactlog.txt")
: reactlog.txtSessionInfo()
:Thanks !