mtgjson / mtgjson3

MTGJSON repository for Magic Cards

Home Page:http://mtgjson.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

node util/updateFromPromoPrinintgs.js dies with `OpenError: IO error: lock /path/to/mtgjson/cache/LOCK: Resource temporarily unavailable`

bakert opened this issue · comments

I'm trying to rebuild promos to get the Sultai Ascedancy fix for #437 in.

Following the Updating Promos Instructions from howto.txt everything goes swimmingly until

[gaghalfrunt mtgjson] node util/updateFromPromoPrinintgs.js 
info:    Loading promo sets...
info:    Parsing promo sets...
info:    Iterating over promo set cards...
info:    Saving promo sets...
info:    info:    Processing set: ATH

error:   
events.js:137
      throw er; // Unhandled 'error' event
      ^
OpenError: IO error: lock /Users/bakert/mtgjson/cache/LOCK: Resource temporarily unavailable
    at /Users/bakert/mtgjson/node_modules/levelup/lib/levelup.js:117:34
    at /Users/bakert/mtgjson/node_modules/abstract-leveldown/abstract-leveldown.js:39:16

error:    Error: Command failed: node /Users/bakert/mtgjson/util/updatePrintingsFromSet.js mcisets

events.js:137
      throw er; // Unhandled 'error' event
      ^
OpenError: IO error: lock /Users/bakert/mtgjson/cache/LOCK: Resource temporarily unavailable
    at /Users/bakert/mtgjson/node_modules/levelup/lib/levelup.js:117:34
    at /Users/bakert/mtgjson/node_modules/abstract-leveldown/abstract-leveldown.js:39:16

    at ChildProcess.exithandler (child_process.js:272:12)
    at ChildProcess.emit (events.js:160:13)
    at maybeClose (internal/child_process.js:943:16)
    at Socket.stream.socket.on (internal/child_process.js:363:11)
    at Socket.emit (events.js:160:13)
    at Pipe._handle.close [as _onclose] (net.js:562:12)

I'm not quite sure what I'm being told here. Does anyone recognize it or have a hint for me? I'll keep digging …

There's actually a typo in the next step node util/updateNonGathererSets.js dating from 2017 so I guess this code has bitrotted away to some degree.

Is there a better/new way to update promos or have we just not done it for a while?

[gaghalfrunt mtgjson] node util/updateNonGathererSets.js
info: Updating non-gatherer sets...
error: error:    TypeError: async.eachSeriea is not a function
    at Function.loadAllSets (/Users/bakert/mtgjson/build/createNonGathererSet.js:179:19)
    at next (/Users/bakert/mtgjson/node_modules/tiptoe/index.js:53:21)
    at tiptoe (/Users/bakert/mtgjson/node_modules/tiptoe/index.js:122:2)
    at getMultiverseidsForSet (/Users/bakert/mtgjson/build/createNonGathererSet.js:166:5)
    at Function.getTargetMultiverseids (/Users/bakert/mtgjson/build/createNonGathererSet.js:32:9)
    at next (/Users/bakert/mtgjson/node_modules/tiptoe/index.js:53:21)
    at tiptoe (/Users/bakert/mtgjson/node_modules/tiptoe/index.js:122:2)
    at Object.<anonymous> (/Users/bakert/mtgjson/build/createNonGathererSet.js:29:1)
    at Module._compile (module.js:660:30)
    at Object.Module._extensions..js (module.js:671:10)

error:  Error: Command failed: node /Users/bakert/mtgjson/build/createNonGathererSet.js ATH
error:    TypeError: async.eachSeriea is not a function
    at Function.loadAllSets (/Users/bakert/mtgjson/build/createNonGathererSet.js:179:19)
    at next (/Users/bakert/mtgjson/node_modules/tiptoe/index.js:53:21)
    at tiptoe (/Users/bakert/mtgjson/node_modules/tiptoe/index.js:122:2)
    at getMultiverseidsForSet (/Users/bakert/mtgjson/build/createNonGathererSet.js:166:5)
    at Function.getTargetMultiverseids (/Users/bakert/mtgjson/build/createNonGathererSet.js:32:9)
    at next (/Users/bakert/mtgjson/node_modules/tiptoe/index.js:53:21)
    at tiptoe (/Users/bakert/mtgjson/node_modules/tiptoe/index.js:122:2)
    at Object.<anonymous> (/Users/bakert/mtgjson/build/createNonGathererSet.js:29:1)
    at Module._compile (module.js:660:30)
    at Object.Module._extensions..js (module.js:671:10)

    at ChildProcess.exithandler (child_process.js:272:12)
    at ChildProcess.emit (events.js:160:13)
    at maybeClose (internal/child_process.js:943:16)
    at Socket.stream.socket.on (internal/child_process.js:363:11)
    at Socket.emit (events.js:160:13)
    at Pipe._handle.close [as _onclose] (net.js:562:12)

Guilty commit is 2dc8f98 from 2017-11-13 @gwax - tagging not for shame but because you might know what's going on above :D

I'll fix the typo.

Oh, note that the LOCK file is present and gets recreated if I delete it, so this isn't as simple as needing write permissions but something like that might be in play.

Honestly, the process for updating the program is really hacky. I'd love to see a full re-write of this service, but until that happens we'll be stuck with such

I don't mind hacky (or at least I'm not going to object!) but I can't progress here. I am at a loss.

Does this work on your machine or does it do the same? It would be easier to investigate if I know if it's a code issue or an environmental one.

commented

Interesting, I didn't even realize howto.txt had instructions missing from the wiki page. I will try and see if it works for me.

No longer relevant with V4, as we don't use node