Katiyman
Katiyman

Reputation: 846

Fabric-Ca server setup issue

I am using the given link for exploring the fabric-ca http://fabric-ca.readthedocs.io/en/latest/users-guide.html

Following the content in the link, I am trying to setup fabric-ca-server with mysql as DB and I am specifying the below config for the same in the fabric-ca-server-config.yaml

db:
  type: mysql
  datasource: root:**123#@tcp(localhost:3306)/fabric_ca?parseTime=true
  tls:
      enabled: false
      certfiles:
        - db-server-cert.pem
      client:
        certfile: db-client-cert.pem
        keyfile: db-client-key.pem

I do not pass the argument tls=custom in 'datasource' above as I am not using the TLS

Upon server startup I get

root@Openwhisk-Node2-172:~/fabric-ca/fabric-ca-server# fabric-ca-server start -b admin:adminpw
2017/09/05 15:25:17 [INFO] Configuration file location: /root/fabric-ca/fabric-ca-server/fabric-ca-server-config.yaml
2017/09/05 15:25:17 [INFO] Starting server in home directory: /root/fabric-ca/fabric-ca-server
2017/09/05 15:25:17 [INFO] The CA key and certificate already exist
2017/09/05 15:25:17 [INFO] The key is stored by BCCSP provider 'SW'
2017/09/05 15:25:17 [INFO] The certificate is at: /root/fabric-ca/fabric-ca-server/ca-cert.pem
2017/09/05 15:25:17 [INFO] Initialized mysql database at root:Nokia123#@tcp(localhost:3306)/fabric_ca?parseTime=true
2017/09/05 15:25:17 [INFO] Home directory for default CA: /root/fabric-ca/fabric-ca-server
2017/09/05 15:25:17 [INFO] Listening on %!s(int=7054)%!(EXTRA string=http://0.0.0.0:7054)

but when I try to use the client for enroll bootstrap identity, I get

fabric-ca-client enroll -u http://admin:adminpw@localhost:7054
2017/09/05 15:27:40 [INFO] User provided config file: /root/fabric-ca/fabric-ca-client1/admin/fabric-ca-client-config.yaml
2017/09/05 15:27:40 [INFO] Created a default configuration file at /root/fabric-ca/fabric-ca-client1/admin/fabric-ca-client-config.yaml
2017/09/05 15:27:40 [INFO] generating key: &{A:ecdsa S:256}
2017/09/05 15:27:40 [INFO] encoded CSR
Error: Error response from server was: Authorization failure

The database is up. I have also created a database with name fabric_ca NO_ZERO_DATE related changes are also done

Kindly help. let me know if some steps I have missed or if I have done something wrong

Upvotes: 0

Views: 1360

Answers (1)

Gari Singh
Gari Singh

Reputation: 12013

If you actually created the database prior to running the fabric-ca-server that's likely the issue. The code currently just checks to see if the database exists. If it exists, then it does not run any of the SQL setup scripts. So the best best is to just start with a clean MYSQL which does not have any database instance created.

Upvotes: 1

Related Questions