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

Looping in installing Chocolately and doesn't see existing FFMPEG installation #231

Open
nigelp opened this issue Jan 15, 2025 · 16 comments
Assignees
Labels
bug Something isn't working

Comments

@nigelp
Copy link

nigelp commented Jan 15, 2025

This is just a rudimentary guide, don't be too intimidated, You don't have to follow this to the tee
BEFORE YOU MAKE A BUG REPORT, MAKE SURE THAT IT HASN'T ALREADY BEEN SOLVED OR REPORTED. :)

Describe the bug
The app loops when trying to install Chocolately. First it didn't see the existing installation on my PC (nor the installation of FFMPEG on my machine). It just loops round and round until I shut the cmd window.

To Reproduce
Click on the cmd file to run app. CMD window opens (after requesting Admin mode), then starts looping.

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS] Windows 10
  • Browser [e.g. chrome, safari] LibreWolf (Firefox clone)
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

@ROBERT-MCDOWELL
Copy link
Collaborator

ROBERT-MCDOWELL commented Jan 15, 2025

is your user have administrator privileges?
if not so it's better for you to use the dockerUtils or the full docker.
for the dockerUtils, just run the script like this:
ebookd2audiobook.cmd --script_mode docker_utils for all headless and to launch the gradio/gui.
for full docker, refer to the README, many examples how to run the full docker.

@nigelp
Copy link
Author

nigelp commented Jan 16, 2025

Thanks. OK, so I made sure I fired it up with administrative privileges. So this time it installed Caliber and FFmpeg, although I'm not sure why it installed FMmpeg again, since it's already installed under c:/FFmpeg. It seems you have some sort of hard coded locations for these apps even if they're in the path.

The bad thing is that even after it installed those two dependencies it continued in a loop trying to reinstall them over and over again. So I had to kill the CMD window again. I hate Docker and don't see why I should have to use it, I don't use it with other apps like this.

@nigelp
Copy link
Author

nigelp commented Jan 16, 2025

Okay so I just got it going. Thanks for your help. Once you go through all the hassle, it actually produces a really good result so thank you very much for that. Just a shame it couldn't be an easier install.

@ROBERT-MCDOWELL
Copy link
Collaborator

ROBERT-MCDOWELL commented Jan 16, 2025

among the 7.2k followers, you are the only one to have this issue. when you have a big issue like this, at least, share your experience by describing what you did to solve your issue, I'm sure it will help other (and me) to understand what's happened.
Providing, logs, the command line you did etc... is a MUST to solve issue in a software.
Also before telling things that is out of reality like "hardcoded path for ffmpeg", just take a look at the ebook2audiobook code and see what you "think" is true. if it's not, so it's better to not say anything.

This said, and I hope it will help you to raise your mind and behavior, explain step by step everything,
starting with:

HARDWARE:

PROGRAMS STATE: if calibre, ffmpeg, nodejs are already installed or not, if they are installed from source or package, if the path is standard or not etc....

COMMAND LINE and USER PRIVILEGES

LOG FROM THE TERMINAL (ALL)

more details will be, faster the issue will be solved.

About "Just a shame it couldn't be an easier install".
Tell me what it can be easier than:

.\ebook2audiobook.cmd

?

anyhow, if you think this is a shame, so we are open you work on it, and send a PR that makes things more easy for everybody...

@nigelp
Copy link
Author

nigelp commented Jan 16, 2025

@ROBERT-MCDOWELL ...well said, I deserve that. Sorry, my apologies. No excuse for the tone on an open source project.

So to answer your questions:

  1. Hardware - Windows 10 PC, 24GB RAM, 8GB VRAM RTX4060, 3 TB drive
  2. Programs State - FFMPEG installed (c:\FFMPEG) and included in environment Path, Calibre not installed initially.
  3. CMD and Privileges - First problems occurred with using non Admin CMD. Subsequently worked with Admin CMD (although not with Powershell for some reason).
  4. Logs - not available.

