nikaia / translation-sheet

Translating Laravel languages files using a Google Spreadsheet.
GNU General Public License v3.0
291 stars 60 forks source link

Error while Push : Google_Service_Exception : "'valueInputOption' is required but not specified" #39

Closed pankajjha closed 5 years ago

pankajjha commented 5 years ago

Hi, While pushing locales to spreadsheet I am getting following error -

Google_Service_Exception  : {
  "error": {
    "code": 400,
    "message": "'valueInputOption' is required but not specified",
    "errors": [
      {
        "message": "'valueInputOption' is required but not specified",
        "domain": "global",
        "reason": "badRequest"
      }
    ],
    "status": "INVALID_ARGUMENT"
  }
}

I don't understand is t happening because of Composer Update? Here's complete verbose output

$ php artisan translation_sheet:push -v
Scanning languages files
Preparing spreadsheet for new write operation
Updating header
Writing translations in the spreadsheet

   Google_Service_Exception  : {
  "error": {
    "code": 400,
    "message": "'valueInputOption' is required but not specified",
    "errors": [
      {
        "message": "'valueInputOption' is required but not specified",
        "domain": "global",
        "reason": "badRequest"
      }
    ],
    "status": "INVALID_ARGUMENT"
  }
}

  at D:\xampp_v2\xampp-7-2-12\htdocs\sjpanel_new\vendor\google\apiclient\src\Google\Http\REST.php:118
    114|       // if we errored out, it should be safe to grab the response body
    115|       $body = (string) $response->getBody();
    116| 
    117|       // Check if we received errors, and add those to the Exception for convenience
  > 118|       throw new Google_Service_Exception($body, $code, null, self::getResponseErrors($body));
    119|     }
    120| 
    121|     // Ensure we only pull the entire body into memory if the request is not
    122|     // of media type

  Exception trace:

  1   Google_Http_REST::decodeHttpResponse(Object(GuzzleHttp\Psr7\Response), Object(GuzzleHttp\Psr7\Request), "Google_Service_Sheets_BatchUpdateValuesResponse")
      D:\xampp_v2\xampp-7-2-12\htdocs\sjpanel_new\vendor\google\apiclient\src\Google\Http\REST.php:94

  2   Google_Http_REST::doExecute(Object(GuzzleHttp\Client), Object(GuzzleHttp\Psr7\Request), "Google_Service_Sheets_BatchUpdateValuesResponse")
      D:\xampp_v2\xampp-7-2-12\htdocs\sjpanel_new\vendor\google\apiclient\src\Google\Task\Runner.php:176

  3   Google_Task_Runner::run()
      D:\xampp_v2\xampp-7-2-12\htdocs\sjpanel_new\vendor\google\apiclient\src\Google\Http\REST.php:58

  4   Google_Http_REST::execute(Object(GuzzleHttp\Client), Object(GuzzleHttp\Psr7\Request), "Google_Service_Sheets_BatchUpdateValuesResponse", [])
      D:\xampp_v2\xampp-7-2-12\htdocs\sjpanel_new\vendor\google\apiclient\src\Google\Client.php:798

  5   Google_Client::execute(Object(GuzzleHttp\Psr7\Request), "Google_Service_Sheets_BatchUpdateValuesResponse")
      D:\xampp_v2\xampp-7-2-12\htdocs\sjpanel_new\vendor\google\apiclient\src\Google\Service\Resource.php:232

  6   Google_Service_Resource::call("batchUpdate", "Google_Service_Sheets_BatchUpdateValuesResponse")
      D:\xampp_v2\xampp-7-2-12\htdocs\sjpanel_new\vendor\google\apiclient-services\src\Google\Service\Sheets\Resource\SpreadsheetsValues.php:161

  7   Google_Service_Sheets_Resource_SpreadsheetsValues::batchUpdate("1mT3mZ5Vx0N7_ERK7pEX0Bi2J7xfEL7JfuksRwkQQeAU", Object(Google_Service_Sheets_BatchUpdateValuesRequest))
      D:\xampp_v2\xampp-7-2-12\htdocs\sjpanel_new\vendor\nikaia\translation-sheet\src\Client\Api.php:215

  8   Nikaia\TranslationSheet\Client\Api::writeCells("Translations!A2:F936")
      D:\xampp_v2\xampp-7-2-12\htdocs\sjpanel_new\vendor\nikaia\translation-sheet\src\Sheet\TranslationsSheet.php:42

  9   Nikaia\TranslationSheet\Sheet\TranslationsSheet::writeTranslations()
      D:\xampp_v2\xampp-7-2-12\htdocs\sjpanel_new\vendor\nikaia\translation-sheet\src\Pusher.php:44

  10  Nikaia\TranslationSheet\Pusher::push()
      D:\xampp_v2\xampp-7-2-12\htdocs\sjpanel_new\vendor\nikaia\translation-sheet\src\Commands\Push.php:16

  11  Nikaia\TranslationSheet\Commands\Push::handle(Object(Nikaia\TranslationSheet\Pusher))
      D:\xampp_v2\xampp-7-2-12\htdocs\sjpanel_new\vendor\laravel\framework\src\Illuminate\Container\BoundMethod.php:29

  12  call_user_func_array()
      D:\xampp_v2\xampp-7-2-12\htdocs\sjpanel_new\vendor\laravel\framework\src\Illuminate\Container\BoundMethod.php:29

  13  Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()
      D:\xampp_v2\xampp-7-2-12\htdocs\sjpanel_new\vendor\laravel\framework\src\Illuminate\Container\BoundMethod.php:87

  14  Illuminate\Container\BoundMethod::callBoundMethod(Object(Illuminate\Foundation\Application), Object(Closure))
      D:\xampp_v2\xampp-7-2-12\htdocs\sjpanel_new\vendor\laravel\framework\src\Illuminate\Container\BoundMethod.php:31

  15  Illuminate\Container\BoundMethod::call(Object(Illuminate\Foundation\Application), [])
      D:\xampp_v2\xampp-7-2-12\htdocs\sjpanel_new\vendor\laravel\framework\src\Illuminate\Container\Container.php:572

  16  Illuminate\Container\Container::call()
      D:\xampp_v2\xampp-7-2-12\htdocs\sjpanel_new\vendor\laravel\framework\src\Illuminate\Console\Command.php:183

  17  Illuminate\Console\Command::execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle))
      D:\xampp_v2\xampp-7-2-12\htdocs\sjpanel_new\vendor\symfony\console\Command\Command.php:255

  18  Symfony\Component\Console\Command\Command::run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle))
      D:\xampp_v2\xampp-7-2-12\htdocs\sjpanel_new\vendor\laravel\framework\src\Illuminate\Console\Command.php:170

  19  Illuminate\Console\Command::run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
      D:\xampp_v2\xampp-7-2-12\htdocs\sjpanel_new\vendor\symfony\console\Application.php:908

  20  Symfony\Component\Console\Application::doRunCommand(Object(Nikaia\TranslationSheet\Commands\Push), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\C
onsole\Output\ConsoleOutput))
      D:\xampp_v2\xampp-7-2-12\htdocs\sjpanel_new\vendor\symfony\console\Application.php:269

  21  Symfony\Component\Console\Application::doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
      D:\xampp_v2\xampp-7-2-12\htdocs\sjpanel_new\vendor\symfony\console\Application.php:145

  22  Symfony\Component\Console\Application::run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
      D:\xampp_v2\xampp-7-2-12\htdocs\sjpanel_new\vendor\laravel\framework\src\Illuminate\Console\Application.php:89

  23  Illuminate\Console\Application::run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
      D:\xampp_v2\xampp-7-2-12\htdocs\sjpanel_new\vendor\laravel\framework\src\Illuminate\Foundation\Console\Kernel.php:122

  24  Illuminate\Foundation\Console\Kernel::handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
      D:\xampp_v2\xampp-7-2-12\htdocs\sjpanel_new\artisan:37

Let me know if I can offer any help. Trying to resolve the issue, Love this package.

nbourguig commented 5 years ago

It's kind of hard to see where this error may come from as all the cells are sent with RAW ValueInputOption.

Is there some special content in your translations files that might cause issues ?

pankajjha commented 5 years ago

You are right, after digging some more into this issue, I found some anomaly in my locale files, I had to manually verify each locale files. For some of the keys, blank values were being sent to the spreadsheet. Once I fixed those keys it again started to work.