sqm-autorate / sqm-autorate

Adjusts bandwidth for CAKE by measuring load and RTT times
Mozilla Public License 2.0
92 stars 10 forks source link

[BUG] New installation path, not working #182

Closed GLareFLare22 closed 4 months ago

GLareFLare22 commented 8 months ago

Upon installation The error I will run into.

root@OpenWrt:~# sh -c "$(wget -q -O- https://raw.githubusercontent.com/sqm-autorate/sqm-autorate/main/sqm-autorate-setup
.sh)"
>>> Refreshing package cache. This may take several minutes...
>>> Installing required packages via opkg...
>>> Installing required packages via luarocks...
Installing https://luarocks.org/vstruct-2.1.1-1.src.rock...
Using https://luarocks.org/vstruct-2.1.1-1.src.rock... switching to 'build' mode
Updating manifest for /usr/lib/luarocks/rocks
vstruct 2.1.1-1 is now built and installed in /usr

>>> Creating /usr/lib/sqm-autorate
>>> Downloading sqm-autorate files...
tar (child): /tmp/sqm-autorate-install.tar.gz: Cannot open: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now
>>> Putting lib files into place...
cp: can't stat '/tmp/sqm-autorate-sqm-autorate-*/lib/.': No such file or directory
>>> Making lua and shell files executable...
BusyBox v1.36.1 (2024-02-06 03:53:34 UTC) multi-call binary.

Usage: chmod [-R] MODE[,MODE]... FILE...

MODE is octal number (bit pattern sstrwxrwxrwx) or [ugoa]{+|-|=}[rwxXst]

        -R      Recurse
>>> Putting config file into place...
cp: can't stat '/tmp/sqm-autorate-sqm-autorate-*/config/sqm-autorate.config': No such file or directory
>>> Putting service file into place...
cp: can't stat '/tmp/sqm-autorate-sqm-autorate-*/service/sqm-autorate.service': No such file or directory
chmod: cannot access '/etc/init.d/sqm-autorate': No such file or directory
grep: /etc/config/sqm-autorate: No such file or directory
>>> Updating VERSION string to include:   [release]
sed: /usr/lib/sqm-autorate/sqm-autorate.lua: No such file or directory
>>> Cleaning up temporary files...
rm: can't remove '/tmp/sqm-autorate-install.tar.gz': No such file or directory
rm: can't remove '/tmp/sqm-autorate-sqm-autorate-*': No such file or directory
>>> Installation complete, about to start configuration.
/usr/lib/sqm-autorate/configure.sh is not found or not executable

It was working before the update a week~ ago

However upon trying any of the Repositories through the history prior to any edits appear to... have issues, its highly possible its on my end, however I cant properly understand where the fault is.

For example

root@OpenWrt:~# sh -c "$(wget -q -O- http://raw.githubusercontent.com/sqm-autorate/sqm-autorate/9db9d712a505d993fc6d2eb7
4c6f93bb52c5ddf1/sqm-autorate-setup.sh)"
/etc/init.d/sqm-autorate: line 1: 404:: not found
>>> Refreshing package cache. This may take several minutes...
>>> Installing required packages via opkg...
>>> Installing required packages via luarocks...
Installing https://luarocks.org/vstruct-2.1.1-1.src.rock...
Using https://luarocks.org/vstruct-2.1.1-1.src.rock... switching to 'build' mode
Updating manifest for /usr/lib/luarocks/rocks
vstruct 2.1.1-1 is now built and installed in /usr

>>> Creating /usr/lib/sqm-autorate
>>> Downloading sqm-autorate files...
tar (child): /tmp/sqm-autorate-install.tar.gz: Cannot open: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now
>>> Putting lib files into place...
cp: can't stat '/tmp/sqm-autorate-sqm-autorate-*/lib/.': No such file or directory
>>> Making lua and shell files executable...
>>> Putting config file into place...
!!! Warning: An sqm-autorate config file already exists. This new config file will be created as sqm-autorate-NEW. Please review and merge any updates into your existing sqm-autorate file.
cp: can't stat '/tmp/sqm-autorate-sqm-autorate-*/config/sqm-autorate.config': No such file or directory
>>> Putting service file into place...
cp: can't stat '/tmp/sqm-autorate-sqm-autorate-*/service/sqm-autorate.service': No such file or directory
>>> Updating VERSION string to include:   [release]
>>> Cleaning up temporary files...
rm: can't remove '/tmp/sqm-autorate-install.tar.gz': No such file or directory
rm: can't remove '/tmp/sqm-autorate-sqm-autorate-*': No such file or directory
>>> Installation complete, about to start configuration.
/usr/lib/sqm-autorate/configure.sh: line 1: 404:: not found

All "successfully" installed files will say 404: Not Found when using either version

I have manually pulled all the files , made the necessary executable in order to test the script and it works great, I do like the lua version quite a bit as it seems to be more responsive in comparison to the bash ./sh version made by lynx

It's highly possible my isp may be blocking the raw githubusercontent stuff/ direct tar. I'm unsure as to why only this repository has an issue, (i tried to fork and use chas-iot's original install method with changing the lines necessary to get it to work, however all the files will.. still get a 404 error~)

mtompkins commented 7 months ago

Seeing this as well - sharing confirmation

cchance27 commented 7 months ago

Same issue and i'm not on a RPI-5 i'm on a linksys e8450

SuperMewio commented 4 months ago

I have manually pulled all the files , made the necessary executable in order to test the script and it works great, I do like the lua version quite a bit as it seems to be more responsive in comparison to the bash ./sh version made by lynx

And how can I go about doing this? I am having 100% the same issue.

GLareFLare22 commented 4 months ago

I have manually pulled all the files , made the necessary executable in order to test the script and it works great, I do like the lua version quite a bit as it seems to be more responsive in comparison to the bash ./sh version made by lynx

And how can I go about doing this? I am having 100% the same issue.

Oh boy, uhhh I'll try to explain it.

assuming you already ssh'd into your device

first you wanna

opkg update; opkg install lua luarocks lua-bit32 luaposix lualanes lua_argparse curl

[you dont neeeed lua-argparse and curl but best to install as thats what the setup.sh does]

then you need luarocks to install vstruct to do that you need to

luarocks install vstruct

after that on the main sqm-autorate on github page the service folder has the service file(which you just have to copy the entire code manually for all files ( ex. nano /etc/init.d/sqm-autorate ) paste the sqm-autorate.service code into that file with nano and a right click~

which goes into~ (use chmod +x "name of file" without the quotes... oooor if you want to make an entire .sh/.lua files executable [which is what the +x does you will need to do " chmod +x .lua, chmod +x .sh "])

/etc/init.d/sqm-autorate

now all of the files in the github sqm-autorate main pages lib folder should go into your openwrts

/usr/lib/sqm-autorate

just cd /usr/lib/sqm-autorate, and manually nano or whatever your favorite editor is "name of the files include the .sh/.lua/.csv" and paste the code of those files~ for ex since you're already cd'd into /usr/lib/sqm-autorate you just need to nano file name.sh/lua/whatever if sqm-autorate folder doesn't exist then.... do a mkdir /usr/lib/sqm-autorate

after all is done and done while still cd'd into the /usr/lib/sqm-autorate directory just

chmod +x .sh; chmod +x .lua

which will make the .sh and .lua files executable by openwrt when the service file is enabled and started

But dont forget about the config file which will be placed via nano in /etc/config/sqm-autorate change whatever you want to set your settings as and then do a

service sqm-autorate enable; service sqm-autorate start

SuperMewio commented 4 months ago

Thank you so much for getting back to me! I will look into this a bit later after work.