The process:

  1. ran ebook2audiobook.cmd in non admin CMD. First loop. Chocalatey not installed, tried repeatedly to install in a loop. Couldn't find FFMPEG or Calibre. Shut down CMD window.
  2. ran ebook2audiobook.cmd in an Admin window. Installed dependencies, but again looped with installing them repeatedly. Shut down window.
  3. Subsequent to your question, I ran the CMD Admin. Installed full code/dependencies, with some PIP warnings, then fired up the localhost server. Program ran perfectly.

Sorry I can't provide actual logs.

@ROBERT-MCDOWELL
Copy link
Collaborator

ROBERT-MCDOWELL commented Jan 16, 2025

the logs are what you see in the CMD terminal....
just copy and paste, without it it's almost impossible to have an expertise on the issue you had.
also, "pip warnings' are not normal, and for sure it won't work perfectly as you said. soon or late you will have issues because of that. that's why to solve an issue it needs to solve the root of the cause, and not the opposite. if not, night and days of waste of time and energy....

CMD ist made to run with a CMD terminal. Powershell terminal is also tested to work also. Both don't need to be run as administrator since the switch is done automatically. and this is a crucial point: is another CMD terminal is open as administrator when you run the script? if not, here is the problem. thanks to answer to this question as I don't need to go further to solve the issue as it comes from this.

did you install ffmpeg from their website? with an installer?

