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

AUR >= v6.0.0 Released, /rpc.php endpoint no longer exists #1684

Closed
kevr opened this issue Feb 4, 2022 · 21 comments
Closed

AUR >= v6.0.0 Released, /rpc.php endpoint no longer exists #1684

kevr opened this issue Feb 4, 2022 · 21 comments

Comments

@kevr
Copy link

kevr commented Feb 4, 2022

Affected Version

HEAD

Describe the bug

yay uses /rpc.php to query the AUR's RPC API. With the release of v6.0.0, this is no longer supported as we no longer host PHP code.

Expected behavior

Use /rpc to query the AUR's RPC API.

Extras

See https://aur.archlinux.org/rpc for documentation on using the RPC. Please stick to what the documentation suggests, as the doc is what is always going to be upheld (or changed if the time comes).

With the new AUR RPC API, trailing slashes are being rewritten to their unslashed counterparts, which seems to be causing some issues as well.

I've made some fixes to rollback some of the issues these changes have caused; see https://lists.archlinux.org/pipermail/aur-general/2022-February/036787.html for more info.

@chrisjbillington
Copy link

chrisjbillington commented Feb 5, 2022

For a filthy hack to fix this locally without rebuilding yay, you can patch the URL in an installed yay binary like so:

$ sudo sed -i 's:rpc.php:rpc////:g' /usr/bin/yay

