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

Problems starting Juris-M on CircleCI #34

Open
retorquere opened this issue Sep 5, 2017 · 93 comments
Open

Problems starting Juris-M on CircleCI #34

retorquere opened this issue Sep 5, 2017 · 93 comments

Comments

@retorquere
Copy link

In the hopes that perhaps you've seen this before: I'm starting Juris-M / Zotero on CircleCI under xvfb using

/home/ubuntu/bin/jurism/jurism -P BBTZ5TEST -ZoteroDebugText > /tmp/circle-artifacts.3yDZtTV/zotero.log 2>&1

This works for Zotero (and locally on my Ubuntu system) but for Juris-M it only works locally; on CircleCI I am getting

(zotero:17271): GLib-GObject-CRITICAL **: g_object_ref: assertion 'object->ref_count > 0' failed

(zotero:17271): GLib-GObject-CRITICAL **: g_object_unref: assertion 'object->ref_count > 0' failed

(zotero:17271): GLib-GObject-CRITICAL **: g_object_ref: assertion 'object->ref_count > 0' failed

(zotero:17271): GLib-GObject-CRITICAL **: g_object_unref: assertion 'object->ref_count > 0' failed

(zotero:17271): GConf-WARNING **: Client failed to connect to the D-BUS daemon:
Address does not contain a colon

(zotero:17271): Gdk-WARNING **: zotero: Fatal IO error 11 (Resource temporarily unavailable) on X server :100.

this is the totality of the log. All the lines except the last one are also in the zotero-generated log, so I'm guessing it's that last line that does it, but a bit of googling around yields the conclusion "something's wrong" ☹️ There's a lot more chatter in the Zotero log before the Client failed to connect to the D-BUS daemon: Address does not contain a colon if that matters.

I can give you access to a session on circleci by ssh if that's helpful.

@fbennett
Copy link

fbennett commented Sep 5, 2017

First encounter. Sounds like it must be a result of my crappy code formatting. Hmm.

@retorquere
Copy link
Author

First difference spotted (how relevant it is I don't know): my system is Ubuntu 17.04, CircleCI is Ubuntu 14.04.4 LTS.

@retorquere
Copy link
Author

Probably relevant (since I use the headless gem), but not very helpful: leonid-shevtsov/headless#68

@duncdrum
Copy link

@fbennet, @retorquere so what would be helpful here trying to update BBL's circle config so it runs your test again, making Jurism travis build fail… ?

I'm happy to throw some time at it, since this is becoming a pretty big problem for me. Just point me in the right direction.

@retorquere
Copy link
Author

retorquere commented Jan 21, 2018

I don't know what could be changed on the BBT side; Zotero 5 launches without issue. If the xvfb issue is the problem, maybe a backport for 14.04 LTS exists (14.04 uses 2:1.15.1, 17.10 has 2:1.19.5), but since it's a minor release of xvfb, it's not immediately obvious that that would be the problem.

Another option would be to move BBTs testing to the docker-based circle2.0 infrastructure, which has a lot more freedom in putting together the environment, but I don't currently have the time to dive in. Circle offers a migration guide but it's not a 10-minute job (I tried). This would be the most attractive option for me since I'd have to do this at some point anyhow.

That's all assuming it's something solely on the BBT side though. Launching under xvfb is a necessity for my tests. xvfb could in principle be replaced with xtightvnc, which has a headless mode, or Xdummy, but I haven't tried. The selenium crew has docker images which come with vnc set up, but I haven't looked at them.

@duncdrum
Copy link

duncdrum commented Jan 21, 2018

That's all assuming it's something solely on the BBT side though.

I m not ruling out a bug in jurism, but given that you were able to run on local, I would like to either a) get a better description of the actual problem from circle, or b) get the tests that are there to be consistent between your local and circle.

Another option would be to move BBTs testing to the docker-based circle2.0 infrastructure,

That was my initial thought as well. I normally use travis, so this will take some learning time, but I ll see what I can do.

@retorquere
Copy link
Author

It's not hard to get into the error environment in circle. Clone the repo, activate circle, make sure to select 4 (free) containers for your project, and you'd be ready to go. The Juris-M tests run in containers 3 and 4. You can ssh into your containers to play around with the environment.

@duncdrum
Copy link

duncdrum commented Jan 21, 2018

