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

Creating API token does not work #15365

Closed
2 tasks done
rdnixon opened this issue Aug 22, 2024 · 9 comments
Closed
2 tasks done

Creating API token does not work #15365

rdnixon opened this issue Aug 22, 2024 · 9 comments
Labels
🚫 not a bug This issue is not a bug

Comments

@rdnixon
Copy link

rdnixon commented Aug 22, 2024

Debug mode

Describe the bug

When we go to create an API key it comes up with 404 Not found - The resource requested could not be found on this server!
On the help it suggest running a php command - but this does not generate a valid API key - it makes a string - but a very short one. The hosting company, Kualo did take a look (fresh install using their quick install) and found this int he logs:
[22/Aug/2024:02:38:38 +0000] "POST /livewire/update HTTP/1.1" 404 708 "https://rltinventory.co.uk/public/account/api" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:129.0) Gecko/2 0100101 Firefox/129.0" [22/Aug/2024:02:38:39 +0000] "POST /livewire/update HTTP/1.1" 404 708 "https://rltinventory.co.uk/public/account/api" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:129.0) Gecko/2 0100101 Firefox/129.0"

Reproduction steps

  1. Select Manage API keys
  2. Create Key
  3. 404 is presented
    ...

Expected behavior

An API key is generated

Screenshots

Screenshot 2024-08-22 090603

Snipe-IT Version

7.0.11

Operating System

Kualo hosting - Linux angelo.ldn.kualo.net 4.18.0-513.11.1.lve.el8.x86_64 #1 SMP Thu Jan 18 16:21:02 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

Web Server

Apache I think

PHP Version

8.1.29

Operating System

Windows

Browser

Chrome

Version

127.0.6533.120

Device

No response

Operating System

No response

Browser

No response

Version

No response

Error messages

404 error trying to make an api key. Cannot reproduce on the demo as its turned off. Not really sure which bit of the debug screen to provide. Nothing in the bit that says logs. The livewire but gives personal-access-tokens #1sW9LUoTbMfTGS1pO028
array:4 [ "data" => array:2 [ "name" => null "newTokenString" => null ] "name" => "per...

Additional context

Fresh install on Kualo hosting installed via their one click install. Everything else works fine - but do need API access to work. Any ideas would be welcome. They said post here as they did not know!

Copy link

welcome bot commented Aug 22, 2024

👋 Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.

@snipe
Copy link
Owner

snipe commented Aug 22, 2024

Per the docs, you should never have public in your URL (I do see that you've at least set up redirects, but the document root should be set to public so that you don't need public in your URL.) When you have public in your URL, the app thinks you're running this in a subdirectory, so you need to add the livewire prefix. https://snipe-it.readme.io/docs/subdirectories#add-the-livewire-config-variable

Snipe-IT Documentation
Snipe-IT really wants to be run as a subdomain or on its own domain name. If you wish to run Snipe-IT in a subdirectory ( https://yourserver.com/snipe-it ) instead of at a primary domain ( http://yourserver.com ) or a sub-domain ( https://snipe-it.yourserver.com ), you'll need to go through the stan...

@rdnixon
Copy link
Author

rdnixon commented Aug 22, 2024

Many thanks for getting back to me. To be honest - Kualo just step this up - not me. I did wonder about the public bit in the url they popped in. I'll feed this back to them and have a go at what it says in that doc.

@snipe
Copy link
Owner

snipe commented Aug 22, 2024

I don't know who or what Kualo is 😂 But at least they seem to have covered the security basics, i.e. your .env file isn't exposed to the outside world, and it's redirecting if I try to access one level up, so that's good. That liveware prefix (until/unless you change the URL so that public isn't in there anymore) would be /public.

@rdnixon
Copy link
Author

rdnixon commented Aug 22, 2024

They are a hosting company that does one click installs. I'll talk to them and see what they say.

@snipe
Copy link
Owner

snipe commented Aug 22, 2024

Ahh, they're probably using Softaculous. That's the "packaging up open source projects and make them one-click" company, usually done via cPanel integration. Unfortunately, Softaculous doesn't share their process with us, so we don't really know what their installer thingie does (or doesn't do.)

@rdnixon
Copy link
Author

rdnixon commented Aug 22, 2024

I have tried changing LIVEWIRE_URL_PREFIX=/public

Making an API key gives the same error. Maybe there is some other issue as well.

@snipe snipe added the 🚫 not a bug This issue is not a bug label Aug 22, 2024
@rdnixon
Copy link
Author

rdnixon commented Aug 22, 2024

Think they have sorted it out. The public bit is gone and API is working grand now. Many thanks for pointed us and them in the right direction. Think its going to be great for our schools.

@snipe
Copy link
Owner

snipe commented Aug 22, 2024

@rdnixon Great, glad to hear you're sorted!

@snipe snipe closed this as completed Aug 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🚫 not a bug This issue is not a bug
Projects
None yet
Development

No branches or pull requests

2 participants