Hey DM,
I got an error this morning that I haven't seen before. Every week I run a script that creates a nodelist, nodediff, and infopack for my network. Once the files are created I hatch them into their proper directories, etc.
Seems like my nodelist and nodediff uploaded to the BBS fine, but the infopack, while residing in the correct directory, wasn't uploaded to the BBS. So I tried manually uploading with ';upload' from the file transfer menu and got:
!ERROR in upload.cpp line 40 (uploadfile) checking "agoranet.zip" access=170
Then addfiles segfaults/coredumps on trying to upload the same file.
Sep 23 08:18:23 reaper kernel: addfiles[7673]: segfault at 0 ip 00007f22426ae9ba sp 00007ffcd31e6838 error 4 in libc.so.6[7f2242626000+15f000] likely on CPU 0 (core 0, socket 0)
Sep 23 08:18:23 reaper kernel: Code: f3 0f 1e fa 66 0f ef c0 66 0f ef c9 66 0f ef d2 66 0f ef db 48 89 f8 48 89 f9 48 81 e1 ff 0f 00 00 48 81 f9 cf 0f 00 00 77 66 <f3> 0f 6f 20 66 0f 74 e0 66 0f d7 d4 85 d2 74 04 0f bc c2 c3 48 83
Sep 23 08:18:23 reaper systemd[1]: Started Process Core Dump (PID 7674/UID 0). Sep 23 08:18:23 reaper systemd-coredump[7675]: [??] Process 7673 (addfiles) of user 1000 dumped core.
Stack trace of thread 7673:
#0 0x00007f22426ae9ba n/a (libc.so.6 + 0xae9ba)
#1 0x00005580f396b7ad n/a (/home/axisd/sbbs/repo/src/sbbs3/gcc.linux.x64.exe.debug/addfiles + 0x247ad)
#2 0x00007f2242627cd0 n/a (libc.so.6 + 0x27cd0)
#3 0x00007f2242627d8a __libc_start_main (libc.so.6 + 0x27d8a)
#4 0x00005580f3950ab5 n/a (/home/axisd/sbbs/repo/src/sbbs3/gcc.linux.x64.exe.debug/addfiles + 0x9ab5)
ELF object binary architecture: AMD x86-64
Sep 23 08:18:23 reaper systemd[1]: systemd-coredump@1-7674-0.service: Deactivated successfully.
Kind of at a stage of confusion here, since all 3 files are created by the same script. Two of the files are online, and one isn't. The one that isn't, can be accessed/unzipped manually just fine, and is owned by the user/group the BBS is.
I've tried 'delfiles <dir_code> -off -nol' to see if it may have been in the database and not allowing me to overwrite it, but there's nothing there to remove.
!ERROR in upload.cpp line 40 (uploadfile) checking "agoranet.zip"
access=170
That means the file is already in the directory database/index.
This should not be able to happen this deep in this code path (the check for the file's non-existence was already performed before this code where this error would be logged) - so I suspect maybe your data/dirs/<filebase>.* for this directory is corrupt. You can use 'chksmb' to check it, 'smbutil' to view it, and 'fixsmb' to repair the index if it does have a problem.
addfiles has been deprecated, replaced with addfiles.js: https://wiki.synchro.net/module:addfiles
That said, I'd still like to fix the old addfiles.c source code. Do you think you can reproduce that stack and backtrace using a debug build of addfiles for me?
But if you want to examine the filebase, smbutil would be a better tool to use.
Re: Unexpected error
By: Digital Man to Accession on Sat Sep 23 2023 02:38 pm
!ERROR in upload.cpp line 40 (uploadfile) checking "agoranet.zip"
access=170
That means the file is already in the directory database/index.
That's kind of what I figured, however, I think I'm in deeper shit than I thought with this issue. Seems as though any/all file areas that have had existing files overwritten (many FTN related areas, of course) using 'addfiles' are corrupt. I had a script for that, that's obviously outdated. ;)
This should not be able to happen this deep in this code path (the check for the file's non-existence was already performed before this code where this error would be logged) - so I suspect maybe your data/dirs/<filebase>.* for this directory is corrupt. You can use 'chksmb' to check it, 'smbutil' to view it, and 'fixsmb' to repair the index if it does have a problem.
Most definitely corrupt, as well as others it seems but this is the first to be noticed due to a failure of any kind.
So, after running fixsmb, it seems there's still errors on it.
Orphaned Headers (!): 1
Zeroed Header Numbers (!): 1
Missing Message-IDs (!): 1
Other than that, it looks a lot cleaner than it was.
addfiles has been deprecated, replaced with addfiles.js: https://wiki.synchro.net/module:addfiles
Unfortunately, I think you told me this once before while I was trying to do some manual stuff awhile back. Now that I'm digging into scripts and seeing that I'm still using the old stuff, I guess I have some new questions:
I'm receiving FDN related files via multiple networks. This is what I assume would be a proper command syntax, but I'm not sure how addfiles.js works in regards to specifics:
jsexec addfiles.js -all -ex=files.bbs -diz -update -delete listfile:files.bbs
My thinking behind this, and correct me if I'm wrong or maybe I'll have to make a list of feature requests or something.
- Here I'm checking all directories
- Excluding uploading of files.bbs
- Checking for and using file_id.diz if it's there (here's where I'm confused with the help syntax, since it says "always extract/use description in archive" rather than "if it's there, otherwise we could do something else", hopefully this is the case, see below.)
- Updating existing file entries (This is another one that didn't seem to work the way I thought it would with the old addfiles. I'm not trying to update ALL existing file entries, which is what the old addfiles would do, if I remember right. I'm only trying to update files that are received and are overwriting an existing file (infopacks, for example). This is probably my main cause of a lot of my dirs being corrupt).
- While searching all directories, find files.bbs (listfile) and use that for uploading new files.
- Delete files.bbs after uploads
I have a feeling I'm way off on this, which is why it took me awhile to get the old addfiles working in a way I could handle. I still was never able to get it to update overwritten files, and list them as new files when doing a newscan without every file on my system becoming marked as new.
That said, I'd still like to fix the old addfiles.c source code. Do you think you can reproduce that stack and backtrace using a debug build of addfiles for me?
Sure, with detailed instructions of course (not a programmer). And I just checked to make sure the coredump still happens after using chksmb/fixsmb on that dir, it does.
Is this debug build of addfiles something you would provide me? Or while I'm using the debug version of Synchronet as a whole, do I have it already?
But if you want to examine the filebase, smbutil would be a better tool to use.
I'm not going to go any further at the moment so I don't actually fix it to where I'm not able to provide you with the stack and backtrace. ;)
You can also use 'smbutil' to attempt repair of any correpted file bases using 'smbutil -a mp path/to/filebase.shd'
I'm receiving FDN related files via multiple networks. This is what I
assume would be a proper command syntax, but I'm not sure how
addfiles.js works in regards to specifics:
Any reason you're not using TickIT for this job?
jsexec addfiles.js -all -ex=files.bbs -diz -update -delete
listfile:files.bbs
"listfile:" is not part of the command-line syntax. Just name of the listfile itself (no prefix or other decoration needed).
Also, files.bbs is excluded by default, so you don't need to specify "-ex=files.bbs" on the command-line.
- Excluding uploading of files.bbs
That's the default behavior
Without -diz, an extended description in the listfile would be used instead.
I just added a -readd option to addfiles.js that'll re-add any updated files so the will appear as newly-uploaded. This was what the old addfiles '-o' option would do, but may not work now (with addfiles).
It'd likely be the same way you captured the pasted backtrace before, but use a "debug" (instead of "release") build of Synchronet to do it. Instructions on how to switch to a debug build are at https://wiki.synchro.net/howto:gdb
You need to just use a different build (make) option.
jsexec addfiles.js -all -ex=files.bbs -diz -update -delete
listfile:files.bbs
"listfile:" is not part of the command-line syntax. Just name of the listfile itself (no prefix or other decoration needed).
Also, files.bbs is excluded by default, so you don't need to specify "-ex=files.bbs" on the command-line.
I've changed that line to:
'jsexec addfiles.js -all -diz -update -readd -delete files.bbs'
Does this look more correct?
Without -diz, an extended description in the listfile would be used instead.
Are you referring to just the option for addfiles.js?
I guess what I'm
trying to do here, is search for and use a file_id.diz if it exists, if not.. use the description in files.bbs. Some people seem to hatch out files that don't use the file_id.diz as the description, or they use some short formed description instead. I'd rather use the original description that came with the file, and if THAT doesn't exist, continue with whatever the .tic file gave to files.bbs.
Are you saying that both options (-diz and files.bbs) should not be used together for addfiles.js, or can they be?
I just added a -readd option to addfiles.js that'll re-add any updated files so the will appear as newly-uploaded. This was what the old addfiles '-o' option would do, but may not work now (with addfiles).
According to the help, '-o' updates upload date only for existing files.
However, it wasn't marking them as new files during a newscan. This '-readd' may just be what I've always been looking for.
With the old addfiles, I was using 'addfiles - -noz /sbbs/data/dirs/*.shd' or something similar. This worked for everything I needed, and did indeed use file_id.diz, and if it wasn't there used what was in files.bbs. The only thing it didn't do was any files that the date was updated on, were not marked as new files, so they never came up on a file newscan. Again, I think we're on to something here with the new option you just added. ;)
It'd likely be the same way you captured the pasted backtrace before, but use a "debug" (instead of "release") build of Synchronet to do it. Instructions on how to switch to a debug build are at https://wiki.synchro.net/howto:gdb
I'm fairly certain I'm using a debug version.
My pasted backtrace before
included /home/axisd/sbbs/repo/src/sbbs3/gcc.linux.x64.exe.debug/addfiles, but the trace itself was provided by systemd-coredump. Nothing related to SBBS, except addfiles, segfaulted. The BBS itself keeps running. That said, I'm not understanding the wiki instructions. I tried:
gdb /home/axisd/sbbs/exec/sbbs core.addfiles.1000.0ddb36cc2592412d942b61d8556aa565.180366.1695589153000000
.. as that was the only core file provided, and didn't get much help.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 371 |
Nodes: | 16 (2 / 14) |
Uptime: | 174:22:40 |
Calls: | 7,915 |
Files: | 12,983 |
Messages: | 5,797,648 |