{"action":"created","issue":{"url":"https://api.github.com/repos/metabase/metabase/issues/9624","repository_url":"https://api.github.com/repos/metabase/metabase","labels_url":"https://api.github.com/repos/metabase/metabase/issues/9624/labels{/name}","comments_url":"https://api.github.com/repos/metabase/metabase/issues/9624/comments","events_url":"https://api.github.com/repos/metabase/metabase/issues/9624/events","html_url":"https://github.com/metabase/metabase/issues/9624","id":426406935,"node_id":"MDU6SXNzdWU0MjY0MDY5MzU=","number":9624,"title":"permissions graph not updating through HTTP PUT api call","user":{"login":"SuneelPodapati","id":10687003,"node_id":"MDQ6VXNlcjEwNjg3MDAz","avatar_url":"https://avatars1.githubusercontent.com/u/10687003?v=4","gravatar_id":"","url":"https://api.github.com/users/SuneelPodapati","html_url":"https://github.com/SuneelPodapati","followers_url":"https://api.github.com/users/SuneelPodapati/followers","following_url":"https://api.github.com/users/SuneelPodapati/following{/other_user}","gists_url":"https://api.github.com/users/SuneelPodapati/gists{/gist_id}","starred_url":"https://api.github.com/users/SuneelPodapati/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SuneelPodapati/subscriptions","organizations_url":"https://api.github.com/users/SuneelPodapati/orgs","repos_url":"https://api.github.com/users/SuneelPodapati/repos","events_url":"https://api.github.com/users/SuneelPodapati/events{/privacy}","received_events_url":"https://api.github.com/users/SuneelPodapati/received_events","type":"User","site_admin":false},"labels":[{"id":314402975,"node_id":"MDU6TGFiZWwzMTQ0MDI5NzU=","url":"https://api.github.com/repos/metabase/metabase/labels/API","name":"API","color":"83ACFC","default":false},{"id":172924555,"node_id":"MDU6TGFiZWwxNzI5MjQ1NTU=","url":"https://api.github.com/repos/metabase/metabase/labels/Question","name":"Question","color":"CEDECE","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2019-03-28T10:13:09Z","updated_at":"2019-03-28T19:10:49Z","closed_at":null,"author_association":"NONE","body":"I have been using Metabase to create dashboards for some time now. I recently had an opportunity to use one of our databases (1000 dbs) through metabase. I tried to load the metabase with all the users around(1000) and create groups (1000) so that each group can have access to one db and one user will be there per group. I was not able to update the permissions graph with HTTP PUT Call. \r\n\r\nThe C# HttpClient API threw this error..\r\n\r\nError sending request to Metabase: PUT http://**********/api/permissions/graph\r\nStatus code: InternalServerError\r\nResponse: {\"message\":\"**Data truncation: Data too long for column 'before' at row 1**\",\"type\":\"class com.mysql.jdbc.MysqlDataTruncation\",\"stacktrace\":[\"com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3971)\",\"com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3909)\",\"com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2527)\",\"com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2680)\",\"com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2484)\",\"com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1858)\",\"com.mysql.jdbc.PreparedStatement.executeUpdateInternal(PreparedStatement.java:2079)\",\"com.mysql.jdbc.PreparedStatement.executeUpdateInternal(PreparedStatement.java:2013)\",\"com.mysql.jdbc.PreparedStatement.executeLargeUpdate(PreparedStatement.java:5104)\",\"com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1998)\",\"com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeUpdate(NewProxyPreparedStatement.java:384)\",\"clojure.java.jdbc$db_do_execute_prepared_return_keys$exec_and_return_keys__11180.invoke(jdbc.clj:897)\",\"clojure.java.jdbc$db_do_execute_prepared_return_keys.invokeStatic(jdbc.clj:919)\",\"clojure.java.jdbc$db_do_execute_prepared_return_keys.invoke(jdbc.clj:884)\",\"clojure.java.jdbc$db_do_prepared_return_keys.invokeStatic(jdbc.clj:950)\",\"clojure.java.jdbc$db_do_prepared_return_keys.invoke(jdbc.clj:927)\",\"toucan.db$simple_insert_many_BANG_$iter__15287__15291$fn__15292$fn__15293.invoke(db.clj:541)\",\"toucan.db$simple_insert_many_BANG_$iter__15287__15291$fn__15292.invoke(db.clj:539)\",\"clojure.lang.LazySeq.sval(LazySeq.java:40)\",\"clojure.lang.LazySeq.seq(LazySeq.java:49)\",\"clojure.lang.RT.seq(RT.java:528)\",\"clojure.core$seq__5124.invokeStatic(core.clj:137)\",\"clojure.core$dorun.invokeStatic(core.clj:3125)\",\"clojure.core$doall.invokeStatic(core.clj:3140)\",\"clojure.core$doall.invoke(core.clj:3140)\",\"toucan.db$simple_insert_many_BANG_.invokeStatic(db.clj:538)\",\"toucan.db$simple_insert_many_BANG_.invoke(db.clj:525)\",\"toucan.db$simple_insert_BANG_.invokeStatic(db.clj:571)\",\"toucan.db$simple_insert_BANG_.invoke(db.clj:560)\",\"toucan.db$insert_BANG_.invokeStatic(db.clj:588)\",\"toucan.db$insert_BANG_.invoke(db.clj:575)\",\"toucan.db$insert_BANG_.invokeStatic(db.clj:591)\",\"toucan.db$insert_BANG_.doInvoke(db.clj:575)\",\"clojure.lang.RestFn.invoke(RestFn.java:731)\",\"--> models.permissions$save_perms_revision_BANG_.invokeStatic(permissions.clj:572)\",\"models.permissions$save_perms_revision_BANG_.invoke(permissions.clj:567)\",\"models.permissions$fn__24844$update_graph_BANG___24853$fn__24854$fn__24858.invoke(permissions.clj:602)\",\"models.permissions$fn__24844$update_graph_BANG___24853$fn__24854.invoke(permissions.clj:599)\",\"models.permissions$fn__24844$update_graph_BANG___24853.invoke(permissions.clj:587)\",\"api.permissions$fn__54357.invokeStatic(permissions.clj:80)\",\"api.permissions$fn__54357.invoke(permissions.clj:68)\",\"middleware$enforce_authentication$fn__55639.invoke(middleware.clj:113)\",\"api.routes$fn__55809.invokeStatic(routes.clj:74)\",\"api.routes$fn__55809.invoke(routes.clj:74)\",\"routes$fn__56547$fn__56548.doInvoke(routes.clj:108)\",\"routes$fn__56547.invokeStatic(routes.clj:103)\",\"routes$fn__56547.invoke(routes.clj:103)\",\"middleware$catch_api_exceptions$fn__55774.invoke(middleware.clj:437)\",\"middleware$log_api_call$fn__55752$fn__55754.invoke(middleware.clj:365)\",\"middleware$log_api_call$fn__55752.invoke(middleware.clj:364)\",\"middleware$add_security_headers$fn__55694.invoke(middleware.clj:253)\",\"core$wrap_streamed_json_response$fn__57398.invoke(core.clj:67)\",\"middleware$bind_current_user$fn__55644.invoke(middleware.clj:137)\",\"middleware$maybe_set_site_url$fn__55704.invoke(middleware.clj:291)\",\"middleware$add_content_type$fn__55697.invoke(middleware.clj:263)\"],\"sql-exception-chain\":[\"MysqlDataTruncation:\",\"Message: Data truncation: Data too long for column 'before' at row 1\",\"SQLState: 22001\",\"Error Code: 1406\"]}\r\n\r\n_Running_ **Metabase 0.31.2 on Docker Container with MySQL docker container.**\r\n\r\n\r\n1.  I thought it was **related to database column size**, but the **same call works fine on Browser through Permissions UI** - verified the data using Fiddler\r\n2. The permissions PUT call also works for chunk of valid json( like only one group - one db permissions which I verified this through another instance of metabase with less groups and dbs). So, I tried making the **PUT call with one group, one db values, still I got the same error**\r\n\r\nPlease help, is this an issue with c# HttpClient object or really a database column size issue.\r\n"},"comment":{"url":"https://api.github.com/repos/metabase/metabase/issues/comments/477732979","html_url":"https://github.com/metabase/metabase/issues/9624#issuecomment-477732979","issue_url":"https://api.github.com/repos/metabase/metabase/issues/9624","id":477732979,"node_id":"MDEyOklzc3VlQ29tbWVudDQ3NzczMjk3OQ==","user":{"login":"camsaul","id":1455846,"node_id":"MDQ6VXNlcjE0NTU4NDY=","avatar_url":"https://avatars3.githubusercontent.com/u/1455846?v=4","gravatar_id":"","url":"https://api.github.com/users/camsaul","html_url":"https://github.com/camsaul","followers_url":"https://api.github.com/users/camsaul/followers","following_url":"https://api.github.com/users/camsaul/following{/other_user}","gists_url":"https://api.github.com/users/camsaul/gists{/gist_id}","starred_url":"https://api.github.com/users/camsaul/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/camsaul/subscriptions","organizations_url":"https://api.github.com/users/camsaul/orgs","repos_url":"https://api.github.com/users/camsaul/repos","events_url":"https://api.github.com/users/camsaul/events{/privacy}","received_events_url":"https://api.github.com/users/camsaul/received_events","type":"User","site_admin":false},"created_at":"2019-03-28T19:10:49Z","updated_at":"2019-03-28T19:10:49Z","author_association":"MEMBER","body":"It saves a diff between the old graph and the new graph in that `before` column. If it's working in the UI but not when you call then endpoint manually I'm guessing the request you're making must either be something other than what it expects or just a really huge massive change where the UI is making multiple smaller changes. Take a look at the the way the frontend constructs its request and make sure you're using the same format. If you are and you're still running into problems, try changing a smaller number of permissions at a time, instead of doing 1000 DBs all at once "}}
{"actor":{"display_login":"camsaul"}}