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

Node error when running Python agent #131

Open
jwood803 opened this issue Aug 29, 2021 · 18 comments
Open

Node error when running Python agent #131

jwood803 opened this issue Aug 29, 2021 · 18 comments
Labels

Comments

@jwood803
Copy link

After initial installations, when I try to run the node command to run the Python agent, I seem to get this error:

UnhandledPromiseRejectionWarning: Error: EPERM: operation not permitted, unlink 
'C:\Users\jw\Downloads\simple.tar\simple\errorlogs\match_rbTjSvgatNxY\agent_0.log'

Restarted to see if another process had a handle on that location, but I still get the same error.

Node version is 14.17.5
Python version is 3.6.12 :: Anaconda custom (64-bit)

If any other logging is needed, just let me know.

@StoneT2000
Copy link
Member

This is likely a quirk of the CLI tool on windows systems. This is usually not a issue though. Did a replay file still generate?

@jwood803
Copy link
Author

It didn't. The folder generated in the "errorlogs" folder, but that was also empty.

@StoneT2000
Copy link
Member

Is this powershell or command prompt?

@jwood803
Copy link
Author

It's happening with both, actually.

@StoneT2000
Copy link
Member

StoneT2000 commented Sep 1, 2021

Can you try running the command but specify --out=replay.json as an argument? replay.json should pop up in the directory

@xarthurx
Copy link

xarthurx commented Sep 1, 2021

-=-=-=-=-=-=-=-=-=-=-=-| [INFO] match_KPRHIS4oBObW |-=-=-=-=-=-=-=-=-=-=-=-

[INFO] (match_KPRHIS4oBObW) - Design: lux_ai_2021 | Initializing match - ID: KPRHIS4oBObW, Name: match_KPRHIS4oBObW
{
  ranks: [
    { rank: 1, agentID: 0, name: 'main.py' },
    { rank: 1, agentID: 1, name: 'main.py' }
  ],
  replayFile: 'replay.json',
  seed: 452970908
}
(node:24548) UnhandledPromiseRejectionWarning: Error: EPERM: operation not permitted, unlink 'C:\Users\xarthur\source\repos\lux\simple\errorlogs\match_KPRHIS4oBObW\agent_0.log'
(Use `node --trace-warnings ...` to show where the warning was created)
(node:24548) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:24548) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Full cmd output is here.
The reply.json did get generated, thought I'm not sure if that's the correct one. The two bot from main.py just walk back and forth between two tiles (default main.py).

@StoneT2000
Copy link
Member

Yeah that's the default bot. Looks like it's working then. For now ignore the unlink bug

@jwood803
Copy link
Author

jwood803 commented Sep 1, 2021

Can you try running the command but specify --out=replay.json as an argument? replay.json should pop up in the directory

Ran it again in Powershell. It doesn't seem to create the replay, though.

PS C:\Users\jw\Downloads\simple.tar\simple> lux-ai-2021 main.py main.py --out=replay.json
>>

-=-=-=-=-=-=-=-=-=-=-=-| [INFO] match_3mSFqQapxOsj |-=-=-=-=-=-=-=-=-=-=-=-

[INFO] (match_3mSFqQapxOsj) - Design: lux_ai_2021 | Initializing match - ID: 3mSFqQapxOsj, Name: match_3mSFqQapxOsj
{
  ranks: [
    { rank: 1, agentID: 0, name: 'main.py' },
    { rank: 2, agentID: 1, name: 'main.py' }
  ],
  replayFile: 'replay.json',
  seed: 220065719
}
(node:7836) UnhandledPromiseRejectionWarning: Error: EPERM: operation not permitted, unlink 'C:\Users\jw\Downloads\simple.tar\simple\errorlogs\match_3mSFqQapxOsj\agent_0.log'
(Use `node --trace-warnings ...` to show where the warning was created)
(node:7836) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:7836) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

However, it may just be me having this issue, so I'll keep messing around with it to see if I can generate the replay. Thanks for all the advice!