Progress TravisCI node 52:

 ✖ [FAIL] should open a group and show top-level collections
      AssertionError: expected 68 to be false at
            @resource://zotero-unit-tests/collectionTreeViewTest.js:159:4
            tryCatcher@resource://gre/modules/commonjs/toolkit/loader.js -> resource://zotero/bluebird/util.js:16:16
            module.exports/Promise.prototype._settlePromiseFromHandler@resource://gre/modules/commonjs/toolkit/loader.js -> resource://zotero/bluebird/promise.js:512:13
… 
(firefox:6996): GLib-GObject-CRITICAL **: g_object_ref: assertion 'object->ref_count > 0' failed
(firefox:6996): GLib-GObject-CRITICAL **: g_object_unref: assertion 'object->ref_count > 0' failed
(firefox:6996): GLib-GObject-CRITICAL **: g_object_ref: assertion 'object->ref_count > 0' failed
(firefox:6996): GLib-GObject-CRITICAL **: g_object_unref: assertion 'object->ref_count > 0' failed
The command "test/runtests.sh -x firefox/firefox -f" exited with 1.

node 54 runs fine though

@retorquere
Copy link
Author

I have no issue against going with Travis, but the reason I moved from Travis (where I ran my tests initially) to CircleCI is that CircleCI allowed me to split my tests into chunks each running in a separate container (which made total run time for my tests a lot less) but would wait for all tests to have ran before entering the release phase, and would only run the release phase when all containers ran green (I believe Circle calls this fan-in / fan-out). All sorts of workarounds exist for Travis, but CircleCI just does it out of the box.

@duncdrum
Copy link

duncdrum commented Jan 21, 2018

@retorquere this is from running jurism own test suite, not bbl. If you have a few minutes maybe we can chat (seems more efficient). This looks very fixable to me.

Alternatively, could you run your test using node 9.4.0 instead of 8.9.4? The error seems specific to Firefox ≤ 52, which matches my experience with FF-ESR breaking a few days ago.

@retorquere
Copy link
Author

Sure, where do you want to chat?

Tests on 9.4.0 are running.

@duncdrum
Copy link

how about skype?

@retorquere
Copy link
Author

Sure

@retorquere
Copy link
Author

All tests pass on 9.4.0 (unsurprisingly, really, as I really only use it for webpack as far as the BBT code is concerned).

@duncdrum
Copy link

duncdrum commented Jan 21, 2018

Here is a link to the travis log for the failed jurism build, however, the same errors that BBL reports on circle are present in the standard Zotero/zotero builds??

@duncdrum
Copy link

duncdrum commented Jan 21, 2018

So I ve done some more poking around, and while my travis builds are passing now, circle still isn't. The first leads seem to have all been red herrings. The same errors from the zotero.log on circle for jurism are also in the regular zotero builds, including:

(zotero:18037): GConf-WARNING **: Client failed to connect to the D-BUS daemon:

But they don't cause it to fail 😖 . I ll poke the debug-bridge and the add-on installation process to see if something pops up.

@retorquere
Copy link
Author

That doesn't cause the build to fail for me either. It's the last line. I'm trying to get Xdummy or x11vnc to work, but my test harness uses a ruby gem to set up the headless env, and I haven't yet found a replacement. Assuming that xvfb is at fault at all.

@retorquere
Copy link
Author

I've tried the circle 1.0 -> 2.0 migration service and that currently fails on "mkdir: not found".

@duncdrum
Copy link

duncdrum commented Jan 22, 2018

I keep running into errors related to the installation of addons. Because there are almost 300 commits upstream in zotero, debugging this from Jurism is rather challenging. I have a rebased fork that seems 90% there, but currently fails:

516630714074	addons.xpi	WARN	Error parsing extensions state: [Exception... "Component returned failure code: 0x80520012 (NS_ERROR_FILE_NOT_FOUND) [amIAddonManagerStartup.readStartupData]"  nsresult: "0x80520012 (NS_ERROR_FILE_NOT_FOUND)"  location: "JS frame :: resource://gre/modules/addons/XPIProvider.jsm :: loadExtensionState :: line 1554"  data: no] Stack trace: loadExtensionState()@resource://gre/modules/addons/XPIProvider.jsm:1554 < getInstallState()@resource://gre/modules/addons/XPIProvider.jsm:1589 < checkForChanges()@resource://gre/modules/addons/XPIProvider.jsm:3109 < startup()@resource://gre/modules/addons/XPIProvider.jsm:2188 < callProvider()@resource://gre/modules/AddonManager.jsm:269 < _startProvider()@resource://gre/modules/AddonManager.jsm:739 < startup()@resource://gre/modules/AddonManager.jsm:906 < startup()@resource://gre/modules/AddonManager.jsm:3090 < observe()@jar:file:///usr/local/firefox-56.0.2/omni.ja!/components/addonManager.js:65
1516630714334	addons.xpi	WARN	Add-on [email protected] is not correctly signed.
1516630714334	addons.xpi	WARN	Add-on [email protected] is not correctly signed.
1516630714335	addons.xpi	WARN	Add-on [email protected] is not correctly signed.
1516630714369	addons.xpi	WARN	Add-on [email protected] is not correctly signed.
1516630714369	addons.xpi	WARN	Add-on [email protected] is not correctly signed.
1516630714370	addons.xpi	WARN	Add-on [email protected] is not correctly signed.

