diff --git a/backend/src/app/http/debug.clj b/backend/src/app/http/debug.clj index b4ff0c8ab2..da99552935 100644 --- a/backend/src/app/http/debug.clj +++ b/backend/src/app/http/debug.clj @@ -264,7 +264,7 @@ content->>'~:hint' AS hint FROM server_error_report ORDER BY created_at DESC - LIMIT 100") + LIMIT 200") (defn error-list-handler [{:keys [::db/pool]} request] diff --git a/backend/src/app/http/errors.clj b/backend/src/app/http/errors.clj index 3829abfaa7..24f9891d35 100644 --- a/backend/src/app/http/errors.clj +++ b/backend/src/app/http/errors.clj @@ -10,6 +10,7 @@ [app.common.exceptions :as ex] [app.common.logging :as l] [app.common.schema :as sm] + [app.config :as cf] [app.http :as-alias http] [app.http.access-token :as-alias actoken] [app.http.session :as-alias session] @@ -30,14 +31,14 @@ (let [claims (-> {} (into (::session/token-claims request)) (into (::actoken/token-claims request)))] - {:path (:path request) - :method (:method request) - :params (:params request) - :ip-addr (parse-client-ip request) - :user-agent (yrq/get-header request "user-agent") - :profile-id (:uid claims) - :version (or (yrq/get-header request "x-frontend-version") - "unknown")})) + {:request/path (:path request) + :request/method (:method request) + :request/params (:params request) + :request/user-agent (yrq/get-header request "user-agent") + :request/ip-addr (parse-client-ip request) + :request/profile-id (:uid claims) + :version/frontend (or (yrq/get-header request "x-frontend-version") "unknown") + :version/backend (:full cf/version)})) (defmulti handle-exception (fn [err & _rest] diff --git a/backend/src/app/loggers/database.clj b/backend/src/app/loggers/database.clj index 5fbee80e98..a295783740 100644 --- a/backend/src/app/loggers/database.clj +++ b/backend/src/app/loggers/database.clj @@ -40,32 +40,28 @@ [{:keys [::l/context ::l/message ::l/props ::l/logger ::l/level ::l/cause] :as record}] (us/assert! ::l/record record) - (let [data (ex-data cause)] + (let [data (ex-data cause) + context (-> context + (assoc :tenant (cf/get :tenant)) + (assoc :host (cf/get :host)) + (assoc :public-uri (cf/get :public-uri)) + (assoc :logger/name logger) + (assoc :logger/level level) + (dissoc :request/params))] (merge - {:context (-> context - (assoc :tenant (cf/get :tenant)) - (assoc :host (cf/get :host)) - (assoc :public-uri (cf/get :public-uri)) - (assoc :version (:full cf/version)) - (assoc :logger-name logger) - (assoc :logger-level level) - (dissoc :params) - (pp/pprint-str :width 200)) - - :props (pp/pprint-str props :width 200) + {:context (-> (into (sorted-map) context) + (pp/pprint-str :width 200 :length 50 :level 10)) + :props (pp/pprint-str props :width 200 :length 50) :hint (or (ex-message cause) @message) :trace (ex/format-throwable cause :data? false :explain? false :header? false :summary? false)} - (when-let [params (:params context)] + (when-let [params (:request/params context)] {:params (pp/pprint-str params :width 200)}) (when-let [data (some-> data (dissoc ::s/problems ::s/value ::s/spec ::sm/explain :hint))] {:data (pp/pprint-str data :width 200)}) - (when-let [value (-> data ::sm/explain :value)] - {:value (pp/pprint-str value :width 200)}) - - (when-let [explain (ex/explain data)] + (when-let [explain (ex/explain data {:level 10 :length 50})] {:explain explain})))) diff --git a/backend/src/app/loggers/mattermost.clj b/backend/src/app/loggers/mattermost.clj index 93db476a79..8a2117e23c 100644 --- a/backend/src/app/loggers/mattermost.clj +++ b/backend/src/app/loggers/mattermost.clj @@ -30,7 +30,9 @@ "```\n" "- host: `" (:host report) "`\n" "- tenant: `" (:tenant report) "`\n" - "- version: `" (:version report) "`\n" + "- request-path: `" (:request-path report) "`\n" + "- frontend-version: `" (:frontend-version report) "`\n" + "- backend-version: `" (:backend-version report) "`\n" "\n" "Trace:\n" (:trace report) @@ -50,13 +52,15 @@ (defn record->report [{:keys [::l/context ::l/id ::l/cause] :as record}] (us/assert! ::l/record record) - {:id id - :tenant (cf/get :tenant) - :host (cf/get :host) - :public-uri (cf/get :public-uri) - :version (:full cf/version) - :profile-id (:profile-id context) - :trace (ex/format-throwable cause :detail? false :header? false)}) + {:id id + :tenant (cf/get :tenant) + :host (cf/get :host) + :public-uri (cf/get :public-uri) + :backend-version (or (:version/backend context) (:full cf/version)) + :frontend-version (:version/frontend context) + :profile-id (:request/profile-id context) + :request-path (:request/path context) + :trace (ex/format-throwable cause :detail? false :header? false)}) (defn handle-event [cfg record] diff --git a/backend/src/app/migrations.clj b/backend/src/app/migrations.clj index 787d344509..00407df219 100644 --- a/backend/src/app/migrations.clj +++ b/backend/src/app/migrations.clj @@ -324,6 +324,9 @@ {:name "0104-mod-file-thumbnail-table" :fn (mg/resource "app/migrations/sql/0104-mod-file-thumbnail-table.sql")} + {:name "0105-mod-server-error-report-table" + :fn (mg/resource "app/migrations/sql/0105-mod-server-error-report-table.sql")} + ]) (defn apply-migrations! diff --git a/backend/src/app/migrations/sql/0105-mod-server-error-report-table.sql b/backend/src/app/migrations/sql/0105-mod-server-error-report-table.sql new file mode 100644 index 0000000000..3609cece9f --- /dev/null +++ b/backend/src/app/migrations/sql/0105-mod-server-error-report-table.sql @@ -0,0 +1,2 @@ +CREATE INDEX server_error_report__created_at__idx + ON server_error_report ( created_at ); diff --git a/docker/images/Dockerfile.exporter b/docker/images/Dockerfile.exporter index 7bc3f89d22..9ddd9ecc78 100644 --- a/docker/images/Dockerfile.exporter +++ b/docker/images/Dockerfile.exporter @@ -104,7 +104,7 @@ WORKDIR /opt/penpot/exporter USER penpot:penpot RUN set -ex; \ - yarn; \ - yarn run playwright install chromium; + yarn --network-timeout 1000000; \ + yarn --network-timeout 1000000 run playwright install chromium; CMD ["node", "app.js"] diff --git a/frontend/src/app/main/data/workspace/fix_broken_shape_links.cljs b/frontend/src/app/main/data/workspace/fix_broken_shape_links.cljs index 2866d97417..a9443b2fab 100644 --- a/frontend/src/app/main/data/workspace/fix_broken_shape_links.cljs +++ b/frontend/src/app/main/data/workspace/fix_broken_shape_links.cljs @@ -31,8 +31,10 @@ (mapcat (partial generate-changes :component-id) (vals (:components data))))] - (rx/of (dch/commit-changes - {:origin it - :redo-changes (vec changes) - :undo-changes [] - :save-undo? false})))))) + (if (seq changes) + (rx/of (dch/commit-changes + {:origin it + :redo-changes (vec changes) + :undo-changes [] + :save-undo? false})) + (rx/empty))))))