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

Left over enigftnexport files in enigma/tmp folder #322

Closed
2 tasks done
Beanzilla opened this issue Nov 9, 2020 · 10 comments
Closed
2 tasks done

Left over enigftnexport files in enigma/tmp folder #322

Beanzilla opened this issue Nov 9, 2020 · 10 comments

Comments

@Beanzilla
Copy link

Describe the Bug
There are leftover enigftnexport files in the enigma/tmp folder.

To Reproduce
Do ls -la /tmp

Expected Behavior
Temp files cleaned up after use.

Actual Behavior
the tmp directory is full of leftover files.

Screenshots
enigftnissue
or
enigftnissue.txt

Environment

  • I am using Node.js v12.x LTS or higher
  • npm install or yarn reports success
  • Actual Node.js version (node --version): v12.19.0
  • Operating system (uname -a on *nix systems): Linux 529761d396dc 5.6.14-x86_64-linode135 Implement MultiLineTextEditView preview mode #1 SMP PREEMPT Fri May 22 14:57:20 UTC 2020 x86_64 GNU/Linux
  • Revision (git rev-parse --short HEAD): v0.0.12
  • Any additional relevant information about your setup: Running in docker.
@Beanzilla
Copy link
Author

In enigma/logs I did grep enigftn enigma-bbs.log to show all occurrences of enigftnimport and enigftnexport

enigma-bbs.txt

@stevet11
Copy link

stevet11 commented Nov 10, 2020

To debug this, I had to set logging level to trace.

{"name":"ENiGMA½ BBS","hostname":"529761d396dc","pid":6,"level":10,"importDir":"/home/enigma/bbs/mail/ftn_secin/","error":"ENOENT: no such file or directory, scandir '/home/enigma/bbs/mail/ftn_secin/'","msg":"Cannot perform FTN import for directory","time":"2020-11-10T00:41:28.137Z","v":0}

Creating this directory fixed the failed to extract. Now we get two directories, and no more.

@stevet11
Copy link

I removed the ftn_secin, and restarted. More directories created, but unrelated.

This is running in a docker container. Every container restart, two directories /tmp/enigftn(export|import)-* are created. After many restarts, we have many directories.

I've changed the way docker handles the /tmp directory.

@NuSkooler
Copy link
Owner

The /tmp/ directories should be created and cleaned up on startup/shutdown (e.g.: https://github.com/NuSkooler/enigma-bbs/blob/master/core/scanner_tossers/ftn_bso.js#L2184). They are used as a temporary extraction location for FTN packets.

It sounds like your Docker container is not cleanly shutting down the system -- thus not going through the shutdown path. Might double check that.

As for the importDir issue, that's a separate issue. It's a debug message that I plan on cleaning up at some point, but it's harmless.

@stevet11
Copy link

Here's what I know so far:

inside of docker using interactive shell (avoiding all of the PID1/signal handling strangeness of docker), sending ctrl-c, using kill to send SIGINT or SIGTERM results in enigma stopping.
As in nothing is displayed after the "System started!" line.

node@129977c79207:/home/enigma/bbs$ node main.js 
ENiGMA½ Copyright (c) 2015-2020, Bryan D. Ashby
_____________________   _____  ____________________    __________\_   /
\__   ____/\_ ____   \ /____/ /   _____ __         \  /   ______/ // /___jp!
//   __|___//   |    \//   |//   |    \//  |  |    \//        \ /___   /_____
/____       _____|      __________       ___|__|      ____|     \   /  _____  \
---- \______\ -- |______\ ------ /______/ ---- |______\ - |______\ /__/ // ___/
                                                                     /__   _\
 <*>   ENiGMA½  // HTTPS://GITHUB.COM/NUSKOOLER/ENIGMA-BBS   <*>       /__/

-------------------------------------------------------------------------------

System started!
^C
node@129977c79207:/home/enigma/bbs$

However, this "works" with the above session:

node@129977c79207:/home/enigma/bbs$ node oputil.js config new
? Create a new configuration? (y/N) y
? Create a new configuration? Yes
? Configuration path: (./config/config.hjson) 
? Configuration path: ./config/config.hjson
? Config file exists. Overwrite? (y/N) y
? Config file exists. Overwrite? Yes
? BBS name: (New ENiGMA½ BBS) 
? BBS name: New ENiGMA½ BBS
? First message conference: (Local) 
? First message conference: Local
? Conference description: (Local Areas) 
? Conference description: Local Areas
? First area in message conference: (General) 
? First area in message conference: General
? Area description: (General chit-chat) 
? Area description: General chit-chat
? Logging level: 
? Logging level: Trace
Configuration generated

node@129977c79207:/home/enigma/bbs$ node main.js 
ENiGMA½ Copyright (c) 2015-2020, Bryan D. Ashby
_____________________   _____  ____________________    __________\_   /
\__   ____/\_ ____   \ /____/ /   _____ __         \  /   ______/ // /___jp!
//   __|___//   |    \//   |//   |    \//  |  |    \//        \ /___   /_____
/____       _____|      __________       ___|__|      ____|     \   /  _____  \
---- \______\ -- |______\ ------ /______/ ---- |______\ - |______\ /__/ // ___/
                                                                     /__   _\
 <*>   ENiGMA½  // HTTPS://GITHUB.COM/NUSKOOLER/ENIGMA-BBS   <*>       /__/

-------------------------------------------------------------------------------

System started!
^CProcess interrupted. Shutting down...
Goodbye!
node@129977c79207:/home/enigma/bbs$ 

Using our "live" config.hjson, I've tried turning off everything (but telnet). I've reset back to blocktronics theme. Still results in improper shutdown.

Ok! It isn't docker. I just added enigma to my desktop here so I could keep my config file paths the same. It's something in my setup/config files.

@stevet11
Copy link

Ok, deleting the events section fixes it. Or, having events that don't run.
Once an event runs, it breaks.

Or, if I disable events, but run a door, it breaks.
"it breaks" = stopping enigma I don't get the proper "Process interrupted. Shutting down..." message.

@stevet11
Copy link

See microsoft/node-pty#190 for the exact problem.

Fixed in microsoft/node-pty#218

@NuSkooler
Copy link
Owner

Will need to wait on microsoft/node-pty#218 to be put into a release. We're currently at the latest version.

Until then you can force your local version to use e.g. the fix branch or node-pty master by modifying your package.json

@NuSkooler
Copy link
Owner

The Microsoft/node-pty team has responded regarding this - using the beta tag should work around the issue for now.

@NuSkooler you can use the beta tag to get the latest version, no date for 0.10 yet

You can do this via npm or yarn install or manual edit to your package.json for now.

NuSkooler added a commit that referenced this issue Feb 9, 2021
* Should resolve Left over enigftnexport files in enigma/tmp folder #322
@NuSkooler
Copy link
Owner

Microsoft has updated node-pty to v0.10.0 and ENiGMA has followed. Should now be resolved. Feel free to re-open if this is still a problem after updating!

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

No branches or pull requests

3 participants