@fbennett is there something special about how jurism interacts with zotero-addons? Could you maybe chime in on how you normally go about incorprating upstream changes?

@retorquere
Copy link
Author

How are addons installed during tests? Selenium handles installation for me.

@fbennett
Copy link

The Circle-CI tests are against the core JM code, yes? Nothing special that I can think of.

@retorquere
Copy link
Author

My circle tests just download the latest Juris-M (or zotero), manipulate the profile using selenium to install the plugins, and then start Juris-M (or zotero). This runs under xvfb. There's no difference between my zotero tests and my Juris-M tests other than that they download the one or the other.

@retorquere
Copy link
Author

But I'll have to spend time on migrating my circle tests to circle 2.0 anyhow before the summer, because circle 1.0 is being phased out. Maybe that makes a difference.

@fbennett
Copy link

fbennett commented Mar 1, 2018

Only a couple of potential things come to mind. Juris-M is a bit slower on some operations, and I extended some of the timeouts on the Z tests in the JM fork. The other thing is that, in order to support the Abbreviation Filter, I've had to run the processor in a coroutine, which forced me to promisify parent functions up the chain to its root in the UI.

AF is a central component of JM, so the promisification there will stay. I'm pretty sure that Dan does not intend to go there with Zotero (he hasn't responded to my mentions of the issue), so I'll be removing AF from the list of Zotero plugins shortly.

@retorquere
Copy link
Author

Progress, of a kind. I'm a good way through porting from CircleCI 1.0 to 2.0, and Zotero also doesn't start in the 2.0 environment 🙄. Considering ditching CircleCI, looking into alternatives.

@fbennett
Copy link

fbennett commented Mar 3, 2018

Both Zotero and Juris-M fail tests intermittently in Travis-CI, although everything passes locally. Dan says it's due to race conditions that are hard to control in that environment.

@retorquere
Copy link
Author

The problem I'm seeing is unlikely to be caused by race conditions, but race conditions are structural problems. They may be more or less likely to be triggered in some environments, but the environment is not the cause of them.

@retorquere
Copy link
Author

It it correct that Juris-M has its profiles.ini in ~/.jurism/zotero/profiles.ini, not ~/.jurism/jurism/profiles.ini?

@retorquere
Copy link
Author

