Failed to connect to event stream

This one is easier to determine why it isn’t working any longer. Part of it is that you pinned everything. That’s great for tracking what worked at the time you were most actively working with it and thus for reproducibility. The thing is it is more susceptible to issues arising from things you cannot control. You just need one mismatch and it all goes kablooie on MyBinder because you cannot control what it uses 100%. For example, it looks like you cannot or have not controlled jupyter_core, jupyter_server nbformat, or nbclient. I can tell this because your build isn’t working and gives this right before it stops building:

Encountered problems while solving:
  - package libzlib-1.2.11-h36c2ea0_1013 has constraint zlib 1.2.11 *_1013 conflicting with zlib-1.2.11-h516909a_1006
  - package libnsl-2.0.0-h7f98852_0 requires libgcc-ng >=9.4.0, but none of the providers can be installed
  - package nbclient-0.5.10-pyhd8ed1ab_1 requires nbformat >=5.0, but none of the providers can be installed
  - package jupyter_server-1.13.4-pyhd8ed1ab_0 requires jupyter_core >=4.6.0, but none of the providers can be installed

pkgs/main/noarch          
pkgs/r/noarch             
pkgs/r/linux-64           
pkgs/main/linux-64        
conda-forge/noarch        
conda-forge/linux-64      
time: 24.005
Removing intermediate container 4b980f186944
The command '/bin/sh -c TIMEFORMAT='time: %3R' bash -c 'time ${MAMBA_EXE} env update -p ${NB_PYTHON_PREFIX} --file "environment.yml" && time ${MAMBA_EXE} clean --all -f -y && ${MAMBA_EXE} list -p ${NB_PYTHON_PREFIX} '' returned a non-zero code: 1Built image, launching...
Failed to connect to event stream

The MyBinder system lets you put configuration files in a directory called binder that it will use for building. That way you can leave in the root directory your detailed environment and requirement files that have all the stuff you would control if you absolutely could and wanted to get back to what maybe you reported when you froze your environment; however, having special configuration files in the binder directory allows you to still change things so it will build via MyBinder and then once what you need at a minimum works, you can see what you can pin or not until it breaks again. Sometimes this is easier local via repo2docker. In general, I don’t bother pinning the stuff in the binder directory especially if there are a lot of interdependent dependencies. They generally work together in MyBinder-spawned sessions better if they are all current with the Jupyter ecosystem.

Is there a short notebook of this kaibawong/COE_crude_differentials repo that would be a start to getting working again? I didn’t actually poke around in your notebooks from repo because it doesn’t launch; however, your other one at GitHub - kaibawong/EPA launches. The notebook I looked at there was in a single cell an epically long script with what seemed like everything and the kitchen sink in it. Thus, it is not a good place to start. I’m looking for you to point me to one short notebook or a few cells from GitHub - kaibawong/COE_crude_differentials that I could get working. If I could do that with a fork of yours and tell you how I did it, you could probably expand out the process of doing that yourself to rest of GitHub - kaibawong/COE_crude_differentials .

Then maybe once you see how it works for your kaibawong/COE_crude_differentials repo you could do the same for kaibawong/EPA.

(For future reference to have handy, the launch link for your is kaibawong/COE_crude_differentials repo:

https://mybinder.org/v2/gh/kaibawong/COE_crude_differentials/HEAD

)



Confusingly, I don’t know why at the end of the Build logs I pasted above it is showing the following:

Built image, launching...
Failed to connect to event stream

It shouldn’t show Built image, launching... because it didn’t build. It stopped building when the mamba command returned a non-zero code. And then as it triggers additional stuff it really shouldn’t be it can get caught up in a loop where the Failed to connect to event stream keeps showing up on Chrome and you don’t see the build info right now. I had better luck in Firefox getting the build attempt to show up again. Using Firefox was how I copied that text.

It looks like this one you fixed somewhat since your post.
It works better unpinned, see my fork here.
Or click to launch here:

Binder

When that notebook comes up you can press ‘Appmode’ icon on the toolbar just like before.

You need to specify to open with the classic mode in the URL of your launch badge. MyBinder recently switched to JupyterLab as the default, see here. (I’m not sure why JupyterLab isn’t getting installed without specifying it right now; I think that is a current glitch perhaps as neither the requirements.txt example or the conda example show specifying it. The announcement specifically said Docker installs would need to install JupyterLab. ==> UPDATE: I tracked this down to nbinteract. Addition of that under the pip section in the environment.yml file causes JupyterLab not to be installed as is the typical default. Probably nbinteract would do the same if added in requirements.txt since I saw JupyterLab installation by the MyBinder system not happen when it was there.)

The big thing I did was move the environment.yml file to binder directory and unpin everything. Since most of what you had there could be handled by mamba, I also transferred the bulk of it installation over to mamba/conda.
Actually except for then needing to activate appmode extension separately, you could do the entire install with requirements.txt. I did that without separate appmode activation as a test, see here. You can launch using that commit here. Appmode doesn’t work there as I didn’t do the separate step of activating the extension in a postBuild or start configuration file.

Hi fomightez,

Thank you so much, but i tried the commit in your last post, and i still cannot launch it / I am getting a 404…

I must say I dont understand alot of the jargons you mentioned and have very little working idea about binder… or even how the python installation and environment works. I use binder because i dont have python on my laptop. I just want to get binder working again for me, which i have no clue what happened since Tuesday then it all stop working.

Regarding the big chuck of code, appmode used to work, so if i run that code, it gets hidden and the user can play with the widget to see how different differential prices changes as a function of product prices and also forecasted brent price, But since appmode stop working for me, its just many lines of code together.

Can you advise what should I do? i read somewhere that if I can go back before the last commit, maybe i can fix it. but how can i go back to the previous commit in github, without launching binder and do it in the terminal? Any advice? please help!

Sorry, about that. I took what the form generated and forgot to edit it to open in the classic notebook interface. I edited it now and tested it. You can also try the launch from here. (Remember, this isn’t the one to use because appmode doesn’t get enabled in that one. It was more of an intermediate I tried to see if I could go that route if environment.yml use seemed troublesome. Use my current fork as a guide because appmode is running there.)

I’m confused by this. If you launch from my fork via Binder, and press the appmode button on the toolbar when the notebook comes up (or simply use the URL I show next below), you’ll see the appmode view works fine again. And so I’m confused why you are saying that and asking what to do next? By the way, you can launch directly into Appmode and not tell people to press the button at top of you notebook. For mine the following URL will open directly in the appmode view:

http://mybinder.org/v2/gh/fomightez/EPA/HEAD?urlpath=%2Fapps%2Fappmode_all.ipynb

You can use that pattern to design your own launch URL after to add a binder directory to your repo and place a copy of the environment.yml I made in it. (I’d suggest also deleting nbinteract,too, see the ‘aside’ below; however, that deletionis optional.)

You don’t need to roll anything back here because your older version isn’t going to work with the updated MyBinder environment as well as what I’ve guided you to do now. More importantly, you don’t need to roll back to test because you can have MyBinder launch with previous commits by using the form at MyBinder.org to build the launch link. There a spot on the form for putting in commits using the commit ID tag from the history. That is how I provided one to test where I just used requirements.txt.

An aside:
Also, the default ability to launch to JupyterLab and not see the 404 error should be restored if you remove nbinteract from your environment.yml in your binder directory. For some reason, that seems to interfere with the MyBinder system default installation of JupyterLab. Because JupyterLab is then not installed, it fails with the 404 screen with the launch link you like you posted in your reply here. Your launch link just the standard one and so it tries to default to JupyterLab.