# My broken Discourse install prevents theme import

**URL:** https://meta.discourse.org/t/my-broken-discourse-install-prevents-theme-import/108657
**Category:** Support
**Tags:** unsupported-install
**Created:** [2월 7, 2019, 8:36오전 UTC](https://meta.discourse.org/t/my-broken-discourse-install-prevents-theme-import/108657 "2019-02-07T08:36:06Z")
**Posts on this page:** 18
**Page:** 1

<div class="post-metadata">

### Author: ![ahmed\_alamiry](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ahmed_alamiry/32/198190_2.png) [@ahmed\_alamiry](https://meta.discourse.org/u/ahmed_alamiry)
#### Post date: [2월 7, 2019, 8:36오전 UTC](https://meta.discourse.org/t/my-broken-discourse-install-prevents-theme-import/108657/1 "2019-02-07T08:36:06Z")

</div>

![image](https://global.discourse-cdn.com/meta/original/3X/5/f/5f15f609df6eafdbe3cf9e89350647f64d640b4a.png)

what does this mean

---

<div class="post-metadata">

### Author: ![Johani](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/johani/32/176920_2.png) [@Johani](https://meta.discourse.org/u/Johani)
#### Post date: [2월 7, 2019, 8:43오전 UTC](https://meta.discourse.org/t/my-broken-discourse-install-prevents-theme-import/108657/2 "2019-02-07T08:43:41Z")

</div>

Did you add the deploy key to the repository?

> [@Installing a theme from a private Git repository](https://meta.discourse.org/t/installing-a-theme-from-a-private-git-repository/82584/1):
>
> Paste in the public key into your git repo so it is the used as a “deploy key”
> 
> ![image.png](https://global.discourse-cdn.com/meta/original/3X/e/d/ed1f7d739c641e3b2fed0132a245969d80bf047f.png)

---

<div class="post-metadata">

### Author: ![ahmed\_alamiry](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ahmed_alamiry/32/198190_2.png) [@ahmed\_alamiry](https://meta.discourse.org/u/ahmed_alamiry)
#### Post date: [2월 7, 2019, 8:56오전 UTC](https://meta.discourse.org/t/my-broken-discourse-install-prevents-theme-import/108657/3 "2019-02-07T08:56:16Z")

</div>

yes

 ![image](https://global.discourse-cdn.com/meta/original/3X/f/a/fa24e63f3a744792ccebc1913aadedf4c8b790f8.png)

---

<div class="post-metadata">

### Author: ![Johani](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/johani/32/176920_2.png) [@Johani](https://meta.discourse.org/u/Johani)
#### Post date: [2월 7, 2019, 11:23오전 UTC](https://meta.discourse.org/t/my-broken-discourse-install-prevents-theme-import/108657/4 "2019-02-07T11:23:50Z")

</div>

Great, thanks for confirming.

What version of Discourse are you on?  
Can you confirm that the `about.json` file in the theme doesn’t have any syntax errors?

Newer versions of Discourse give you much clearer messages in the case of incorrect json syntax, but I have to ask since I don’t know what version you’re on.

 ![1123](https://global.discourse-cdn.com/meta/original/3X/d/5/d5b78022622614f68c5e68ccb37d1b7e41c421e5.png)

Are you behind Cloudflare?  
Do you see any errors in the browser console?

---

<div class="post-metadata">

### Author: ![ahmed\_alamiry](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ahmed_alamiry/32/198190_2.png) [@ahmed\_alamiry](https://meta.discourse.org/u/ahmed_alamiry)
#### Post date: [2월 7, 2019, 11:32오전 UTC](https://meta.discourse.org/t/my-broken-discourse-install-prevents-theme-import/108657/5 "2019-02-07T11:32:53Z")

</div>

this is the version

 ![image](https://global.discourse-cdn.com/meta/original/3X/9/1/9165d637751c537421d03fb63aae003702db8ef3.png)

and here is the about.json

 ![image](https://global.discourse-cdn.com/meta/original/3X/3/f/3f556872d8f7059d77fe5ef0ece0bbdd23ba36ee.png)

I am running dicourse in my local lab (on a vm ).

I need the color scheme to be imported along with theme, I tried with local theme export and then import but no luck with the color scheme.

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [2월 7, 2019, 11:46오전 UTC](https://meta.discourse.org/t/my-broken-discourse-install-prevents-theme-import/108657/6 "2019-02-07T11:46:08Z")

</div>

Can you upload the `about.json` file here, so we can test it?

---

<div class="post-metadata">

### Author: ![ahmed\_alamiry](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ahmed_alamiry/32/198190_2.png) [@ahmed\_alamiry](https://meta.discourse.org/u/ahmed_alamiry)
#### Post date: [2월 7, 2019, 12:12오후 UTC](https://meta.discourse.org/t/my-broken-discourse-install-prevents-theme-import/108657/7 "2019-02-07T12:12:21Z")

</div>

[about.json](https://global.discourse-cdn.com/meta/original/3X/4/0/40087196bf72a3f6233e45d3bcc63d26174b3b55.json) (590 Bytes)

here the about.json

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [2월 7, 2019, 12:16오후 UTC](https://meta.discourse.org/t/my-broken-discourse-install-prevents-theme-import/108657/8 "2019-02-07T12:16:27Z")

</div>

Importing that works for me. Here’s it wrapped up in a `.tar.gz` file for import:

[test-theme.tar.gz](https://global.discourse-cdn.com/meta/original/3X/3/e/3e840610a2b0667aa8ab21b6c5ca1216771aa14e.gz) (785 Bytes)

Can you describe the exact steps you are taking which cause the error?

---

<div class="post-metadata">

### Author: ![ahmed\_alamiry](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ahmed_alamiry/32/198190_2.png) [@ahmed\_alamiry](https://meta.discourse.org/u/ahmed_alamiry)
#### Post date: [2월 7, 2019, 12:39오후 UTC](https://meta.discourse.org/t/my-broken-discourse-install-prevents-theme-import/108657/9 "2019-02-07T12:39:36Z")

</div>

Thank you David, I tried the file uploaded and it worked with me.

Regarding the steps of importing my remote theme as follow and I still face issue.

I used discourse theme CLI and then put in github as private, I then import from the web as bellow

 ![image](https://global.discourse-cdn.com/meta/original/3X/f/c/fc5cccdb781769103ef8f63dcf109cea23dbe7c2.png)

After I click import it take a while then it give me bellow error

 ![image](https://global.discourse-cdn.com/meta/original/3X/a/f/af1b102a12c405d87b7df777bda58974bc2a0259.png)

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [2월 7, 2019, 12:43오후 UTC](https://meta.discourse.org/t/my-broken-discourse-install-prevents-theme-import/108657/10 "2019-02-07T12:43:14Z")

</div>

Can you try using [theme-creator.discourse.org](http://theme-creator.discourse.org) to import the private git theme, and see if you get the same error?

502 is not an error that should be thrown by import issues… it suggests there could be something wrong with your local discourse setup.

---

<div class="post-metadata">

### Author: ![ahmed\_alamiry](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ahmed_alamiry/32/198190_2.png) [@ahmed\_alamiry](https://meta.discourse.org/u/ahmed_alamiry)
#### Post date: [2월 7, 2019, 12:48오후 UTC](https://meta.discourse.org/t/my-broken-discourse-install-prevents-theme-import/108657/11 "2019-02-07T12:48:40Z")

</div>

successfully imported in [http://theme-creator.discourse.org/](http://theme-creator.discourse.org/)

So it is about my discourse setup 😖

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [2월 7, 2019, 12:56오후 UTC](https://meta.discourse.org/t/my-broken-discourse-install-prevents-theme-import/108657/12 "2019-02-07T12:56:17Z")

</div>

Yes, I think so. How have you configured the development environment? Did you use one of our setup guides?

---

<div class="post-metadata">

### Author: ![ahmed\_alamiry](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ahmed_alamiry/32/198190_2.png) [@ahmed\_alamiry](https://meta.discourse.org/u/ahmed_alamiry)
#### Post date: [2월 7, 2019, 1:04오후 UTC](https://meta.discourse.org/t/my-broken-discourse-install-prevents-theme-import/108657/13 "2019-02-07T13:04:29Z")

</div>

I actually trying to automate the installation of discourse using Ansible, I followed the official guide to install discourse docker. I Successfully did all things remaining theme importing, I just want to run my ansible role on plan VM and then have docker/discourse installed, configured, admin activated, notification email sitted, and also theme imported.

---

<div class="post-metadata">

### Author: ![ahmed\_alamiry](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ahmed_alamiry/32/198190_2.png) [@ahmed\_alamiry](https://meta.discourse.org/u/ahmed_alamiry)
#### Post date: [2월 7, 2019, 1:11오후 UTC](https://meta.discourse.org/t/my-broken-discourse-install-prevents-theme-import/108657/14 "2019-02-07T13:11:20Z")

</div>

@david  
Thank you for your support, the wrapped up theme in a `.tar.gz` file works with me and it will be good enough for me to continue.

---

<div class="post-metadata">

### Author: ![ahmed\_alamiry](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ahmed_alamiry/32/198190_2.png) [@ahmed\_alamiry](https://meta.discourse.org/u/ahmed_alamiry)
#### Post date: [3월 4, 2019, 11:51오전 UTC](https://meta.discourse.org/t/my-broken-discourse-install-prevents-theme-import/108657/15 "2019-03-04T11:51:47Z")

</div>

@david  
one thing remaining ,  
is there any way to install theme.tar.gz from CLI (through rails or …).  
I used discourse theme cli to create may themes. and now I import theme.tar.gz through GUI.

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [3월 4, 2019, 12:01오후 UTC](https://meta.discourse.org/t/my-broken-discourse-install-prevents-theme-import/108657/16 "2019-03-04T12:01:04Z")

</div>

You could do it on the rails console. Take a look at the code for the theme importer to see how:

> <https://github.com/discourse/discourse/blob/main/app/controllers/admin/themes_controller.rb#L93>

To import a new theme, I think it would be as simple as

```ruby
RemoteTheme.update_tgz_theme("/path/to/theme.tar.gz", user: Discourse.system_user)

```

---

<div class="post-metadata">

### Author: ![ahmed\_alamiry](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ahmed_alamiry/32/198190_2.png) [@ahmed\_alamiry](https://meta.discourse.org/u/ahmed_alamiry)
#### Post date: [3월 4, 2019, 1:00오후 UTC](https://meta.discourse.org/t/my-broken-discourse-install-prevents-theme-import/108657/17 "2019-03-04T13:00:59Z")

</div>

@david Thanks a million

to whom looking to the same thing, to set the theme as default theme we can use `set_default!`

```ruby
s = RemoteTheme.update_tgz_theme( "/path/to/theme.tar.gz", user: Discourse.system_user)
s.set_default!

```

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [4월 3, 2019, 1:01오후 UTC](https://meta.discourse.org/t/my-broken-discourse-install-prevents-theme-import/108657/18 "2019-04-03T13:01:00Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
