ezra-bible-app / node-sword-interface

JavaScript (N-API) interface to SWORD library
GNU General Public License v2.0
22 stars 2 forks source link

refreshRemoteSourceConfiguration returning with -1 #37

Closed tobias-klein closed 1 year ago

tobias-klein commented 1 year ago

reported by @rockymartin0124

I executed the command "node examples/install_kjv.js" again, and got the scripts like this.

Updating repository configuration ...

refreshRemoteSourceConfiguration returned -1 Installing King James module getModuleRepo: Got 0 repository names! Could not find repository for module KJV (node:8308) UnhandledPromiseRejectionWarning: -1 (Use node --trace-warnings ... to show where the warning was created) (node:8308) 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:8308) [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.

Please explain about this.

Originally posted by @rockymartin0124 in https://github.com/ezra-bible-app/node-sword-interface/issues/35#issuecomment-1366663718

tobias-klein commented 1 year ago

@rockymartin0124 I created a separate issue for this topic, because it is independent of the other issue #35 you reported.

Could you try to go with https://github.com/ezra-bible-app/ezra-bible-app/issues/155#issuecomment-750302401 as mentioned in the other issue.

If the file C:\Users\<your-user-name>\AppData\Roaming\sword\installMgr\InstallMgr.conf is not existing please create it and add this section:

[General]
TimeoutMillis=20000

If the error keeps happening - please gradually increase the timeout to higher values (like 30000, 40000, ...).

rockymartin0124 commented 1 year ago

I have made the file "InstallMgr.conf", and added the TimeoutMillis. And I also increased the timeout to higher values, but the result is same.

tobias-klein commented 1 year ago

Ok. Have you been using any other SWORD based software like Xiphos, BibleTime or Ezra Bible App and does the module installation work there?

@rockymartin0124 The reason why I am asking is because the SWORD library is also used by other applications and if the problem is in the SWORD library, then the SWORD maintainers need to have a look and I need to contact them.

Since these issues are related to module installation - can you tell me what kind of internet connection you are using?

The error above indicates that the download of the master repository list is failing. This happens via FTP. Is FTP maybe blocked in your firewall?

tobias-klein commented 1 year ago

@rockymartin0124 Let's try to get a full debug log of the command. To do that please execute the following commands in your node-sword-interface directory.

set SWORD_LOGLEVEL=DEBUG
node examples\install_kjv.js > debuglog.txt 2>&1

Then please attach the file debuglog.txt to this issue (drag and drop the file into the issue comment editor).

The debug logfile will allow me to further analyze what's going wrong on your system.

tobias-klein commented 1 year ago

@rockymartin0124 Happy new year! Any additional feedback regarding this?

tobias-klein commented 1 year ago

Glad to hear that it's working now. Can you provide additional hints, what did you change compared to previous attempts? I am curious.

rockymartin0124 commented 1 year ago

@tobias-klein I have already run node-sword-interface on Linux. But now I MUST run it on Windows. So I have tried the command "node example/install_kjv.js", but I have got the error, too. So I tried set SWORD_LOGLEVEL=DEBUG node examples\install_kjv.js > debuglog.txt 2>&1 I attach the debuglog.txt. What should I do to solve this issue? debuglog.txt

tobias-klein commented 1 year ago

Hi @rockymartin0124 , Thanks. The logfile does not contain the debug information. Could you run the two commands set SWORD_LOGLEVEL=DEBUG and node examples\install_kjv.js > debuglog.txt 2>&1 separately? I believe the environment variable was not set correctly when you executed both in one line.

rockymartin0124 commented 1 year ago

Thanks for your reply @tobias-klein I have executed both separately. After I received your reply, I tried again, but the result is the same.

The content of the file is like this: `Updating repository configuration ...

refreshRemoteSourceConfiguration returned -1 Installing King James module getModuleRepo: Got 0 repository names! Could not find repository for module KJV (node:22512) UnhandledPromiseRejectionWarning: -1 (Use node --trace-warnings ... to show where the warning was created) (node:22512) 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:22512) [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.` debuglog.txt

tobias-klein commented 1 year ago

Hi @rockymartin0124

If there is nothing else in the logfile, then the environment variable SWORD_LOGLEVEL=DEBUG must be set incorrectly. I cannot further look into this without detailed info in the logfile.

Can you tell me more about your execution environment. Did you use powershell or the cmd shell? I just checked and found that the environment variable setting only works like this in the CMD shell. So in case you are using powershell that could explain why you did not get detailed debug information.

Please run these commands in a CMD window once more and provide the logfile again.

tobias-klein commented 1 year ago

On CMD, you can check the value of the environment variable by typing echo %SWORD_LOGLEVEL%.

We could have a look jointly, I'll contact you via email.

rockymartin0124 commented 1 year ago

I executed echo %SWORD_LOGLEVEL%. The result is DEBUG.

tobias-klein commented 1 year ago

What is your Windows version and what is your node version?

rockymartin0124 commented 1 year ago

Windows10 (64bit) node version is v14.21.2

tobias-klein commented 1 year ago

Are you using the 32-bit version of node?

rockymartin0124 commented 1 year ago

Sure

tobias-klein commented 1 year ago

Ok. Let's handle further communication via email.