# Org-protocol broken after upgrade to M1 Macbook

**URL:** <https://org-roam.discourse.group/t/org-protocol-broken-after-upgrade-to-m1-macbook/2624>\
**Category:** Troubleshooting\
**Created:** [May 27, 2022, 3:06am UTC](https://org-roam.discourse.group/t/org-protocol-broken-after-upgrade-to-m1-macbook/2624 "2022-05-27T03:06:14Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![gcoladon](https://yyz2.discourse-cdn.com/free1/user_avatar/org-roam.discourse.group/gcoladon/32/976_2.png) [@gcoladon](https://org-roam.discourse.group/u/gcoladon)\
**Post date:** [May 27, 2022, 3:06am UTC](https://org-roam.discourse.group/t/org-protocol-broken-after-upgrade-to-m1-macbook/2624/1 "2022-05-27T03:06:14Z")

</div>

Hey all. Did anyone else experience the problem of their org protocol links breaking after upgrading either to the latest MacOS or to the latest Apple Silicon processor?

I upgraded via migrating from my old laptop to my new one, and all the files got copied over, including the OrgProtocolClient.app, with all its configuration from

> **[Org-roam User Manual](https://www.orgroam.com/manual.html#Mac-OS)**
>
> Org-roam User Manual

intact. But when I try to use it, nothing happens (at least it doesn’t look like anything happened).

Thanks for any suggestions!  
Greg

---

<div class="post-metadata">

**Author:** ![nobiot](https://yyz2.discourse-cdn.com/free1/user_avatar/org-roam.discourse.group/nobiot/32/159_2.png) [@nobiot](https://org-roam.discourse.group/u/nobiot)\
**Post date:** [May 27, 2022, 3:59pm UTC](https://org-roam.discourse.group/t/org-protocol-broken-after-upgrade-to-m1-macbook/2624/2 "2022-05-27T15:59:36Z")

</div>

How about this part:

> You may need to manually register your handler, like this:  
> `/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -R -f /Applications/OrgProtocolClient.app`

The manual also talks about how to test the register for Mac.

Or your Emacs Server is not active? (`server-mode`, I believe).

---

<div class="post-metadata">

**Author:** ![gcoladon](https://yyz2.discourse-cdn.com/free1/user_avatar/org-roam.discourse.group/gcoladon/32/976_2.png) [@gcoladon](https://org-roam.discourse.group/u/gcoladon)\
**Post date:** [May 27, 2022, 4:47pm UTC](https://org-roam.discourse.group/t/org-protocol-broken-after-upgrade-to-m1-macbook/2624/3 "2022-05-27T16:47:41Z")

</div>

Thank you Nobiot for offering your advice 🙂

> [@nobiot](#):
>
> How about this part: \> You may need to manually register your handler, like this:

Yes, I ran that command on the new Mac before posting

> [@nobiot](#):
>
> The manual also talks about how to test the register for Mac.

Yes, when I run the testing command:

```auto
open org-protocol://roam-ref\?template=r\&ref=test\&title=this

```

nothing happens

> [@nobiot](#):
>
> Or your Emacs Server is not active? ( `server-mode` , I believe).

I believe server mode is on, because

```auto
emacsclient foo.txt

```

works correctly. Is that assumption of mind correct – that if emacsclient works, emacs server-mode is working?

This back and forth has inspired me to check the value of `org-protocol-protocol-alist`. which I found to be nil. Well, that seems like it might be the problem. I will now investigate where these handlers are supposed to be registered and figure out why they aren’t.

---

<div class="post-metadata">

**Author:** ![gcoladon](https://yyz2.discourse-cdn.com/free1/user_avatar/org-roam.discourse.group/gcoladon/32/976_2.png) [@gcoladon](https://org-roam.discourse.group/u/gcoladon)\
**Post date:** [May 27, 2022, 6:03pm UTC](https://org-roam.discourse.group/t/org-protocol-broken-after-upgrade-to-m1-macbook/2624/4 "2022-05-27T18:03:08Z")

</div>

OK I think I’ve solved the problem but going pretty deep into the rabbit hole but I’m not sure what exactly was wrong.

When I tried to evaluate

`(require org-protocol)`

I got an error along the lines of “org-roam-protocol not found”. When I checked my org-roam repo, I saw that org-roam-protocol was in the extensions folder, but I wasn’t sure how long ago it had moved there. So “to be safe” I deleted Doom’s directory of pre-compiled elc files and tried rerunning emacs, but then emacs didn’t start at all anymore.

doom sync and doom doctor didn’t work either, and they were failing with an “illegal instruction” error. I traced this to the fact that the emacs that doom was trying to run was the x86 executable, but in that same directory there was an arm64 executable, which from reading the doom shell script, I figured out I could use by setting the EMACS environment variable to the arm64 executable.

Once i set that env var, I was able to doom sync, rebuild the elc files, and then run emacs, and once I ran it, org-protocol could be loaded and now the browser based org-protocol links worked.

Whew!

---

<div class="post-metadata">

**Author:** ![nobiot](https://yyz2.discourse-cdn.com/free1/user_avatar/org-roam.discourse.group/nobiot/32/159_2.png) [@nobiot](https://org-roam.discourse.group/u/nobiot)\
**Post date:** [May 27, 2022, 6:06pm UTC](https://org-roam.discourse.group/t/org-protocol-broken-after-upgrade-to-m1-macbook/2624/5 "2022-05-27T18:06:39Z")

</div>

> [@gcoladon](#):
>
> doom sync and doom doctor didn’t work either, and they were failing with an “illegal instruction” error. I traced this to the fact that the emacs that doom was trying to run was the x86 executable, but in that same directory there was an arm64 executable, which from reading the doom shell script, I figured out I could use by setting the EMACS environment variable to the arm64 executable.

This sounds like something the Doom community would benefit from 🙂

---

<div class="post-metadata">

**Author:** ![gcoladon](https://yyz2.discourse-cdn.com/free1/user_avatar/org-roam.discourse.group/gcoladon/32/976_2.png) [@gcoladon](https://org-roam.discourse.group/u/gcoladon)\
**Post date:** [May 27, 2022, 6:29pm UTC](https://org-roam.discourse.group/t/org-protocol-broken-after-upgrade-to-m1-macbook/2624/6 "2022-05-27T18:29:55Z")

</div>

> [@nobiot](#):
>
> This sounds like something the Doom community would benefit from 🙂

Yes I’ve been posting over there too – and now have posted the solution I found as well 🙂

> **[Doctor and more broken after migrating from Intel to M1 MacBook](https://discourse.doomemacs.org/t/doctor-and-more-broken-after-migrating-from-intel-to-m1-macbook/2726)**
>
> What happened? I upgraded my Mac from a 2017 Intel Mac to a 2022 M1 Mac. And now neither doom sync nor doom doctor works. Here’s what happens when I run doom sync: Loading data dump... What did you expect to happen? I hoped that migrating...