could you retry the whole process with the attached script (it's the coming v2.1.0 version) and tell me if it's the same?
of course you need to have your ebook2audiobook folder renamed and clone it again. then replace ebook2audiobook.cmd with the one I attached

ebook2audiobook.zip

and tell me if with this updated script it works.

@ROBERT-MCDOWELL ROBERT-MCDOWELL self-assigned this Jan 17, 2025
@ROBERT-MCDOWELL ROBERT-MCDOWELL added the bug Something isn't working label Jan 17, 2025
@torgash-ivanblch
Copy link

Hello and thank you for your great job!

Same issue, I had to make a screenshot to figure out what happened.

Image

@ROBERT-MCDOWELL
Copy link
Collaborator

ROBERT-MCDOWELL commented Jan 19, 2025

@torgash-ivanblch try my script attached above.
your issue is not the same of the original issue the other user opened.
apparently there is some inpcompatibilities with the language of your OS and directory names which are not ASCII (Latin chars)
and some python libraries are not compatible with other than ASCII.
solution: the root path of your user must be ASCII at 100%, like C:\Users\myusername

@torgash-ivanblch
Copy link

Well, basically the behavior is the same: loop through installing something.

I'll have to install fully non-Cyrillic OS to do that I'm afraid.

going on....

@ROBERT-MCDOWELL
Copy link
Collaborator

ROBERT-MCDOWELL commented Jan 19, 2025

it's the same loop but not the same cause of why the loop is occuring....
the issue you have is not an ebook2audiobook issue but surely the libraries we are using to make ebook2audiobook work and this is something we cannot change unless you go deeper in the test and logs and get which library is causing the trouble.
then open an issue to the authors of this library.

I think you can just create an alias of your username in ASCII like "ivanbich", linked to your real username and the issue will be solved I guess.

@torgash-ivanblch
Copy link

No, it's deeper.

Non-English versions of Windows may be a total mess when it comes to system paths.

I'd better try Linux (Ubuntu/Mint) instead.

WSL turned out not to be an option as well.

@ROBERT-MCDOWELL
Copy link
Collaborator

ok, it seems you had already such kind of disagreement....

@BigRusBoss
Copy link

BigRusBoss commented Jan 19, 2025

Image
OS: Windows 11 Pro 24H2 26100.1882 (i5-12400F, 32GB RAM, 2TB SSD-1.7TB free, RTX 3070)
Browser: Chrome 132.0.6834.83
Path to folder: "C:\Tool\ebook2audiobook-2.0"
Name user Windows 11: [email protected]
ebook2audiobook I run it as administrator. Output result CMD (translate):
DISPLAY: 'MinicondaDownload' TYPE: DOWNLOAD STATE: TRANSIENT_ERROR
PRIORITY: NORMAL FILES: 0 / 1 BYTES: 0 / UNKNOWN
ERROR FILE: https://repo.anaconda.com/miniconda/Miniconda3-latest-Windows-x86_64.exe -> C:\Users\666\AppData\Local\T
ERROR CODE: 0x80200059 - The cost transfer policy settings for the task prohibit the execution of the task at this time.
ERROR CONTEXT: 0x00000002 - Background Intelligent Transmission Service Queue Manager error (BITS).

Output result CMD (original):
DISPLAY: 'MinicondaDownload' TYPE: DOWNLOAD STATE: TRANSIENT_ERROR
PRIORITY: NORMAL FILES: 0 / 1 BYTES: 0 / UNKNOWN
ERROR FILE: https://repo.anaconda.com/miniconda/Miniconda3-latest-Windows-x86_64.exe -> C:\Users\666\AppData\Local\T
ERROR CODE: 0x80200059 - Параметры политики передачи стоимости для задания запрещают выполнение задания в это время.
ERROR CONTEXT: 0x00000002 - Ошибка диспетчера очереди фоновой интеллектуальной службы передачи (BITS).

I download and install in system "Miniconda3-latest-Windows-x86_64.exe". Not result.

@ROBERT-MCDOWELL
Copy link
Collaborator

ROBERT-MCDOWELL commented Jan 19, 2025

Open a CMD or PS terminal:

bitsadmin /reset
bitsadmin /setpolicy MinicondaDownload 0

and tell me if it's better, if not:

Verify Group Policy for BITS
Your system's transfer policy might restrict certain downloads.

Open Group Policy Editor:
Press Win + R, type gpedit.msc, and hit Enter.
Navigate to:
Computer Configuration > Administrative Templates > Network > Background Intelligent Transfer Service (BITS)
Check the following policies:
Limit the maximum network bandwidth for BITS background transfers: Ensure it’s Not Configured.
Set up a maintenance schedule to limit the maximum network bandwidth: Ensure it’s Not Configured.

@BigRusBoss
Copy link

BigRusBoss commented Jan 19, 2025

C:\Windows\System32>bitsadmin /reset

BITSADMIN version 3.0
BITS administration utility.
(C) Copyright Microsoft Corp.

{E2B18487-A30D-4458-AAC4-DC6364C99B14} canceled.
1 out of 1 jobs canceled.
C:\Windows\System32>bitsadmin /setpolicy MinicondaDownload 0

BITSADMIN version 3.0
BITS administration utility.
(C) Copyright Microsoft Corp.

Invalid command
USAGE: BITSADMIN [/RAWRETURN] [/WRAP | /NOWRAP] command
The following commands are available:

/HELP           Prints this help
/?              Prints this help
/UTIL /?        Prints the list of utilities commands
/PEERCACHING /?   Prints the list of commands to manage Peercaching
/CACHE /?       Prints the list of cache management commands
/PEERS /?       Prints the list of peer management commands

/LIST    [/ALLUSERS] [/VERBOSE]     List the jobs
/MONITOR [/ALLUSERS] [/REFRESH sec] Monitors the copy manager
/RESET   [/ALLUSERS]                Deletes all jobs in the manager

/TRANSFER <job name> [type] [/PRIORITY priority] [/ACLFLAGS flags] [/DYNAMIC]
          remote_url local_name
    Transfers one of more files.
    [type] may be /DOWNLOAD or /UPLOAD; default is download
    Multiple URL/file pairs may be specified.
    Unlike most commands, <job name> may only be a name and not a GUID.
    /DYNAMIC configures the job with BITS_JOB_PROPERTY_DYNAMIC_CONTENT, which relaxes the server-side requirements.

/CREATE [type] <job name>               Creates a job
    [type] may be /DOWNLOAD, /UPLOAD, or /UPLOAD-REPLY; default is download
    Unlike most commands, <job name> may only be a name and not a GUID.

/INFO <job> [/VERBOSE]                   Displays information about the job
/ADDFILE <job> <remote_url> <local_name> Adds a file to the job
/ADDFILESET <job> <textfile>             Adds multiple files to the job
   Each line of <textfile> lists a file's remote name and local name, separated
   by spaces.  A line beginning with '#' is treated as a comment.
   Once the file set is read into memory, the contents are added to the job.

/ADDFILEWITHRANGES  <job> <remote_url> <local_name range_list>
   Like /ADDFILE, but BITS will read only selected byte ranges of the URL.
   range_list is a comma-delimited series of offset and length pairs.
   For example,

       0:100,2000:100,5000:eof

   instructs BITS to read 100 bytes starting at offset zero, 100 bytes starting
   at offset 2000, and the remainder of the URL starting at offset 5000.

/REPLACEREMOTEPREFIX <job> <old_prefix> <new_prefix>
    All files whose URL begins with <old_prefix> are changed to use <new_prefix>

Note that BITS currently supports HTTP/HTTPS downloads and uploads.
It also supports UNC paths and file:// paths as URLS

/LISTFILES <job>                     Lists the files in the job
/SUSPEND <job>                       Suspends the job
/RESUME <job>                        Resumes the job
/CANCEL <job>                        Cancels the job
/COMPLETE <job>                      Completes the job

/GETTYPE <job>                       Retrieves the job type
/GETACLFLAGS <job>                   Retrieves the ACL propagation flags

/SETACLFLAGS <job> <ACL_flags>       Sets the ACL propagation flags for the job
  O - OWNER       G - GROUP
  D - DACL        S - SACL

  Examples:
      bitsadmin /setaclflags MyJob OGDS
      bitsadmin /setaclflags MyJob OGD

/GETBYTESTOTAL <job>                 Retrieves the size of the job
/GETBYTESTRANSFERRED <job>           Retrieves the number of bytes transferred
/GETFILESTOTAL <job>                 Retrieves the number of files in the job
/GETFILESTRANSFERRED <job>           Retrieves the number of files transferred
/GETCREATIONTIME <job>               Retrieves the job creation time
/GETMODIFICATIONTIME <job>           Retrieves the job modification time
/GETCOMPLETIONTIME <job>             Retrieves the job completion time
/GETSTATE <job>                      Retrieves the job state
/GETERROR <job>                      Retrieves detailed error information
/GETOWNER <job>                      Retrieves the job owner
/GETDISPLAYNAME <job>                Retrieves the job display name
/SETDISPLAYNAME <job> <display_name> Sets the job display name
/GETDESCRIPTION <job>                Retrieves the job description
/SETDESCRIPTION <job> <description>  Sets the job description
/GETPRIORITY    <job>                Retrieves the job priority
/SETPRIORITY    <job> <priority>     Sets the job priority
   Priority usage choices:
      FOREGROUND
      HIGH
      NORMAL
      LOW
/GETNOTIFYFLAGS <job>                 Retrieves the notify flags
/SETNOTIFYFLAGS <job> <notify_flags>  Sets the notify flags
    For more help on this option, please refer to the MSDN help page for SetNotifyFlags/GETNOTIFYINTERFACE <job>             Determines if notify interface is registered
/GETMINRETRYDELAY <job>               Retrieves the retry delay in seconds
/SETMINRETRYDELAY <job> <retry_delay> Sets the retry delay in seconds
/GETNOPROGRESSTIMEOUT <job>           Retrieves the no progress timeout in seconds
/SETNOPROGRESSTIMEOUT <job> <timeout> Sets the no progress timeout in seconds
/GETMAXDOWNLOADTIME <job>             Retrieves the download timeout in seconds
/SETMAXDOWNLOADTIME <job> <timeout>   Sets the download timeout in seconds
/GETERRORCOUNT <job>                  Retrieves an error count for the job

/SETPROXYSETTINGS <job> <usage>      Sets the proxy usage
   usage choices:
    PRECONFIG   - Use the owner's default Internet settings.
    AUTODETECT  - Force autodetection of proxy.
    NO_PROXY    - Do not use a proxy server.
    OVERRIDE    - Use an explicit proxy list and bypass list.
                  Must be followed by a proxy list and a proxy bypass list.
                  NULL or "" may be used for an empty proxy bypass list.
  Examples:
      bitsadmin /setproxysettings MyJob PRECONFIG
      bitsadmin /setproxysettings MyJob AUTODETECT
      bitsadmin /setproxysettings MyJob NO_PROXY
      bitsadmin /setproxysettings MyJob OVERRIDE proxy1:80 "<local>"
      bitsadmin /setproxysettings MyJob OVERRIDE proxy1,proxy2,proxy3 NULL

/GETPROXYUSAGE <job>                 Retrieves the proxy usage setting
/GETPROXYLIST <job>                  Retrieves the proxy list
/GETPROXYBYPASSLIST <job>            Retrieves the proxy bypass list

/TAKEOWNERSHIP <job>                 Take ownership of the job

/SETNOTIFYCMDLINE <job> <program_name> [program_parameters]
    Sets a program to execute for notification, and optionally parameters.
    The program name and parameters can be NULL.
    IMPORTANT: if parameters are non-NULL, then the program name should be the
               first parameter.

  Examples:
    bitsadmin /SetNotifyCmdLine MyJob c:\winnt\system32\notepad.exe  NULL
    bitsadmin /SetNotifyCmdLine MyJob c:\callback.exe "c:\callback.exe parm1 parm2"
    bitsadmin /SetNotifyCmdLine MyJob NULL NULL

/GETNOTIFYCMDLINE <job>              Returns the job's notification command line

/SETCREDENTIALS <job> <target> <scheme> <username> <password>
  Adds credentials to a job.
  <target> may be either SERVER or PROXY
  <scheme> may be BASIC, DIGEST, NTLM, NEGOTIATE, or PASSPORT.

/REMOVECREDENTIALS <job> <target> <scheme>
  Removes credentials from a job.
/GETCUSTOMHEADERS <job>                           Gets the Custom HTTP Headers
/SETCUSTOMHEADERS <job> <header1> <header2> <...> Sets the Custom HTTP Headers
/MAKECUSTOMHEADERSWRITEONLY <job>                 Make a job's Custom HTTP Headers write-only (cannot be undone).

/GETHTTPMETHOD <job>                           Gets the HTTP verb to use.
/SETHTTPMETHOD <job> <HTTPMethod>              Sets the HTTP verb to use.

/GETCLIENTCERTIFICATE <job>                       Gets the job's Client Certificate Information
/SETCLIENTCERTIFICATEBYID <job> <store_location> <store_name> <hexa-decimal_cert_id>
  Sets a client authentication certificate to a job.
  <store_location> may be
        1(CURRENT_USER), 2(LOCAL_MACHINE), 3(CURRENT_SERVICE),
        4(SERVICES), 5(USERS), 6(CURRENT_USER_GROUP_POLICY),
        7(LOCAL_MACHINE_GROUP_POLICY) or 8(LOCAL_MACHINE_ENTERPRISE).

/SETCLIENTCERTIFICATEBYNAME <job> <store_location> <store_name> <subject_name>
  Sets a client authentication certificate to a job.
  <store_location> may be
        1(CURRENT_USER), 2(LOCAL_MACHINE), 3(CURRENT_SERVICE),
        4(SERVICES), 5(USERS), 6(CURRENT_USER_GROUP_POLICY),
        7(LOCAL_MACHINE_GROUP_POLICY) or 8(LOCAL_MACHINE_ENTERPRISE).

/REMOVECLIENTCERTIFICATE <job>                Removes the Client Certificate Information from the job

/SETSECURITYFLAGS <job> <value>
   Sets the HTTP security flags for URL redirection and checks performed on the server certificate during the transfer.
   The value is an unsigned integer with the following interpretation for the bits in the binary representation.
     Enable CRL Check                                 : Set the least significant bit
     Ignore invalid common name in server certificate : Set the 2nd bit from right
     Ignore invalid date in  server certificate       : Set the 3rd bit from right
     Ignore invalid certificate authority in server
       certificate                                    : Set the 4th bit from right
     Ignore invalid usage of certificate              : Set the 5th bit from right
     Redirection policy                               : Controlled by the 9th-11th bits from right
         0,0,0  - Redirects will be automatically allowed.
         0,0,1  - Remote name in the IBackgroundCopyFile interface will be updated if a redirect occurs.
         0,1,0  - BITS will fail the job if a redirect occurs.

     Allow redirection from HTTPS to HTTP             : Set the 12th bit from right

/GETSECURITYFLAGS <job>
   Reports the HTTP security flags for URL redirection and checks performed on the server certificate during the transfer.

/SETVALIDATIONSTATE  <job>  <file-index> <true|false>
      <file-index> starts from 0
    Sets the content-validation state of the given file within the job.

/GETVALIDATIONSTATE  <job>  <file-index>
      <file-index> starts from 0
    Reports the content-validation state of the given file within the job.

/GETTEMPORARYNAME  <job>  <file-index>
      <file-index> starts from 0
    Reports the temporary filename of the given file within the job.

The following options control peercaching of a particular job:

/SETPEERCACHINGFLAGS  <job> <value>
    Sets the flags for the job's peercaching behavior.
    The value is an unsigned integer with the following interpretation for the bits in the binary representation.
        Allow the job's data to be downloaded from a peer : Set the least significant bit
        Allow the job's data to be served to peers        : Set the 2nd bit from right

/GETPEERCACHINGFLAGS  <job>
    Reports the flags for the job's peercaching behavior.

The following options are valid for UPLOAD-REPLY jobs only:

/GETREPLYFILENAME <job>        Gets the path of the file containing the server reply
/SETREPLYFILENAME <job> <path> Sets the path of the file containing the server reply
/GETREPLYPROGRESS <job>        Gets the size and progress of the server reply
/GETREPLYDATA     <job>        Dumps the server's reply data in hex format

/SETHELPERTOKEN <job>          Sets the current command prompt's primary token as a job's helper token
/GETHELPERTOKENSID <job>       Reports the user account SID of a job's helper token, if one is set

/SETHELPERTOKENFLAGS <job> <flags>
    Sets the helper token usage flags for a job. Possible values are:
        1 - The helper token is used when accessing the local filesystem.
        2 - The helper token is used when accessing the network.
        3 - The helper token is used when accessing both the local filesystem and the network.

/GETHELPERTOKENFLAGS <job>
    Reports a job's helper token usage flags.

/GETPEERSTATS <job> <file-index>
    <file-index> starts from 0
    Reports statistics about the amount of data downloaded from peers and origin servers for a specific file within a job.

The following options can be placed before the command:
/RAWRETURN                     Return data more suitable for parsing
/WRAP                          Wrap output around console (default)
/NOWRAP                        Don't wrap output around console

The /RAWRETURN option strips new line characters and formatting.
It is recognized by the /CREATE and /GET* commands.

Commands that take a <job> parameter will accept either a job name or a job ID
GUID inside braces.  BITSADMIN reports an error if a name is ambiguous.

Run ebook2audiobook:

DISPLAY: 'MinicondaDownload' TYPE: DOWNLOAD STATE: TRANSIENT_ERROR
PRIORITY: NORMAL FILES: 0 / 1 BYTES: 0 / UNKNOWN
ERROR FILE: https://repo.anaconda.com/miniconda/Miniconda3-latest-Windows-x86_64.exe -> C:\Users\666\AppData\Local\T
ERROR CODE: 0x80200059 - The cost transfer policy settings for the task prohibit the execution of the task at this time.
ERROR CONTEXT: 0x00000002 - Background Intelligent Transmission Service Queue Manager error (BITS).

Check the following policies:
Limit the maximum network bandwidth for BITS background transfers: Ensure it’s Not Configured.
Set up a maintenance schedule to limit the maximum network bandwidth: Ensure it’s Not Configured.

All Not Configured.

The error persists.

@ROBERT-MCDOWELL
Copy link
Collaborator

ROBERT-MCDOWELL commented Jan 20, 2025

your windows is blocking every download from bitsadmin by a policy. did your administrator or you changed the windows policy on this matter?

try:
reg delete "HKLM\Software\Policies\Microsoft\Windows\BITS" /f
gpupdate /force

if it's still not working:

replace the line "call bitsadmin....." in the CMD script
by
call powershell -Command "Invoke-WebRequest -Uri %CONDA_URL% -OutFile "%CONDA_INSTALLER%"

and see if windows is more tolerant...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants