Can't connect to couchbase via php - php

I have this strange issue that I'm banging my heads off. It works on dev machine but when I moved it to prod machine, I got this error:
FastCGI-stderr: PHP Fatal error: Uncaught exception 'CouchbaseLibcouchbaseException' with message 'Failed to create libcouchbase instance: Administrator account must not be used to access the data in the bucket' in /var/www/myapps/Bootstrap.php:149
This is line 149:
$couchbase = new Couchbase($db['host'],$db['username'],$db['password'], $db['dbname']);
Did I miss something? I turn off all my firewall and selinux to make sure it's not their issue. Still the same..
I'm using:
CentOS 6.4 64Bit
Couchbase 2.01
whatever the php-ext-couchbase define in this repo:
http://packages.couchbase.com/rpm/couchbase-centos62-x86_64.repo
I can login with no issue via browser with the same username and password.
The question is, is this really an account issue? If it is then how or where do I create another user? Can't seem to find it anywhere in the documentation.
If not, any suggestion on how I should debug this? Please help?

Is your bucket password protected? If not, just pass a blank user id and password to the connect. To find out if it has a password go to the bucket configuration area (Data Buckets, Click the down arrow, click the "edit" button). The password is set under "access control"
on the edit screen.

Related

SilverStripe - The website server has not been able to respond to your request

I'm trying to create my first SilverStripe website following this tutorial.
So far I have created my website and configured my .env page.
# DB credentials
SS_DATABASE_CLASS="MySQLDatabase"
SS_DATABASE_SERVER="localhost"
SS_DATABASE_USERNAME="root"
SS_DATABASE_PASSWORD=""
SS_DATABASE_NAME="SS_examples"
SS_ENVIRONMENT_TYPE="dev"
I'm not sure entirely how the database is created when creating a site. I checked my databases and I do not have one for it. I can make one manually but I wasn't sure if I should and list it under SS_DATABASE_NAME, or if it will auto-create the db.
I'm assuming this is why when I visit my local site localhost/SSexample/public I get an error saying "The website server has not been able to respond to your request".
Am I missing a step in setting up the site or should I manually create a db named SS_examples?
on a side note my apache server is set up with xampp and my SilverStripe project is in C:/xamp/htdocs.
Steps I took to create site:
Built site in C:\xampp\htdocs by running: composer create-project silverstripe/installer SSexample
Visited my project by going to localhost/SSexample/public
created .env file as listed above
ERROR LOGS
[2019-12-31 22:29:22] error-log.ERROR: Uncaught Exception SilverStripe\ORM\Connect\DatabaseException: "Couldn't run query: SELECT DISTINCT "SiteConfig"."ClassName", "SiteConfig"."LastEdited", "SiteConfig"."Created", "SiteConfig"."Title", "SiteConfig"."Tagline", "SiteConfig"."CanViewType", "SiteConfig"."CanEditType", "SiteConfig"."CanCreateTopLevelType", "SiteConfig"."ID", CASE WHEN "SiteConfig"."ClassName" IS NOT NULL THEN "SiteConfig"."ClassName" ELSE 'SilverStripe\\SiteConfig\\SiteConfig' END AS "RecordClassName" FROM "SiteConfig" LIMIT 1 Table 'ss_lessons.siteconfig' doesn't exist" at C:\xampp\htdocs\SSlessons\vendor\silverstripe\framework\src\ORM\Connect\DBConnector.php line 64 {"exception":"[object] (SilverStripe\\ORM\\Connect\\DatabaseException(code: 0): Couldn't run query:\n\nSELECT DISTINCT \"SiteConfig\".\"ClassName\", \"SiteConfig\".\"LastEdited\", \"SiteConfig\".\"Created\", \"SiteConfig\".\"Title\", \"SiteConfig\".\"Tagline\", \"SiteConfig\".\"CanViewType\", \"SiteConfig\".\"CanEditType\", \"SiteConfig\".\"CanCreateTopLevelType\", \"SiteConfig\".\"ID\", \n\t\t\tCASE WHEN \"SiteConfig\".\"ClassName\" IS NOT NULL THEN \"SiteConfig\".\"ClassName\"\n\t\t\tELSE 'SilverStripe\\\\SiteConfig\\\\SiteConfig' END AS \"RecordClassName\"\n\r\nFROM \"SiteConfig\"\n\r\nLIMIT 1\n\nTable 'ss_lessons.siteconfig' doesn't exist at C:\\xampp\\htdocs\\SSlessons\\vendor\\silverstripe\\framework\\src\\ORM\\Connect\\DBConnector.php:64)"} []
It seems that the installer at localhost/SSexample/public should allow you to configure your database connection settings (and create the database for you).
Getting The website server has not been able to respond to your request error means that you have a problem with webserver - is it running?
EDIT: The website server has not been able to respond to your request is actually Silverstripe's generic error 500 message.
EDIT2: one has to enable dev environment - by adding SS_ENVIRONMENT_TYPE="dev" to .env file and then access localhost/SSexample/public/dev/build to get database created and populated.

Fresh-installation laravel project can't access postgresql database but can do php migrate

I already asked a question about this 2 days ago, here are the links
Got "password authentication failed for user" but in pgAdmin 3 its working
But I still didn't get an answer to solve the problem.
So I tried to create a new laravel project, then edit the .env file, check if php artisan migrate can run.
After I run php artisan migrate it's running, so it means that my credentials to PostgreSQL database are correct right? if not it will tell you password authentication failed for user "postgres", but I don't get any error at all, so I go to the next step. Now after I make sure everything is OK i run php artisan make:auth, it's a success without error at all, so I go to the web browser then run the site, I clicked the register / login button, fill the fields, submit then, it's happened again the nightmare
I got this message from the website
SQLSTATE[08006] [7] FATAL: password authentication failed for user "postgres" FATAL: password authentication failed for user "postgres" (SQL: select count(*) as aggregate from "users" where "email" = test#test.com)
Even though php artisan migrate run really well, so I've no idea why it's happening. Is there somebody that ever run into this problem before? or maybe why it's happening?
I already search all keywords that possible to fix this problem, but I can't found the answer, it's really stressed me out.
for the info I'm using:
PostgreSQL 9.6.8
Laravel 5.6
Ubuntu 17.10
Edited: Here is my pg_hba.conf
Check your database.php file in config directory, and check the pgsql array. If accessing DB credential values from .env not worked there, test it by directly putting credentials there. hope it will help. Artisan commands work by accessing the credentials from .env files directly,not from database.php that's why migration worked.
I had a similar problem, my generated password contained the character: '#'. This made it a comment line, ignoring the rest of the password. I just changed my password.

Failed to connect to Recurly Could not resolve host

I'm currently developing a plugin for wordpress that uses recurly for subscription. I already uploaded it to our site and resume coding there. I'm already done with the checkout page and was in the middle of developing the accounts page when I run into an error:
Fatal error: Uncaught exception 'Recurly_ConnectionError' with message 'Failed to connect to Recurly (Could not resolve host: xx-my-subdomain-xx.recurly.com)
xx-my-subdomain-xx is the placeholder for the subdomain
I already increased the connection timeout to 30 but my effort was futile. I tried testing it in my localhost and found out that it was working. I think i has something to do with the cURL but I can't point out what's causing the problem.
Any help would be appreciated.
Recurly_Client::$subdomain = 'your-subdomain-name'; // i.e devapp,myapp..etc
You don't need to write whole subdomain URL you just need to pass your subdomain name which is found in configuration -> site setting (Only the name of the subdomain).
I hope this will solve your issue as I also got the same error after this change its working fine for me.
Provide your subdomain as follows
Recurly_Client::$subdomain = "Your RECURLY_SUBDOMAIN";
Then add your API key and certificate path as follows
Recurly_Client::$apiKey = "Your RECURLY_API_KEY";
Recurly_Client::$CACertPath = "Your RECURLY_OPENSSL_CertificatePATH";
I hope this will work for you.

Twitter OAuth failing to work (PHP)

I have the TwitterOAuth class and demonstration running on a local development server and I cannot get it to authorize. I have entered the new CONSUMER_KEY and CONSUMER_SECRET in the config.php. I have also synced the server time to NTP. I get the error message: 'Could not connect to Twitter. Refresh the page or try again later.'
var_dump($connection->http_code);
results:
int 0
ANY help or advise would be appreciated.
I am running PHP 5.3
When I try to ping the api server I can't.
C:\Users\Owner>ping api.twitter.com
Ping request could not find host api.twitter.com. Please check the name and try
again.
could this be the problem ?
I had some issues with this process as well. I don't exactly recall what resolved this error, but I followed This Tutorial (albeit a bit out of date) and made sure I explicitly set the callback URL in the twitter panel for my app. Also, and I believe this one also caused the int 0 return for me, make sure that if you are going with a hosting provider they allow CURL requests.
step 1: https://apps.twitter.com/app or go to your app setting
step 2: Unchecked the (Enable Callback Locking (It is recommended to enable callback locking to ensure apps cannot overwrite the callback url)) This box..
save and exit and check..
ThankYou..!

Unable to connect to the database mysql?

I've downloaded the wamp server and it's online. I'm trying to install Joomla.
At page 4 I'm told Unable to connect to the database
An error has occurred:The database details provided are incorrect and/or empty.
Can anyone help me in fixing this error?
This problem has been fixed by Ocaso Protal, finaly this page ocurs
what should I put here ?Site Name? nd finaly why should i use joomla any specific properties of this product ?
Even if you use the default settings for mysql (user: root, password empty) you should put the username root in the Username field in the form that's showed in your first screenshot.
You must check these things before
Setup a blank database from the Cpanel/Mysql Admin
Fix the username/password and user permissions on this database
Run Joomla... and give it the above credentials + localhost
Make sure you have 777 or adequate permissions otherwise some errors may occur#
If im not mistaken the default account for wamp/xamp myqsl is
user: "root"
password: ""
//Password is null - do not write nothing inside

Categories