GGshow reloaded GGshow reloaded

October 19, 2015

PHP 403 Insufficient Permission in Analytics Data Import

Issue:

PHP Fatal error: Uncaught exception 'Google_Service_Exception' with message 'Error calling POST https://www.googleapis.com/upload/analytics/v3/management/accounts/.../webproperties/.../customDataSources/.../uploads?uploadType=media: (403) Insufficient Permission' in /base/data/home/apps/.../google-api-php-client/src/Google/Http/REST.php:110 Stack trace: #0 /base/data/home/apps/.../google-api-php-client/src/Google/Http/REST.php(62): Google_Http_REST::decodeHttpResponse(Object(Google_Http_Request), Object(Google_Client)) #1 [internal function]: Google_Http_REST::doExecute(Object(Google_Client), Object(Google_Http_Request)) #2 /base/data/home/apps/.../google-api-php-client/src/Google/Task/Runner.php(174): call_user_func_array(Array, Array) #3 /base/data/home/apps/.../google-api-php-client/src/Google/Http/REST.php(46): Google_Task_Runner->run() #4 /base/data/ in /base/data/home/apps/.../google-api-php-client/src/Google/Http/REST.php on line 110

Reason:
Insufficient permission to perform an API query

Solution:

  • Ensure sufficient account permission granted for the service account (???@developer.gserviceaccount.com).
  • Ensure proper scopes defined in Service Account Authentication (Google_Auth_AssertionCredentials).
    Use Google_Service_Analytics::ANALYTICS ( or “https://www.googleapis.com/auth/analytics” ) instead of Google_Service_Analytics::ANALYTICS_READONLY ( or “https://www.googleapis.com/auth/analytics.readonly” ) if you need to perform an edit operation, e.g. Data Import.

Reference:

January 15, 2012

Zend Framework Command Line Tool with administrator rights

Issue:

  • Problem using Zend Framework zf.bat in Windows.
  • Unable to create project using zf Command Line Tool.
    C:\Program Files\Zend\ZendServer\share\ZendFramework\bin>zf create project mypro
    ject
    Warning: mkdir(): Permission denied in C:\Program Files\Zend\ZendServer\share\Ze
    ndFramework\library\Zend\Tool\Project\Provider\Project.php on line 55
                              An Error Has Occurred
     Could not create requested project directory 'myproject'
    
    Zend Framework Command Line Console Tool v1.11.11
    Details for action "Create" and provider "Project"
      Project
        zf create project path name-of-profile file-of-profile

Reason:

  • Administrator rights are required to create folders and files into specified location.

Solution:

  • Run the command as administrator To start command prompt as administrator, right click on the its shortcut, and choose run as administrator. You can also select the command prompt shortcut and press Ctrl + Shift + Enter.
    C:\Program Files\Zend\ZendServer\share\ZendFramework\bin>zf create project mypro
    ject
    Creating project at C:/Program Files/Zend/ZendServer/share/ZendFramework/bin/myp
    roject
    Note: This command created a web project, for more information setting up your V
    HOST, please see docs/README
  • For Zend Framework CLI in Linux, use sudo to execute zf.sh
    sudo zf.sh create project myproject
Filed under: Linux,PHP,Windows,Zend Framework — Tags: , , , — GG @ 1:12 am

© 2024 GGSHOW | Powered by WordPress