# TopicEmbed.embed\_url length limit 255 characters

**URL:** https://meta.discourse.org/t/topicembed-embed-url-length-limit-255-characters/27731
**Category:** Bug
**Created:** [April 18, 2015, 9:22am UTC](https://meta.discourse.org/t/topicembed-embed-url-length-limit-255-characters/27731 "2015-04-18T09:22:13Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![oganer](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/oganer/32/103794_2.png) [@oganer](https://meta.discourse.org/u/oganer)
#### Post date: [April 18, 2015, 9:22am UTC](https://meta.discourse.org/t/topicembed-embed-url-length-limit-255-characters/27731/1 "2015-04-18T09:22:13Z")

</div>

Hi, i’ve got this error in sidekiq

```
Jobs::HandledExceptionWrapper: Wrapped ActiveRecord::StatementInvalid: PG::StringDataRightTruncation: ERROR: value too long for type character varying(255) : INSERT INTO "topic_embeds" ("content_sha1"...

```

It seems it happens because of length of url in ‘static site’ where embeded comments over 255 characters. And i have no way to change routes in legacy site. [I read that urls may be much longer](http://stackoverflow.com/questions/417142/what-is-the-maximum-length-of-a-url-in-different-browsers). May be we can increse `embed_url` length up to for example 1000-2000 characters?

Thanks.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [April 19, 2015, 8:51pm UTC](https://meta.discourse.org/t/topicembed-embed-url-length-limit-255-characters/27731/2 "2015-04-19T20:51:53Z")

</div>

@zogstrip I saw this in our logs as well, we should extend it as it is path + querystring.

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [April 21, 2015, 9:03am UTC](https://meta.discourse.org/t/topicembed-embed-url-length-limit-255-characters/27731/3 "2015-04-21T09:03:40Z")

</div>

Thanks @oganer for reporting that issue. I just pushed a fix 🐘

[https://github.com/discourse/discourse/commit/dc6b2df2a2b7dff103491aaf6c9116819c200ee2](https://github.com/discourse/discourse/commit/dc6b2df2a2b7dff103491aaf6c9116819c200ee2)

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [April 21, 2015, 9:03am UTC](https://meta.discourse.org/t/topicembed-embed-url-length-limit-255-characters/27731/4 "2015-04-21T09:03:42Z")

</div>