@StoneT2000
Copy link
Member

For now, you can stick to using kaggle-environments or use WSL and the CLI tool or use the docker cli tool.

@Nosferican
Copy link

Nosferican commented Oct 5, 2021

Same behavior here on Windows as well.
I tried running it w/my Mac... It requires sudo but looking at the replays, all commands are empty.
Tried using the Docker image and everything worked. I guess the recommendation should be to just use the Docker image.

@aaronhance
Copy link

aaronhance commented Oct 13, 2021

Same issue here Win10 tried lots of different things, file permissions, run as admin, different npm versions, clearing npm cache, closing applications, restarting and various combinations of them. Similar issue on latest Ubuntu + node.

@StoneT2000
Copy link
Member

And on ubuntu? What's your output when running on ubuntu

@aaronhance
Copy link

aaronhance commented Oct 13, 2021

And on ubuntu? What's your output when running on ubuntu

On install.

`npm ERR! code EACCES

npm ERR! syscall access
npm ERR! path /usr/local/lib
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, access '/usr/local/lib'
npm ERR! [Error: EACCES: permission denied, access '/usr/local/lib'] {
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'access',
npm ERR! path: '/usr/local/lib'
npm ERR! }
npm ERR! `

When run as root.

`> node-gyp rebuild

2021/10/13 23:18:45.728243 cmd_run.go:1002: WARNING: cannot create user data directory: cannot create "/nonexistent/snap/node/5322": mkdir /nonexistent: permission denied
cannot create user data directory: /nonexistent/snap/node/5322: Permission denied

[email protected] install /usr/local/lib/node_modules/@lux-ai/2021-challenge/node_modules/ssh2
node install.js

2021/10/13 23:18:45.922920 cmd_run.go:1002: WARNING: cannot create user data directory: cannot create "/nonexistent/snap/node/5322": mkdir /nonexistent: permission denied
cannot create user data directory: /nonexistent/snap/node/5322: Permission denied
`

@StoneT2000
Copy link
Member

StoneT2000 commented Oct 14, 2021

appears to be a different issue @aaronhance. Can you use

sudo npm i -g @lux-ai/2021-challenge@latest

instead?

@aaronhance
Copy link

appears to be a different issue @aaronhance. Can you use

sudo npm i -g @lux-ai/2021-challenge@latest

instead?

Seems to work now, despite installation errors https://gist.github.com/aaronhance/1d6485c2944581589fe8b944e7e12576

@StoneT2000
Copy link
Member

You can ignore the install errors. They don't mean anything relevant to the engine

@Vadimcg
Copy link

Vadimcg commented Nov 4, 2021

Windows 10 python 3.9.5 after lux-ai-2021 main.py main.py --out=replay.json got:
`-=-=-=-=-=-=-=-=-=-=-=-| [INFO] match_IE9xdjvBDnqM |-=-=-=-=-=-=-=-=-=-=-=-

[INFO] (match_IE9xdjvBDnqM) - Design: lux_ai_2021 | Initializing match - ID: IE9xdjvBDnqM, Name: match_IE9xdjvBDnqM
{
ranks: [
{ rank: 1, agentID: 0, name: 'main.py' },
{ rank: 1, agentID: 1, name: 'main.py' }
],
replayFile: 'replay.json',
seed: 364570344
}
node:internal/process/promises:246
triggerUncaughtException(err, true /* fromPromise */);
^

[Error: EPERM: operation not permitted, unlink 'C:\work\kaggle\lux\errorlogs\match_IE9xdjvBDnqM\agent_0.log'] {
errno: -4048,
code: 'EPERM',
syscall: 'unlink',
path: 'C:\work\kaggle\lux\errorlogs\match_IE9xdjvBDnqM\agent_0.log'
}`

@StoneT2000
Copy link
Member

This error is okay @Vadimcg, you can ignore it

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

No branches or pull requests

6 participants