Getting `Unsupported get request` error only on certain ID - facebook

I'll start with example, so it will be easier to understand. So I have this script:
FacebookSession::setDefaultApplication('536443039714362', '007d98b0f51f3ffecb206987fc3bc624');
$session = new FacebookSession('access-token');
$session = FacebookSession::newAppSession();
$event = (new FacebookRequest(
$session, 'GET', '/loftasvilnius'))->execute()->getGraphObject(GraphUser::className())->asArray();
As you see It gets info of page with prefix 'loftasvilnius'. And everything works fine here.
Hovewer if I change name of page to 'Opiumclub'. API throws this error message:
Fatal error: Uncaught exception 'Facebook\FacebookAuthorizationException' with message 'Unsupported get request. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api' in D:\xampp\htdocs\fb\src\Facebook\FacebookRequestException.php:104 Stack trace: #0 D:\xampp\htdocs\fb\src\Facebook\FacebookRequest.php(268): Facebook\FacebookRequestException::create('{"error":{"mess...',
Could someone explain that's wrong here ?
I tried to do this through graph explorer in facebook dev page. And here it worked ok.

Related

How to get a part of the string as the output from an eventlog full message using PowerShell?

I am trying to extract some part of the message from the event log output.
I ran the below command:
$filterXml = ‘<QueryList>
<Query Id="0" Path="atm">
<Select Path="atm">*[System[(Level=2)]]</Select>
</Query>
</QueryList>’
$event = Get-WinEvent –FilterXml $filterXml
I am using different methods to get the desired output required by running the below commands but none worked out properly. Maybe I did not try and worked out it perfectly.
$event.Message.Substring(56,139)
$event.Message.split(":")
$event =
[int]($event.message | Select-String "jobId").Matches.Groups[2].Value
My output:
Message: Shell.SmartM.atm.Service.atmServiceException: {jobId:38895,name:All Reports: Kiran, Kumar,reportConfigurationId:1805
0,status:Error} --- Shell.SmartM.atm.Service.DataException: An error occurred while attempting to retrieve data from system. --- System.InvalidOperationException: Request to system failed with status code NotFound --- System.Exception: {Errors:[An exception has occurred. Please contact your
System administrator for help in enabling debug mode.]} .....
App Domain: /LM/W3SVC/2/
ProcessId: 3696
Win32 ThreadId: 5536
Extended Properties:
UserId: LOCALHOST
I am trying to get values from the above output for
jobid:
name:
Shell.SmartM.atm.Service.DataException:
System.InvalidOperationException:
System.Exception: {Errors:

Symfony 4 built-in server - 'Warning: mkdir(): Permission denied'

I'm working with the KnpSnappyBundle and on trying to create a PDF I get the 500 error Warning: mkdir(): Permission denied
I've looked around and found answers for this questions but they don't seem to specifically relate to the built-in server. I do think that this is a file permissions error but I do not know how to resolve it.
For context, below is the code that is triggering the error:
/**
* #Route("/", name="home")
*/
function mainOverview() {
return new Response(
$this->get('knp_snappy.pdf')
->generate(
'http://www.google.fr',
'/pdf/test.pdf' // **500 error triggers here**
),
200,
array(
'Content-Type' => 'application/pdf',
'Content-Disposition' => 'attachment; filename="file.pdf"'
)
);
}
EDIT 1:
Clarified that this is probably a file permissions error, rather than a coding error.
The permission error is due to the fact that the owner of the process , the symfony server, does not have the permission to create folder under the root directory /
$this->get('knp_snappy.pdf')
->generate(
'http://www.google.fr',
'/pdf/test.pdf' // 500 error triggers here
)
So please change the directory where you generate pdf from '/pdf/test.pdf' to your home directory (~/define/your/path) or where you have permission to create destination directory solve this issue

Mink > Zombie.js Can't Start Session

I am trying to create a Mink Connection With the Zombie Driver But I am Getting an Error. All ports are open and I have tried using my servers IP.
My Code:
$driver = new \Behat\Mink\Driver\ZombieDriver('127.0.0.1');
$zombieSession = new \Behat\Mink\Session($driver);
$zombieSession->start();
Error:
Fatal error: Uncaught exception 'RuntimeException' with message 'Server process has
been terminated: (127) [sh: node: command not found ]' in /home/runniog5/public_html/subdomains/testing4/vendor/behat/mink-zombie-driver/src/Behat/Mink/Driver/NodeJS/Server.php:406
Stack trace: #0 /home/runniog5/public_html/subdomains/testing4/vendor/behat/mink-zombie-driver/src/Behat/Mink/Driver/NodeJS/Server.php(302):
Behat\Mink\Driver\NodeJS\Server->checkAvailability() #1 /home/runniog5/public_html/subdomains/testing4/vendor/behat/mink-zombie-driver/src/Behat/Mink/Driver/ZombieDriver.php(107):
Behat\Mink\Driver\NodeJS\Server->start() #2 /home/runniog5/public_html/subdomains/testing4/vendor/behat/mink/src/Behat/Mink/Session.php(62):
Behat\Mink\Driver\ZombieDriver->start() #3 /home/runniog5/public_html/subdomains/testing4/test.php(114):
Behat\Mink\Session->start() #4 {main} thrown in /home/runniog5/public_html/subdomains/testing4/vendor/behat/mink-zombie-driver/src/Behat/Mink/Driver/NodeJS/Server.php
on line 406
Make sure you have Node installed and it's functional. Server process has
been terminated: (127) [sh: node: command not found ] tells you that shell cannot find node command. To verify you've got it run node -v it should print the current installed version.
The problem is that the ZombieServer doesn't know the path to the binary of your node. To solve this, use this code:
$zombieServer = new ZombieServer($host, $port, $pathToYourNodeBinary, $serverPath, $threshold, $pathToYourNodeModules);
$zombieDriver = new ZombieDriver($zombieServer);
$session = new Session($zombieDriver);
$mink = new Mink(array('zombie' => $session));
In my case, $pathToYourNodeBinary and $pathToYourNodeModules are:
$pathToYourNodeBinary = '/usr/local/bin/node';
$pathToYourNodeModules = '/usr/local/lib/node_modules/';
You can get to know what are your paths using these commands (in case you are running Mac with OSX):
which node
which npm
Of course you need to set up the rest of the ZombieServer constructor variables. To get to know the default values just have a look on its implementation in your vendor library or at github.com

SoapUI print full URL path of rest request using groovy

I'm using soapui with groovy script step
I want to print the full url of my REST request.
I tried using:
myFile.append( testRunner.testCase.testSteps["My Test Name"].getProperty( "requestUri" ));
and I got null.
You will not be able to see the request info from a test step groovy script. However, the groovy script assertion has access to that information.
You can use this to easily retrieve the full endpoint:
def endpoint = messageExchange.getEndpoint()
The below is working fine for me. you can use the same code just need to change your step name.
Note: Make sure your same Test step should have run prior to below code.else you will get the error
[Cannot invoke method getURL() on null object], see error log for details.
Working Code:
def tr=testRunner.testCase.getTestStepByName("TriggerRequestTransactionsReportsService_V)
def String endPointUrlSave= tr.getHttpRequest().getResponse().getURL();
log.info "Your EndpointUrl is : " + endPointUrlSave;

DOMDocument cannot parse XML: DOMDocument::loadXML()

When I am executing the code below:
require_once 'Zend/Loader.php';
Zend_Loader::loadClass('Zend_Gdata_ClientLogin');
Zend_Loader::loadClass('Zend_Gdata_Gapps');
$client = Zend_Gdata_ClientLogin::getHttpClient("amdminuser", "adminpsw", Zend_Gdata_Gapps::AUTH_SERVICE_NAME);
$client->createUser($username, $givenName, $familyName, $password, $passwordHashFunction=null, $quota=null)
it gives error:
Fatal error: Call to undefined method Zend_Gdata_HttpClient::createUser() in ....
Then we run the installation checker but it showed us this error:
Fatal error: Uncaught exception 'Zend_Gdata_App_Exception' with message 'DOMDocument cannot parse XML: DOMDocument::loadXML(): Extra content at the end of the document in Entity, line: 1' in /web/web2/apache2/htdocs/test/per_ak/google/library/Zend/Gdata/App.php:830 Stack trace: #0 /web/web2/apache2/htdocs/test/per_ak/google/library/Zend/Gdata/App.php(789): Zend_Gdata_App::importString('importUrl('https://gdata.y...', 'Zend_Gdata_YouT...', NULL) #2 /web/web2/apache2/htdocs/test/per_ak/google/library/Zend/Gdata.php(162):
I have downloaded http://packages.zendframework.com/releases/ZendGdata-1.12.0/ZendGdata-1.12.0.zip, installed and set appropriate include_path in php.ini. However, I don't know why I am getting this problem and errors. Does anyone know why this is happening?
Thank you for your help.
createUser is a method of Zend_Gdata_Gapps class. Zend_Gdata_ClientLogin::getHttpClient returns an Zend_Gdata_HttpClient object.
Are you sure you've read the manual?