Jump to content
McKay Development

Path must be a string. Received undefined when running with supervisor


wujek_kane

Recommended Posts

Hello,

I have an issue with deploying application using Steam-user on my server. I had to change dataDirectory (same as module using Steam-user).

If I run my app as www-data it works just fine. However I need it to run all the time, so I'm using Ajenti with supervisor (as www-data user).

It throws an error:

path.js:8
    throw new TypeError('Path must be a string. Received ' +
    ^

TypeError: Path must be a string. Received undefined
    at assertPath (path.js:8:11)
    at Object.posix.join (path.js:479:5)
    at userData (/srv/APP_DIRECTORY/node_modules/steam-user/node_modules/ap$
    at Object.AppDirectory._setTemplates (/srv/APP_DIRECTORY/node_modules/s$
    at Object.AppDirectory (/srv/APP_DIRECTORY/node_modules/steam-user/node$
    at new SteamUser (/srv/APP_DIRECTORY/node_modules/steam-user/index.js:6$
    at Object.<anonymous> (/srv/APP_DIRECTORY/bot/index.js:16:14)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (/srv/APP_DIRECTORY/routers/index.js:6:7)

it refers to:


var client = new SteamUser({
	dataDirectory: "/srv/APP_DIRECTORY/bot"
});

(also everything works ok when I remove bot module)

 

 

The issue seems to be only when running script with supervisor. I really need to get it up and running, so big thanks in advance!

 

Also BIG, BIG thanks to Dr. McKay for awesome set of tools to deal with this whole Steam madness! :)

 

 

Link to comment
Share on other sites

Guess I'm not too good at copy-pasting ;)​


path.js:8
    throw new TypeError('Path must be a string. Received ' +
    ^

TypeError: Path must be a string. Received undefined
    at assertPath (path.js:8:11)
    at Object.posix.join (path.js:479:5)
    at userData (/srv/APP_DIRECTORY/node_modules/steam-user/node_modules/appdirectory/lib/appdirectory.js:21:29)
    at Object.AppDirectory._setTemplates (/srv/APP_DIRECTORY/node_modules/steam-user/node_modules/appdirectory/lib/appdirectory.js:134:34)
    at Object.AppDirectory (/srv/APP_DIRECTORY/node_modules/steam-user/node_modules/appdirectory/lib/appdirectory.js:129:10)
    at new SteamUser (/srv/APP_DIRECTORY/node_modules/steam-user/index.js:62:15)
    at Object.<anonymous> (/srv/APP_DIRECTORY/bot/index.js:16:14)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (/srv/APP_DIRECTORY/routers/index.js:6:7)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)
path.js:8
    throw new TypeError('Path must be a string. Received ' +
    ^

I had to replace directory name with APP_DIRECTORY since it contains domain name and it has to remain hidden before it's live, sorry! :)

Link to comment
Share on other sites

I just updated steam-user to 3.7.2 and it doesn't seem to make any difference regarding that bug :/ I've experimented with dataDirectory a bit, tried null as well. Does not seem to make any difference.

path.js:8
    throw new TypeError('Path must be a string. Received ' +
    ^

TypeError: Path must be a string. Received undefined
    at assertPath (path.js:8:11)
    at Object.posix.join (path.js:479:5)
    at userData (/srv/APP_DIR/node_modules/steam-user/node_modules/appdirectory/lib/appdirectory.js:21:29)
    at Object.AppDirectory._setTemplates (/srv/APP_DIR/node_modules/steam-user/node_modules/appdirectory/lib/appdirectory.js:134:34)
    at Object.AppDirectory (/srv/APP_DIR/node_modules/steam-user/node_modules/appdirectory/lib/appdirectory.js:129:10)
    at new SteamUser (/srv/APP_DIR/node_modules/steam-user/index.js:64:15)
    at Object.<anonymous> (/srv/APP_DIR/bot/index.js:16:14)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (/srv/APP_DIR/routers/index.js:6:7)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)
path.js:8
    throw new TypeError('Path must be a string. Received ' +
    ^

Also, application entry point is index.js, and it includes "Bot" module in bot subdirectory. Require is however in routers/index.js.

Does it matter?

Link to comment
Share on other sites

Had to revert dataDirectory to "/", but it works now!!!! Thank you Sir, you're my personal hero! :)

 

I don't think, I'd ever managed to harness this Steam madness without your amazing tools.

Two factor authorization, generating codes, inventory, trades, some general hints with Steam bull****... You got it all covered!

 

Perhaps, the documentation needs a tiny *tiny* bit of love, to be 100% clear for noobs like me.

 

Anyway, please let me know, if there's anything I could volunteer to do in order to support your AMAZING job.

 

Also I'd like to know if you accept donations? I'd be honored to reward you for your help, when I'm done with this project. :)

Link to comment
Share on other sites

What version of steam-user do you have?

 

Edit: Okay, I found the problem. It's because you don't have a HOME environment variable. I'll push out a fix shortly.

 

I even posted that bug long time ago and you told me to report to appdirectory github repo. smh

Link to comment
Share on other sites

  • 1 year later...

Sorry for necroposting, but I have same issue with steam-tradeoffer-manager 2.9.2 (nodejs 8), when bots starts from rc.local

path.js:28
    throw new TypeError('Path must be a string. Received ' + inspect(path));
    ^

TypeError: Path must be a string. Received undefined
    at assertPath (path.js:28:11)
    at Object.join (path.js:1251:7)
    at userData (/var/jc/node/bots_refactor/node_modules/appdirectory/lib/appdirectory.js:21:29)
    at AppDirectory._setTemplates (/var/jc/node/bots_refactor/node_modules/appdirectory/lib/appdirectory.js:134:34)
    at new AppDirectory (/var/jc/node/bots_refactor/node_modules/appdirectory/lib/appdirectory.js:129:10)
    at new TradeOfferManager (/var/jc/node/bots_refactor/node_modules/steam-tradeoffer-manager/lib/index.js:56:29)
    at new BotManager (/var/jc/node/bots_refactor/lib/BotManager.js:56:15)
    at start (/var/jc/node/bots_refactor/bot_start.js:38:24)
    at Object.<anonymous> (/var/jc/node/bots_refactor/starters/bot_3.js:2:40)
    at Module._compile (module.js:635:30)
Edited by IvanVodka
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...