Viewing Discourse in Garry's Mod


(Serfma) #1

This will be a weird bug report / help request. Posted it in the bug category as earlier versions of Discourse didn’t have this issue.

Garry’s Mod has a lua-based back-end to where you can create custom content for the game. I had a pop-up frame (it uses the Awesomium UI Engine) that would display my server’s rules thread to any new players that joined the server. This was back in Discourse 1.7. Now I’m using Discourse 1.8 and it appears to no longer work. The only debug info I can gather currently is:

[HTML] http://curiumgaming.com/assets/vendor-5a4802805cd79c222d41da2639...:1: Uncaught TypeError: Cannot assign to read only property '__esModule' of #<Object> [HTML] http://curiumgaming.com/assets/application-a334ffce2f4684a1e388b...:1: Uncaught ReferenceError: Handlebars is not defined [HTML] http://curiumgaming.com/:228: Uncaught TypeError: Object #<Object> has no method 'start'

So far the only page that will load is the 404 page:

Other than that it looks like so:

I’m hoping there’s a way to fix this, or if it’s possible to roll back to a version of Discourse that would work. If anyone could help, it would be greatly appreciated!


#2

For now, until the specialists find a solution you can go back to an older version of Discourse by using the commit of your choice. You’ll have to edit the app.yml file :

cd /var/discourse
nano containers/app.yml

Around the line 38 you’ll have :

  #version: tests-passed

Change it by :

  version: d143cde64306cfc990998e6230d34916f3af1dff

For this commit for example : Version bump to v1.7.8 · discourse/discourse@d143cde · GitHub

Save the app.yml file (with putty, CTRL+X > Y > Enter if I remember correctly), then rebuild Discourse by using :

git pull
./launcher rebuild app

And if the plugin is compatible with this specitic commit it should work.

If it doesn’t work, you’ll have to try a older version like the version 1.7.7, etc.

You’ll have to change this file in the future if you want the latest version of Discourse by using version: test-passed again.


(Jeff Atwood) #3

Going backwards does not work, the database schema has changed. You can only go forward not back.


(Rafael dos Santos Silva) #4

I believe that the embed browser of Garry Mod isn’t compatible with latest Discourse code.


(Felix Freiberger) #5

If you really, really, really want to go back, you can do so by restoring a backup taken before the upgrade. In that case, make sure to drop the database before bootstrapping the old version so the schema is reverted.

(But you don’t want to go back, because old versions will not get security fixes.)


(Serfma) #6

Correct. It did work with 1.7 of Discourse which is very recent.

Yeah just started out with 1.8 so no way to roll back now.


Ultimately, Garry’s Mod is getting an update from Awesomium to Chromium which does fix this issue and allows for the awesome features such as seeing a reply appear while sitting on the page. (whatever technical term you want to call it) It may be a few weeks months before it’s implemented, though a bummer, I just wanted to see if it was possible to find the root cause and see if it was possible to be resolved by then. :stuck_out_tongue:

EDIT: This update may come a lot later than I expect, so I may just bite the bullet and install an old 1.7 version and not update until Chromium gets implemented, unless someone has another idea.


(Serfma) #8

Oh man. I have both good and bad news.

The Good

Reverting to 1.6.10 as a last effort resulted in Discourse working in Awesomium. A change introduced to 1.7 causes the page to not load. Unsure of what that change is yet and will be taking a closer look (or attempt to) to find the culprit.

The Bad

I’m going to have to use Discourse 1.6.10 until either, A) Chromium is implemented into the live version of Garry’s Mod, or B) There is a workaround found for versions above 1.6.10 for my specific implementation. Not likely, but definitely worth the try as I like me some updates.

The Ugly

Having to resort to using 1.6.10 for the foreseeable future. :confused:


I’ll begin testing each beta release of 1.7.0 until it breaks, I’ll report back here with what I find. :slight_smile:


Another edit: Beta versions are failing bootstrap. This to be expected? I ask here because someone might be able to answer faster than I can debug and figure it out.


(Jeff Atwood) #9

Bootstrap is working fine for me, so it is probably something in your config.


(Serfma) #10

Hmm ok. The config is just standalone.yml copied with values modified and the usual things uncommented (such as smtp) that are commented out.

What’s the proper way of uninstalling discourse and installing an old version? Simply purging the /var/discourse/ folder? Unsure if docker needs to be purged too. Basically I followed the usual installation instructions, but throw the copied config file with version: to the commit I want, then ./launcher rebuild app.

Maybe the config file isn’t compat with older versions that I’m trying to build, or maybe missing something?


(Jeff Atwood) #11

As I already said it is impossible to downgrade.


(Serfma) #12

I mean coming from a clean install of Discourse. Starting from scratch, no downgrading.

EDIT:

I’ll be a little bit more useful and provide errors. It’s mini_racer that’s failing installation.

[code]
current directory:
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/mini_racer-0.1.3/ext/mini_racer_extension
make "DESTDIR="
compiling mini_racer_extension.cc
mini_racer_extension.cc:4:24: fatal error: include/v8.h: No such file or
directory
compilation terminated.
Makefile:206: recipe for target ‘mini_racer_extension.o’ failed
make: *** [mini_racer_extension.o] Error 1

make failed, exit code 2[/code]


(Sam Saffron) #13

I have no idea what version of Discourse you have this thing pointed out but its not latest, its not beta and its not stable.

mini_racer in stable at version 0.1.7

This is not a clean install.


(Serfma) #14

I’ve found that Discourse 1.6.10 is the last version that works and is viewable by in-game HTML panels. (Awesomium framework) I was wanting to test 1.7.0beta1 - 1.7.0beta10 to test where exactly (and what commit exactly) breaks things. By clean install, I mean purging all discourse-related files then cloning the repo again and choosing an earlier commit in case the database was located within the discourse tree. Was on the assumption that rebuilding wouldn’t clean everything out or something similar.

The issue I was having was trying to build the 1.7.0beta1 version of Discourse and having it fail at bootstrap, and that I wiped all previous installations in case that mattered.