You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by GitBox <gi...@apache.org> on 2020/08/05 13:31:37 UTC

[GitHub] [couchdb-nano] dsebastien opened a new issue #229: You are not a server admin error

dsebastien opened a new issue #229:
URL: https://github.com/apache/couchdb-nano/issues/229


   <!--- Provide a general summary of the issue in the Title above -->
   
   ## Expected Behavior
   Stable connection to CouchDB
   
   ## Current Behavior
   Sometimes, I receive the "You are not a server admin" error when performing requests using my back-end server. I suppose that it is due to the way that I create the DB connection.
   
   I'm currently using the following code:
   
   ```
   export const databaseConnection: ServerScope = nano({
     url: environment.databaseConfiguration.url,
     requestDefaults: {
       // enable cookie-based authentication
       // Reference: https://www.npmjs.com/package/nano#using-cookie-authentication
       jar: true,
       auth: {
         username: environment.databaseConfiguration.username,
         password: environment.databaseConfiguration.password,
       },
     },
   ```
   
   Later, in my repository code, I simply use that constant to make database calls:
   
   ```
   public ensureThatWorkspaceExists(workspaceId: string): Observable<boolean> {
       return from(this.databaseConnection.db.list()).pipe(
         switchMap((databasesList) => {
           const databaseExists = databasesList.filter((existingDatabase) => {
             return existingDatabase === workspaceId;
           });
   
           if (databaseExists.length === 0) {
             throw new GateTechnicalError(GateTechnicalErrorType.DATABASE_NOT_FOUND);
           }
           return of(true);
         }),
       );
     }
   ```
   
   ## Context
   I've tried to configure cookie authentication in order to streamline things, but I suppose that I'm not using it correctly?
   What surprises me is that it seems to work, most of the time, except that:
   * it seems to fail if my API server is started before CouchDB
   * it seems to fail after a while (when the cookie expires??)
   
   When it fails, I get the "You are not a server admin" response when I try to make calls. Restarting the back-end server (not Couch) fixes the issue temporarily.
   
   What would you recommend to avoid having such issues?
   
   ## Your Environment
   <!--- Include as many relevant details about the environment you experienced the bug in -->
   * Version used: 8.2.2
   * Browser Name and version: N/A
   * Operating System and version (desktop or mobile): Linux (Ubuntu 20.20)
   * Link to your project: N/A
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [couchdb-nano] dsebastien commented on issue #229: You are not a server admin error

Posted by GitBox <gi...@apache.org>.
dsebastien commented on issue #229:
URL: https://github.com/apache/couchdb-nano/issues/229#issuecomment-717943290


   No, it is a single node.
   For the moment, I've disabled cookie authentication as the issue continued to occur from time to time.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [couchdb-nano] dsebastien edited a comment on issue #229: You are not a server admin error

Posted by GitBox <gi...@apache.org>.
dsebastien edited a comment on issue #229:
URL: https://github.com/apache/couchdb-nano/issues/229#issuecomment-760502361


   I think so, yes. I actually disabled the following setting: "allow_persistent_cookies". I guess I wanted to be overprotective, by avoiding "forever" cookies, and instead created a situation where I have "never" cookies? ;-)


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [couchdb-nano] janl commented on issue #229: You are not a server admin error

Posted by GitBox <gi...@apache.org>.
janl commented on issue #229:
URL: https://github.com/apache/couchdb-nano/issues/229#issuecomment-717815463


   is this by chance against a cluster (and not a single node)?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [couchdb-nano] janl commented on issue #229: You are not a server admin error

Posted by GitBox <gi...@apache.org>.
janl commented on issue #229:
URL: https://github.com/apache/couchdb-nano/issues/229#issuecomment-724667882


   is this maybe related to your configured cookie session time?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [couchdb-nano] dsebastien commented on issue #229: You are not a server admin error

Posted by GitBox <gi...@apache.org>.
dsebastien commented on issue #229:
URL: https://github.com/apache/couchdb-nano/issues/229#issuecomment-760502361


   I think so, yes. I actually disabled the following setting: "allow_persistent_cookies". I guess I wanted to be overprotective, by avoiding "forever" cookies, and instead created a situation where I want "never" cookies? ;-)


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org