(I think this is different from the 4 series, and it could be this is really all that there's too it. I can test further tonight). Zotero runs again.

@fbennett
Copy link

In the light of morning, I've gone through the Zotero PHP scripts that handle update/download negotiation, and both respond to the call with a Location (not Content-Location) header -- a external redirect to a public URL. I'm pretty sure that parking update assets on a GitHub release will be a winner.

Looking forward to getting that set up.

@fbennett
Copy link

Actually, that description isn't quite correct. Download requests (to dl.php) receive a Location header. Update requests (to update.php) receive an XML object that embeds the URL to be used by the client to obtain the update. So again an external redirect, in effect.

@fbennett
Copy link

fbennett commented Mar 26, 2018

remember that you'll have to host update.rdf in two locations for a while.

Ha. I wish. We're currently staggering along without automatic updates for the client in Juris-M, so it's an open field. As I ease into the thought of it, GitHub releases do look attractive. Apart from the speed advantage, I'm a short few years away from retirement, and continued access to University infrastructure isn't guaranteed. So the more stuff I can move to robust, free-of-fees external infrastructure, the better.

@retorquere
Copy link
Author

I've set it up so it's almost entirely free

  • Github for version control
  • Travis for CI (use CircleCI for a long while but it looks like they'll be imposing quota for free projects)
  • GIthub for binary hosting (although sourceforge would have been easier, just scp uploads)
  • S3 for debug log capturing

Although S3 is not free, last month I got my first-ever bill for it, a whopping $0.14, because I was experimenting with a new way to capture the logs, and I used it a lot. I have S3 set up to auto-delete logs after a week to prevent cost run-up for storage.

@retorquere
Copy link
Author

Has -datadir profile made it to Juris-M in the new release?

@fbennett
Copy link

Is that this commit? zotero/zotero-standalone-build@528162e

@retorquere
Copy link
Author

Hmm, looks like it did make it. For Juris-M I patch up the prefs.js as part of my tests to set extensions.zotero.dataDir and extensions.zotero.useDataDir so that I have a known location to work with; for Zotero I just pass -datadir profile. The reason I was thinking of this was that I had removed the workaround and now Juris-M doesn't start in Travis... but I think I've re-applied the workaround and it still doesn't start.

More debugging. Good that we have a long weekend ahead.

@retorquere
Copy link
Author

I've made some progress -- there were at least two issues with starting:

  • Juris-M needs two extra packages installed (default-jre and libreoffice-java-common) and doesn't start through until you click the conformation. Is this new? I don't recall seeing this, but then I do usually use a pre-filled profile that may include preferences that suppress this popup
  • Juris-M does not like it if I remove the stock BibTeX/BibLaTeX translators, which I do as part of my tests to make sure my tests are not falling back to them if the BBT translators error out. I don't remove them for my Juris-M tests now

Still, the initialization is stuck at https://file.io/rT4FRi for some reason inside Travis. On desktop, it starts normally of course 🙄 .

@retorquere
Copy link
Author

Got it! Travis does not make this easy to diagnose. In this case, I was trying to change too many things at once -- the deadly combo was that I have a dataDir set in my starter profile that I use for more efficient startup, and that was OK, because I overwrote it on test start anyhow. Now I started using -datadir profile, but also still had a dataDir set... to something on my local system where I created the starter profile.

Nice.

In any case, I want to create a new starter profile (come to think of it, I may just be able to use the same starter profile for Zotero and Juris-M since Juris-M probably upgrades the profile as it starts. Anhow), but for safety (so I don't accidentally clobber my own research DB as I'm testing on the same system) I create files names ~/Zotero and ~/Juris-M to prevent either from creating a datadir there. This should work when -datadir profile is passed on the command line, and it does for Zotero, but Juris-M throws up an error when I do this, so it looks like it's still accessing ~/Juris-M even when I pass -datadir profile. Not a major problem in any way, just wanted to report back.

@retorquere
Copy link
Author

Ah and Juris-M still does not seem to tolerate me removing BibTeX.js and BibLaTeX.js.

@fbennett
Copy link

fbennett commented Apr 19, 2019 via email

@fbennett fbennett reopened this Apr 19, 2019
@retorquere
Copy link
Author

Starting with -P -datadir profile, with ~/Juris-M a text file and no ~/.jurism:
error
locks

@retorquere
Copy link
Author

WRT the removed translators, Juris-M is apparently cool with this... looks to just work. Must be fallout from the botched profile I had. Sorry.

I've also seen Juris-M create ~/Juris-M Homedir Lock and stores the files there after I create a new profile Homedir Lock and starting Juris-M with -P -datadir profile, but I've not been able to replicate this... I don't think you should give too much weight on this TBH... you know I'm starting Zotero/Juris-M in weird ways by manipulating profiles. I'll get a from-scratch profile over the weekend and start with this. Can't right now because I only have remote desktop access to a linux box from a mac and it doesn't work really fluently. Better to be back at the linux box itself.

Sorry for all the noise.

@fbennett
Copy link

No worries, if I'm busy at this end I always have the option of quietly ignoring things. The error you posted seemed to be rooted in Myles, which is a plugin that draws on files in a git subproject/subdirectory. You're pulling with --recursive?

@retorquere
Copy link
Author

I'm not pulling anything, BBT tests simply install the latest Juris-M (or Zotero) binaries, create a profile and install BBT in the profile, and run tests by triggering internal APIs. Is Myles bundled with Juris-M (I I think I saw ODF-Scan was bundled)? I don't install any plugins into the profile other than BBT and the debug bridge I use to drive the tests.

@retorquere
Copy link
Author

(this is all on Linux, I should have mentioned this)

So what I've just tried is this:

Start with -datadir profile

  • start with -datadir profile (but no ~/Juris-M or ~/.jurism present) and let it created a new profile. ~/Juris-M is created.

Start normally and try to move to -datadir profile

  • start without any parameters (and no ~/Juris-M or ~/.jurism present) and let it created a new profile
  • quit jurism and mv ~/Juris-M ~/.jurism/<profile name>/jurism (also tried ~/.jurism/<profile name>/zotero
  • start jurism with -P -datadir profile. I pick the profile, ~/Juris-M is created again.

@retorquere
Copy link
Author

I mean my tests run on Travis so I'm happy but it makes it tricky to run local tests as I rely heavily on the datadir being contained to the test; on Travis this is not an issue as I'm starting with a clean machine in any case.

@lsaintamand
Copy link

Myles is a bundled plugin, yes. Maybe something needs to be done to make it -datadir - aware in your setup? Is the -datadir argument a change from your previous installs? It may be looking in the wrong place for its support files.

@lsaintamand
Copy link

Where exactly do you use that argument? With a staging build, running ./jurism -datadir ~/MyProfileDir, I get my normal library (in a custom location). Not sure what your setup is or what it's trying to do.

@lsaintamand
Copy link

(ah - the odd moniker may be confusing - I'm apparently in the account of my RA, we set up an account this PM. Frank Bennett here.)

@retorquere
Copy link
Author

It's a change from previous tests -- previously I would set dataDir and useDataDir specifically for Juris-M and not use -datadir profile in the Juris-M variant of my tests. There's a few places where I do Juris-M specific things; the starter profiles are seperate, then started in their own ways as outlined here, and then there are a few exports that have Juris-M-specific output matching because Juris-M offers something different to the translator than Zotero does. but by and large, my test suite runs the same tests for each, and expects (and gets) the same output from each.

Your accountant uses github? I must have a talk with mine. She needs to up her game evidently.

@fbennett
Copy link

(the Internet has not been kind to abbreviations: research assistant)

@fbennett
Copy link

fbennett commented Apr 19, 2019

Looks like Jurism is not honoring a -datadir <profile> argument. Will look at that tomorrow.

@retorquere
Copy link
Author

Ooh, I should get me one of those!

(who am I kidding. I strive to be one of those).

@fbennett
Copy link

An unusual circumstance here as well. Will check up on -datadir tomorrow.

@fbennett
Copy link

Playing with this, it looks like the -datadir argument has no effect. A few data points:

  • Running ./jurism --help does not show the option.
  • (OTOH running ./zotero --help from one of the 5.0.66 betas that I have here does not show the option either.)
  • When run with my default profile, it uses the database in my custom location.
  • When run with another profile, it seems to be using the default ~/Juris-M data directory. I think.
  • No database file turns up in the profile directories when an alternative profile is run with -datadir profile.
  • The command-line handler does not throw and error when -datadir is given a relative path, which seems to be what zotero-service.js would do if it reached the option.
  • The code in components/zotero-service.js is closely aligned with Zotero. The small differences are unrelated to command-line handling.
  • The code in chrome/content/zotero/xpcom/dataDirectory.js is byte-for-byte identical in Jurism and Zotero, and hasn't changed since sometime in 2018.

When I fire up ./jurism in a fresh profile under Linux, it immediately prompts for installation of the LibreOffice plugin. That's presumably where the dependencies you mentioned are coming from. I don't know whether Zotero does the same, but I haven't changed anything to make it happen.

So ... yeah. That all pretty much confirms the behavior that you outlined above.

I'm not clear on what the expected behavior is, though. What setup/options are you using for Zotero, and what exactly differs between the behavior of Zotero and Jurism?

@retorquere
Copy link
Author

Well.. Usually, I'm creating a new profile by manipulating profiles.ini, including an absolute path (outside the regular ~/. jurism / ~/. zotero directory) and moving an existing profile snapshot there. For zotero that suffices because when I use -datadir profile it will use the zotero directory it finds there. For Juris-M I do the same, but also set dataDir to the jurism directory in it, and set useDataDir to true. That's really the only thing, and effectively it does the same for the duration of my tests. I just thought I could get rid of the extra step for jurism, but it's not onerous for my tests. It is a little tricky for local use - I have datadir profile in the launch shortcut so that I know I won't clobber my actual research data.

@retorquere
Copy link
Author

(I want to stress that my use of these things is atypical. I don't even know it anyone besides me uses datadir profile)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants