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

Plugins in local instance #1549

Open
fxbuson opened this issue May 31, 2024 · 6 comments
Open

Plugins in local instance #1549

fxbuson opened this issue May 31, 2024 · 6 comments

Comments

@fxbuson
Copy link

fxbuson commented May 31, 2024

Hi all,

I'm trying to play around with a local instance of synbiohub and am having some problems getting plugins to work.

I'm trying to get the seqviz plugin to work, and I'm getting a connection error:

error: connect ECONNREFUSED 127.0.0.1:8085 {"errno":"ECONNREFUSED","code":"ECONNREFUSED", "syscall":"connect","address":"127.0.0.1","port":8085}

I also had a more general question about plugins: Where are all plugins actually located? I'm specifically looking for the Accurat plugins to test on this local instance, but I wouldn't know how to call and pull them.

@cjmyers
Copy link
Collaborator

cjmyers commented Jun 1, 2024

SeqViz has been having issues for us recently. I'm not sure why. It is very strange, since it has not changed in a long time, and we are running it from Docker.

The source for all our plugins is here:

https://github.com/SynBioHub

All of them should have Docker images on Docker Hub. I don't know where Accurat put their source code. But you can access running versions as specified here:

Screenshot 2024-06-01 at 2 26 16 PM

Finally, these docs should be helpful to you:

https://wiki.synbiohub.org/plugins/

@fxbuson
Copy link
Author

fxbuson commented Jun 5, 2024

I don't know if the problem is specifically with Seqviz.

Here is a screenshot of my admin page setup:
image
and what I see in a component page (only the plugins that were called by their names):
image(1)

This gives me the following on the console (when refreshing the component page):