(This replaces rpc.php with rpc////, with the extra slashes ensuring it has the same length - so as not to mess up the position of things in the executable - but which still results in the correct URLs)

Then you can just wait for yay to update itself with the correct fix once released.

Edit: the trailing slashes seem to be causing a problem for some still. This alternative from @pmarreck (link)
that uses percent escapes instead of slashes to bulk up the string length might be more reliable:

$ sudo sed -i.bak 's:rpc\.php:r%70%63:g' `which yay`

(note: this also creates a backup /usr/bin/yay.bak in case you need to revert the change)

@Shakespeare17
Copy link

How long do i have to stare at this screen before I can fix thing like this on my own?

@alpsAyon
Copy link

alpsAyon commented Feb 5, 2022

How long do i have to stare at this screen before I can fix thing like this on my own?

have you tried the filthy solution suggested above?? Try if it works for you.

@Shakespeare17
Copy link

How long do i have to stare at this screen before I can fix thing like this on my own?

have you tried the filthy solution suggested above?? Try if it works for you.

well to be honest, now Im justa touch paranoid bout running it

@alpsAyon
Copy link

alpsAyon commented Feb 5, 2022

How long do i have to stare at this screen before I can fix thing like this on my own?

have you tried the filthy solution suggested above?? Try if it works for you.

well to be honest, now Im justa touch paranoid bout running it

I think I get what you mean, then you could just wait for yay to update itself. hope it will be soon since a lot of people are having the issue.

@daciwolf
Copy link

daciwolf commented Feb 5, 2022

For a filthy hack to fix this locally without rebuilding yay, you can patch the URL in an installed yay binary like so:

$ sudo sed -i 's:rpc.php:rpc////:g' /usr/bin/yay

(This replaces rpc.php with rpc////, with the extra slashes ensuring it has the same length - so as not to mess up the position of things in the executable - but which still results in the correct URLs)

Then you can just wait for yay to update itself with the correct fix once released.

this workkkkssssssssssssss. Awesome job, you really saved me some trouble cause i was about to do a global search for something like this.

@cotantikDEV
Copy link

How long do i have to stare at this screen before I can fix thing like this on my own?

have you tried the filthy solution suggested above?? Try if it works for you.
It works!

@vmasdani
Copy link

vmasdani commented Feb 5, 2022

Filthy workaround does not work for me. I am getting this AUR is unavailable at this moment error

i can revert to the default yay without the workaround being applied by using yay -Syu yay though

Screenshot_20220205_121801

@chrisjbillington
Copy link

chrisjbillington commented Feb 5, 2022

You might try (on an unmolested yay binary) this somewhat improved version from @pmarreck (link)

It correctly escapes a dot, replaces some chars with their percent encodings to keep the length the same instead of inserting extra slashes, and looks up the location of the yay binary dynamically, and saves a backup yay.bak.

sudo sed -i.bak 's:rpc\.php:r%70%63:g' `which yay`

But honestly none of this should make a difference. The dot will match any character - and it's unlikely there's any other string that's rpc.php except with a different char in place of the dot. And the slashes seem to be happily ignored by the server. And /usr/bin/yay appears to exist on your system since the sed command doesn't error. So I'm not sure why the fix isn't working for you. The error you're seeing is also different.

@kevr
Copy link
Author

kevr commented Feb 5, 2022

There is a pull request up which addresses this. It involves replacing /rpc.php/ with /rpc across the codebase.: #1685.

That being said, we do have an issue since /rpc.php support as been removed, which is that yay users (if they don't know how to manually download and install the new version) wouldn't be able to upgrade to the new version using yay.

We've addressed this temporarily by removing RPC redirection from trailing slashes permanently and supporting /rpc.php temporarily. It'll be deployed out in several hours. For now, you can build their branch if you want a temporarily working yay.

See https://lists.archlinux.org/pipermail/aur-general/2022-February/036787.html

@vmasdani
Copy link

vmasdani commented Feb 5, 2022

You might try (on an unmolested yay binary) this somewhat improved version from @pmarreck link

It correctly escapes a dot, replaces some HTML chars with their percent encodings to keep the length the same instead of inserting extra slashes, and looks up the location of the yay binary dynamically, and saves a backup yay.bak.

sudo sed -i.bak 's:rpc\.php:r%70%63:g' `which yay`

But honestly none of this should make a difference. The dot will match any character - and it's unlikely there's any other string that's rpc.php except with a different char in place of the dot. And the slashes seem to be happily ignored by the server. And /us/bin/yay appears to exist on your system since the sed command doesn't error. So I'm not sure why the fix isn't working for you. The error you're seeing is also different.

surprisingly this one works, i also agree that the @pmarreck 's solution should not differ from this one. Yes, /usr/bin/yay exists in my system

@TheSecureTux
Copy link

The 'filthy' hack worked as a charm for me with

❯ yay --version
yay v11.1.0 - libalpm v13.0.1
❯ file /usr/bin/yay
/usr/bin/yay: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=37e55757404a4a772fb57ace095099e39b36e73c, for GNU/Linux 4.4.0, stripped
❯ sudo sed -i 's:rpc.php:rpc////:g' /usr/bin/yay
[sudo] password for tux:

image

@Aeres-u99
Copy link

Can confirm it works.
image

@zulc22
Copy link

zulc22 commented Feb 5, 2022

For a filthy hack to fix this locally without rebuilding yay, you can patch the URL in an installed yay binary like so:

$ sudo sed -i 's:rpc.php:rpc////:g' /usr/bin/yay

this only kinda works. i don't know how to do so with sed, but you would have to replace the trailing slashes with NUL bytes to make that binary patch work properly.
a more proper solution until the changes are merged and released is to download the yay-git AUR package and replace Jguer with mh4ckt3mh4ckt1c4s, to compile the yay source from the PR.

git clone https://aur.archlinux.org/yay-git.git
cd yay-git
sed -i 's:Jguer:mh4ckt3mh4ckt1c4s:g' PKGBUILD
makepkg -si

@0Karakurt0
Copy link

update itself

it can't, this issue is messing with the very ability to access AUR

@kevr
Copy link
Author

kevr commented Feb 5, 2022

The update issue will be resolved within some hours from now The update issue has been resolved for the next month; please read https://lists.archlinux.org/pipermail/aur-general/2022-February/036787.html

For now you can patch the binary or install the PR branch, or wait until they're deployed.

As @zulc22 suggests, this is the best way on Arch to get it done currently.

h-michael added a commit to h-michael/aur that referenced this issue Feb 5, 2022
It seems that the "/rpc.php" endpoint is no longer supported as described in this issue.
Jguer/yay#1684

Although it seems to be available again for a month as a temporary measure.
https://gitlab.archlinux.org/archlinux/aurweb/-/commit/101de8e7b18916dd84ae52d39fb853924ea63a42
PyvesB pushed a commit to badges/shields that referenced this issue Feb 5, 2022
Before this fix, the AUR badges were showing "not found".

See Jguer/yay#1684
@Jguer
Copy link
Owner

Jguer commented Feb 6, 2022

Closing this issue as fixed on yay-git and on imminent release after some fast QA.

#1685 (comment)

Fixed by #1685

@Jguer Jguer closed this as completed Feb 6, 2022
@needhourger
Copy link

I come across the same issue. Eventhrough it seems that this issue have already been fixed.
I try yay and yay-git the latest version. But i still get the same error?

response decoding failed: invalid character '<' looking for beginning of value

@zulc22
Copy link

zulc22 commented Feb 28, 2022

response decoding failed: invalid character '<' looking for beginning of value

I am having no problems using yay. What command are you trying to run?

@Jguer
Copy link
Owner

Jguer commented Feb 28, 2022

I come across the same issue. Eventhrough it seems that this issue have already been fixed. I try yay and yay-git the latest version. But i still get the same error?

response decoding failed: invalid character '<' looking for beginning of value

@needhourger Probably issues with the AUR URL.

Please ensure your aururl is set to https://aur.archlinux.org in ~/.config/yay/config.json or via environment variables

@needhourger
Copy link

Tanks it already fixed!

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

No branches or pull requests