GithubHelp home page GithubHelp logo

swauth-prep taking forever. about swauth HOT 12 CLOSED

gholt avatar gholt commented on September 1, 2024
swauth-prep taking forever.

from swauth.

Comments (12)

gholt avatar gholt commented on September 1, 2024

Hmmm. I should finish in seconds at most. The stacktrace you posted just shows that it's waiting for a response from the server. swauth-prep is just doing HTTP requests to the cluster (you can peek at its source, it's pretty simple). Can you gather the logs from the cluster? That probably indicates what the real problem is.

from swauth.

eviscares avatar eviscares commented on September 1, 2024

The Problem is, that swauth for some reason doesn't produce any logs. This makes diagnosing the error a bit harder.

from swauth.

gholt avatar gholt commented on September 1, 2024

Well Swauth, and Swift for that matter, just use SysLog when logging. You're saying your Swift cluster you are using has no logs whatsoever? If so, that's a whole different issue. How did you set up your cluster? Are you using an all-in-one development-type setup? A multiple server, actual cluster?

from swauth.

pedrojimenez avatar pedrojimenez commented on September 1, 2024

Hi, i am having the same trouble. I have a multinode installation, a single proxy node and a single storage node (both physical). After all day fighting with this error i could finally see a ray of light. I was following the instructions from the official master GIT but in step 5 i was blocked as you.

  1. Initialize the Swauth backing store in Swift swauth-prep -K swauthkey

I have solved this by specifing a different url in this step (my proxy ip is 192.168.1.230) instead of using 127.0.0.1 by default:

 swauth-prep -K "XxpasswordxX" -A https://192.168.1.230:8080/auth 

After this i have begun to receive syslog entries and could debug the rest of steps.
I hope this could fix your problem.

from swauth.

pedrojimenez avatar pedrojimenez commented on September 1, 2024

Now I am getting another error in the following step. I'll try to find out why is not allowing the "PUT command":

 [ proxy:/etc/swift ] swauth-add-user -A https://192.168.1.230:8080/auth/v1.0 -K "XxpasswordxX" -a test tester testing
 Account creation failed: 400 Bad Request
 User creation failed: 400 Bad Request

This is the log in the ProxyNode syslog:

 Sep 29 18:19:22 proxy swauth - 192.168.1.230 29/Sep/2011/16/19/22 PUT /auth/v1.0/v2/test HTTP/1.0 400 - - .super_admin - - - - - 0.0006
 Sep 29 18:19:22 proxy swauth - 192.168.1.230 29/Sep/2011/16/19/22 PUT /auth/v1.0/v2/test/tester HTTP/1.0 400 - - .super_admin - - - - - 0.0118

from swauth.

gholt avatar gholt commented on September 1, 2024

For the swauth- commands, try taking off the /v1.0 part, as in:

swauth-add-user -A https://192.168.1.230:8080/auth -K "XxpasswordxX" -a test tester testing

from swauth.

pedrojimenez avatar pedrojimenez commented on September 1, 2024

Hi gholt, I am trying to create a user with admin privileges but still something escapes me. After various tests finally i changed the password in proxy-server.conf to "sistemas2000" to see the differents errors.
I am running the command without the /v1.0 but nothing happens. The proxy-server only returns an 204 via syslog. This is the output:

 swauth-add-user -A https://192.168.1.230:8080/auth/ -K sistemas2000 -a test tester testing

 LOG: 
 Sep 30 10:35:46 proxy proxy-server - - 30/Sep/2011/08/35/46 HEAD /v1/AUTH_.auth/test HTTP/1.0 204 - Swauth - - - - - - 0.0063

from swauth.

pedrojimenez avatar pedrojimenez commented on September 1, 2024

Hi i am reporting good news. Finally i got the way to create Accounts/Users in the following steps.
First, let me expose my actual lab. I have one node for Proxy/Auth (Public IP 192.168.1.230 and Private IP 10.10.10.1) and a single node for Storage (10.10.10.2). I could connect finally the auth by inserting this line in the proxy-server.conf

 default_swift_cluster = local#https://192.168.1.230:8080/v1#https://10.10.10.1:8080/v1

After this change, i had to restart my proxy and re-prep swauth.

 swift-init proxy reload
 swauth-prep -K sistemas2000 -A https://192.168.1.230:8080/auth/

I had several test accounts (test, mycompany and external) created, but when i try to operate with them i recieve a "404" message.

     [ proxy:/etc/swift ] swauth-list -K sistemas2000 -A https://192.168.1.230:8080/auth 

{"accounts": [{"name": "external"}, {"name": "mycompany"}, {"name": "test"}]}
[ proxy:~/swauth ] swauth-list -K sistemas2000 -A https://192.168.1.230:8080/auth/ test
List failed: 404 Not Found

Once the modification is done, i tried to create another account first. I received no error and create the account. Tryng to list the new account is now available.

 [ proxy:/etc/swift ] swauth-add-account -K sistemas2000 -A https://192.168.1.230:8080/auth/ auditors
 [ proxy:/etc/swift ] swauth-add-user -K sistemas2000 -A https://192.168.1.230:8080/auth/ -a auditors auditor1 auditor1
 [ proxy:/etc/swift ] swauth-list -K sistemas2000 -A https://192.168.1.230:8080/auth auditors

{"services": {"storage": {"default": "local", "local": "https://192.168.1.230:8080/v1/AUTH_e49e4b90-3433-4e29-a7d5-7fa42a7b77c0"}}, "account_id": "AUTH_e49e4b90-3433-4e29-a7d5-7fa42a7b77c0", "users": [{"name": "auditor1"}]}

 LOG:
 Sep 30 14:44:37 storage account-server 10.10.10.1 - - [30/Sep/2011:12:44:37 +0000] "GET /sdb1/240802/AUTH_.auth" 200 - "-" "-" "Swauth" 0.0023 ""
 Sep 30 14:44:37 storage account-server 10.10.10.1 - - [30/Sep/2011:12:44:37 +0000] "GET /sdb1/240802/AUTH_.auth" 200 - "-" "-" "Swauth" 0.0021 ""

from swauth.

gholt avatar gholt commented on September 1, 2024

pedrojimenez, I'm glad you got things mostly working now (I just woke up and saw your updates). It looks like I really need to write up some install docs on the Swauth-side of things. I didn't realize how poor that documentation was since the Swift/Swauth project separation.

For those accounts that aren't working (404) you may need to recreate them again now that everything is set up correctly.

It does seem weird that you had to specify the two-url format for the default_swift_cluster setting. It seems like your proxy server should be able to connect to itself with either IP. Is there some odd firewall rules or something?

from swauth.

gholt avatar gholt commented on September 1, 2024

Okay, I'm trying to craft better documentation with a preview at http://gholt.github.com/swauth/dev/

Let me know if you have any suggestions.

from swauth.

zc888168 avatar zc888168 commented on September 1, 2024

hello,gholt, when i do the command "swauth-prep -K key -A https://127.0.0.1:8080/auth " -a system root testpass".The results is ' Traceback (most recent call last): File "/usr/bin/swauth-prep",line23 in from swift.common.utils import urlparse from swift.common.utils import urlparse ImportError :cannot imoprt name urlparse" ?how can I sloved this problem?

from swauth.

gholt avatar gholt commented on September 1, 2024

Sounds like you're running a really old version of Python 2 or you're running Python3? Swauth was written for 2.6 but should work with 2.7 as well.

from swauth.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.