# RPC full reinitialise

**URL:** https://forum.compas-framework.org/t/rpc-full-reinitialise/347
**Category:** Uncategorized
**Created:** [June 17, 2020, 1:25pm UTC](https://forum.compas-framework.org/t/rpc-full-reinitialise/347 "2020-06-17T13:25:22Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![robin-oval](https://avatars.discourse-cdn.com/v4/letter/r/eb9ed0/32.png) [@robin-oval](https://forum.compas-framework.org/u/robin-oval)
#### Post date: [June 17, 2020, 1:25pm UTC](https://forum.compas-framework.org/t/rpc-full-reinitialise/347/1 "2020-06-17T13:25:22Z")

</div>

Hello,

I have a problem using the RPC. It was working properly before I started to use try/except in the wrong way. It seems it tries to connect to an old non-existing one. I have this problem when I run it in Sublime (Mac side), Grasshopper on Rhino Windows but no problem on Grasshopper on Rhino Mac oddly.

Is there a brute manner to force it to reinitialise?

Thanks,  
Robin

* * *

Starting a new proxy server…  
99 attempts left.  
98 attempts left.  
97 attempts left.  
…  
0 attempts left.  
Traceback (most recent call last):  
…  
File “/Users/Robin/Documents/COMPAS/core/compas/src/compas/rpc/proxy.py”, line 238, in start\_server  
raise RPCServerError(“The server is not available.”)  
compas.rpc.errors.RPCServerError: The server is not available.

---

<div class="post-metadata">

### Author: ![arpastrana](https://avatars.discourse-cdn.com/v4/letter/a/a88e4f/32.png) [@arpastrana](https://forum.compas-framework.org/u/arpastrana)
#### Post date: [June 19, 2020, 9:17pm UTC](https://forum.compas-framework.org/t/rpc-full-reinitialise/347/2 "2020-06-19T21:17:58Z")

</div>

Would using `Proxy().stop_server()` help? Alternatively on mac, going to the Activity Monitor and killing the active process could do. On my computer this shows up as `python3.x`.

---

<div class="post-metadata">

### Author: ![robin-oval](https://avatars.discourse-cdn.com/v4/letter/r/eb9ed0/32.png) [@robin-oval](https://forum.compas-framework.org/u/robin-oval)
#### Post date: [June 22, 2020, 8:33am UTC](https://forum.compas-framework.org/t/rpc-full-reinitialise/347/3 "2020-06-22T08:33:15Z")

</div>

Still not working. The error occurs at the instantiation. And restarting my computer does not solve it and killing python via the Activity Monitor neither.

---

<div class="post-metadata">

### Author: ![tomvanmele](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.compas-framework.org/tomvanmele/32/13_2.png) [@tomvanmele](https://forum.compas-framework.org/u/tomvanmele)
#### Post date: [June 24, 2020, 8:02am UTC](https://forum.compas-framework.org/t/rpc-full-reinitialise/347/4 "2020-06-24T08:02:58Z")

</div>

hi robin,

i need a bit more info to help solve the issue.  
also, what do you mean by “before i started to use try/except in the wrong way”?

and as a side note, on windows the process running the server will show up on the “Details” tab of the “Task Manager” under “pythonw.exe”…

a method for starting RPC that should always work is to use the Terminal/Anaconda Prompt.

```bash
conda activate robin
compas_rpc start

```

or, more explicitly

```bash
conda activate robin
python
>>> from compas.rpc import Proxy
>>> proxy = Proxy()
>>>

```

let me know how that goes…

---

<div class="post-metadata">

### Author: ![robin-oval](https://avatars.discourse-cdn.com/v4/letter/r/eb9ed0/32.png) [@robin-oval](https://forum.compas-framework.org/u/robin-oval)
#### Post date: [June 24, 2020, 12:22pm UTC](https://forum.compas-framework.org/t/rpc-full-reinitialise/347/5 "2020-06-24T12:22:55Z")

</div>

Hi Tom,

I tried both methods but the RPC doesn’t appear to start. I aborted the first method because nothing happened after a minute.

> Last login: Wed Jun 24 13:01:56 on ttys000  
> The default interactive shell is now zsh.  
> To update your account to use zsh, please run `chsh -s /bin/zsh`.  
> For more details, please visit [Use zsh as the default shell on your Mac - Apple Support](https://support.apple.com/kb/HT208050).  
> (base) MacBook-Pro-de-Robin:~ Robin$ conda activate research  
> (research) MacBook-Pro-de-Robin:~ Robin$ compas\_rpc start  
> Starting default RPC service on port 1753…  
> Listening, press CTRL+C to abort…  
> ^CTraceback (most recent call last):  
> File “/Users/Robin/anaconda3/envs/research/bin/compas\_rpc”, line 11, in   
> load\_entry\_point(‘COMPAS’, ‘console\_scripts’, ‘compas\_rpc’)()  
> File “/Users/Robin/Documents/COMPAS/core/compas/src/compas/rpc/ **main**.py”, line 63, in main  
> args.func(\*\*vars(args))  
> File “/Users/Robin/Documents/COMPAS/core/compas/src/compas/rpc/ **main**.py”, line 12, in start  
> start\_service(port)  
> File “/Users/Robin/Documents/COMPAS/core/compas/src/compas/rpc/services/default.py”, line 38, in start\_service  
> server.serve\_forever()  
> File “/Users/Robin/anaconda3/envs/research/lib/python3.7/socketserver.py”, line 232, in serve\_forever  
> ready = selector.select(poll\_interval)  
> File “/Users/Robin/anaconda3/envs/research/lib/python3.7/selectors.py”, line 415, in select  
> fd\_event\_list = self.\_selector.poll(timeout)  
> KeyboardInterrupt  
> (research) MacBook-Pro-de-Robin:~ Robin$ python  
> Python 3.7.6 | packaged by conda-forge | (default, Mar 23 2020, 22:45:16)  
> [Clang 9.0.1] on darwin  
> Type “help”, “copyright”, “credits” or “license” for more information.
> 
> > > from compas.rpc import Proxy  
> > > proxy = Proxy()  
> > > Starting a new proxy server…  
> > > 99 attempts left.  
> > > 98 attempts left.  
> > > 97 attempts left.  
> > > 96 attempts left.  
> > > 95 attempts left.  
> > > 94 attempts left.  
> > > 93 attempts left.  
> > > 92 attempts left.  
> > > 91 attempts left.  
> > > 90 attempts left.  
> > > 89 attempts left.  
> > > 88 attempts left.  
> > > 87 attempts left.  
> > > 86 attempts left.  
> > > 85 attempts left.  
> > > 84 attempts left.  
> > > 83 attempts left.  
> > > 82 attempts left.  
> > > 81 attempts left.  
> > > 80 attempts left.  
> > > 79 attempts left.  
> > > 78 attempts left.  
> > > 77 attempts left.  
> > > 76 attempts left.  
> > > 75 attempts left.  
> > > 74 attempts left.  
> > > 73 attempts left.  
> > > 72 attempts left.  
> > > 71 attempts left.  
> > > 70 attempts left.  
> > > 69 attempts left.  
> > > 68 attempts left.  
> > > 67 attempts left.  
> > > 66 attempts left.  
> > > 65 attempts left.  
> > > 64 attempts left.  
> > > 63 attempts left.  
> > > 62 attempts left.  
> > > 61 attempts left.  
> > > 60 attempts left.  
> > > 59 attempts left.  
> > > 58 attempts left.  
> > > 57 attempts left.  
> > > 56 attempts left.  
> > > 55 attempts left.  
> > > 54 attempts left.  
> > > 53 attempts left.  
> > > 52 attempts left.  
> > > 51 attempts left.  
> > > 50 attempts left.  
> > > 49 attempts left.  
> > > 48 attempts left.  
> > > 47 attempts left.  
> > > 46 attempts left.  
> > > 45 attempts left.  
> > > 44 attempts left.  
> > > 43 attempts left.  
> > > 42 attempts left.  
> > > 41 attempts left.  
> > > 40 attempts left.  
> > > 39 attempts left.  
> > > 38 attempts left.  
> > > 37 attempts left.  
> > > 36 attempts left.  
> > > 35 attempts left.  
> > > 34 attempts left.  
> > > 33 attempts left.  
> > > 32 attempts left.  
> > > 31 attempts left.  
> > > 30 attempts left.  
> > > 29 attempts left.  
> > > 28 attempts left.  
> > > 27 attempts left.  
> > > 26 attempts left.  
> > > 25 attempts left.  
> > > 24 attempts left.  
> > > 23 attempts left.  
> > > 22 attempts left.  
> > > 21 attempts left.  
> > > 20 attempts left.  
> > > 19 attempts left.  
> > > 18 attempts left.  
> > > 17 attempts left.  
> > > 16 attempts left.  
> > > 15 attempts left.  
> > > 14 attempts left.  
> > > 13 attempts left.  
> > > 12 attempts left.  
> > > 11 attempts left.  
> > > 10 attempts left.  
> > > 9 attempts left.  
> > > 8 attempts left.  
> > > 7 attempts left.  
> > > 6 attempts left.  
> > > 5 attempts left.  
> > > 4 attempts left.  
> > > 3 attempts left.  
> > > 2 attempts left.  
> > > 1 attempts left.  
> > > 0 attempts left.  
> > > Traceback (most recent call last):  
> > > File “”, line 1, in   
> > > File “/Users/Robin/Documents/COMPAS/core/compas/src/compas/rpc/proxy.py”, line 102, in **init**  
> > > self.\_server = self.start\_server()  
> > > File “/Users/Robin/Documents/COMPAS/core/compas/src/compas/rpc/proxy.py”, line 238, in start\_server  
> > > raise RPCServerError(“The server is not available.”)  
> > > compas.rpc.errors.RPCServerError: The server is not available.

I tried to reinstall compas with

> pip install -e .

but the same occurred.

---

<div class="post-metadata">

### Author: ![tomvanmele](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.compas-framework.org/tomvanmele/32/13_2.png) [@tomvanmele](https://forum.compas-framework.org/u/tomvanmele)
#### Post date: [June 24, 2020, 5:15pm UTC](https://forum.compas-framework.org/t/rpc-full-reinitialise/347/6 "2020-06-24T17:15:15Z")

</div>

can you try with a clean environment? something like

```bash
conda create -n testrpc python=3.7 --yes
conda activate testrpc
cd path/to/compas
pip install -e .
python
>>> from compas.rpc import Proxy
>>> p = Proxy()
>>> p.stop_server()
>>> p.start_server()

```

---

<div class="post-metadata">

### Author: ![robin-oval](https://avatars.discourse-cdn.com/v4/letter/r/eb9ed0/32.png) [@robin-oval](https://forum.compas-framework.org/u/robin-oval)
#### Post date: [June 25, 2020, 9:46am UTC](https://forum.compas-framework.org/t/rpc-full-reinitialise/347/7 "2020-06-25T09:46:50Z")

</div>

The same happened in the new environment at

```
p = Proxy()

```

with this error

> Traceback (most recent call last):  
> File “”, line 1, in   
> File “/Users/Robin/Documents/COMPAS/core/compas/src/compas/rpc/proxy.py”, line 102, in **init**  
> self.\_server = self.start\_server()  
> File “/Users/Robin/Documents/COMPAS/core/compas/src/compas/rpc/proxy.py”, line 238, in start\_server  
> raise RPCServerError(“The server is not available.”)  
> compas.rpc.errors.RPCServerError: The server is not available.

I also tried in a new environment from a new folder for COMPAS, but it was the same.

---

<div class="post-metadata">

### Author: ![tomvanmele](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.compas-framework.org/tomvanmele/32/13_2.png) [@tomvanmele](https://forum.compas-framework.org/u/tomvanmele)
#### Post date: [June 25, 2020, 10:03am UTC](https://forum.compas-framework.org/t/rpc-full-reinitialise/347/8 "2020-06-25T10:03:35Z")

</div>

is there anything worth mentioning that happened with your computer before it stopped working? OS update, new installed software, Anaconda installation, …?