synbiohub_1           | info: type is http://sbols.org/v2#ComponentDefinition
synbiohub_1           | info: 1 URI(s) left to resolve
synbiohub_1           | info: 10 URI(s) left to resolve
synbiohub_1           | info: 8 URI(s) left to resolve
synbiohub_1           | info: 6 URI(s) left to resolve
synbiohub_1           | info: 4 URI(s) left to resolve
synbiohub_1           | error: connect ECONNREFUSED [127.0.0.1:8085](http://127.0.0.1:8085/) {"errno":"ECONNREFUSED","code":"ECONNREFUSED","syscall":"connect","address":"127.0.0.1","port":8085}
synbiohub_1           | error: connect ECONNREFUSED [127.0.0.1:8081](http://127.0.0.1:8081/) {"errno":"ECONNREFUSED","code":"ECONNREFUSED","syscall":"connect","address":"127.0.0.1","port":8081}
pluginVisualSeqviz_1  | Status
synbiohub_1           | info: creating stream 51a152de-209f-4c54-8647-c26146412b6b
synbiohub_1           | info: prepare 51a152de-209f-4c54-8647-c26146412b6b
synbiohub_1           | info: creating stream e25906e7-68ea-4def-aaf9-3041937489be
synbiohub_1           | info: prepare e25906e7-68ea-4def-aaf9-3041937489be
synbiohub_1           | info: creating stream 183b881b-019a-47cf-9c87-2708b8d91fef
synbiohub_1           | info: prepare 183b881b-019a-47cf-9c87-2708b8d91fef
pluginVisualSeqviz_1  | evaluate Component
synbiohub_1           | error: stream 51a152de-209f-4c54-8647-c26146412b6b does not exist
synbiohub_1           | warn: resolving stream e25906e7-68ea-4def-aaf9-3041937489be
synbiohub_1           | info: resolve e25906e7-68ea-4def-aaf9-3041937489be
synbiohub_1           | warn: resolving stream 183b881b-019a-47cf-9c87-2708b8d91fef
synbiohub_1           | info: resolve 183b881b-019a-47cf-9c87-2708b8d91fef
pluginVisualSeqviz_1  | run url=http://localhost:7777/user/fxbuson/test/OP_052/1/5a644451081d9ddea6c0f88c2edfa10fb7fb1f73/share/sbol top=http://localhost:7777/user/fxbuson/test/OP_052/1 hostAddr=synbiohub-docker_pluginvisualseqviz_1:5000
pluginVisualSeqviz_1  | error: Error: connect ECONNREFUSED [127.0.0.1:7777](http://127.0.0.1:7777/)
pluginVisualSeqviz_1  |     at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1595:16) {
pluginVisualSeqviz_1  |   errno: -111,
pluginVisualSeqviz_1  |   code: 'ECONNREFUSED',
pluginVisualSeqviz_1  |   syscall: 'connect',
pluginVisualSeqviz_1  |   address: '127.0.0.1',
pluginVisualSeqviz_1  |   port: 7777
pluginVisualSeqviz_1  | }
synbiohub_1           | info: Setting 183b881b-019a-47cf-9c87-2708b8d91fef
synbiohub_1           | info: Setting e25906e7-68ea-4def-aaf9-3041937489be
synbiohub_1           | info: completing stream e25906e7-68ea-4def-aaf9-3041937489be
synbiohub_1           | info: completing stream 183b881b-019a-47cf-9c87-2708b8d91fef
synbiohub_1           | info: clear e25906e7-68ea-4def-aaf9-3041937489be
synbiohub_1           | info: clear 183b881b-019a-47cf-9c87-2708b8d91fef
synbiohub_1           | info: clear 183b881b-019a-47cf-9c87-2708b8d91fef
synbiohub_1           | info: clear e25906e7-68ea-4def-aaf9-3041937489be

To me it seems like I'm not able to point to things correctly when using port numbers (as in trying to connect to :8085 and :8081), since when using the plugin name it kind of works. I still get the error on Seqviz though, which I imagine happens because of trying to connect to localhost:7777 on the way back and not managing to.

I think it might be related to Common Problem 2 on the wiki:

If you’ve locally installed SynBioHub using the above commands it might cause issues in some plugins, that will receive urls that look like: http://localhost:7777/xxxxxxx. Localhost in docker containers refers to the container itself. The problem is explained further here. On Linux this problem is solvable and the solution cab be found on stack overflow and on docker.

but it's a bit hard for me to translate the solution to synbiohub from stack overflow and docker, because I lack the experience in docker/docker-compose. I understand I need to try "host network mode" on containers, but where specifically do I do this? Stack overflow says:

To enable this in Docker Compose on Linux, add the following lines to the container definition:
extra_hosts:
- "host.docker.internal:host-gateway"

Should I change something on the docker-compose .yml files? Or do something as a command when I boot synbiohub?

Also, I'm not sure why the online plugins didn't work. SynBioHub was up and should be working.

Thanks for the help!

@fxbuson
Copy link
Author

fxbuson commented Jun 5, 2024

I got a bit more insight into what's happening.

With the name assignment on the admin page (or using the "host.docker.internal:host-gateway" extra host on the synbiohub docker yml) I can successfully request the plugins. The problem now is that they're still trying to reach information from an SBOL component which has a URL starting in "http://localhost", so I still get a connection error there.

I tried declaring the extra host on the plugin container yml, but didn't manage to make it work. I'm not sure if that would work anyway because even if the plugin can access the alternative host, it's going to look for localhost:7777 because that's what is in the SBOL url.

I managed to reach the online plugins too. I was just using "http" instead of "https" on the Accurat one and the SBHub Seqviz was just non-responsive (in the main SynBioHub too).

@cjmyers
Copy link
Collaborator

cjmyers commented Jun 6, 2024

SeqViz recently stopped working for us. I'm not sure why, and I've not had time to fully debug it (bit swamped on a few others things right now). Right now, we have taken it down, since its failing was causing problems to SBH. It is probably best to avoid using this one until we can figure out why it suddenly stopped working for us.

@fxbuson
Copy link
Author

fxbuson commented Jun 7, 2024

I believe my problem is a bit more general than just Seqviz not working. I'm getting an error from a plugin trying to get SBOL object data from localhost:7777 because that's what is in the SBOL URL.

I know this is exclusive to local instances, but would be nice if it could be solved.

@cjmyers
Copy link
Collaborator

cjmyers commented Jun 22, 2024

We recently got SeqViz up and running again. However, I think you are right that you will likely continue to have issues due to the fact that plugins are trying to communicate with localhost. I'm actually not very sure how to access external plugins from a local instance. I've never done this myself, and it is also outside my expertise. I think we usually test plugins by running them locally. I'm going to connect you to @JMante1 and @zane-perry by email to see if they can help.

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

2 participants