500 Error While Posting a Topic

I get a 500 Error while trying to post a new Topic. I am the Admin and have posted and am able to post multiple other topics. But, only few set of topics are throwing me an error.
Title:
Why should I learn computer programming even though I am a commerce student? How can computer programming help me?
Post:
First of all in couple of years everything will be programmable so it will be useful thing to know. But you might not care about that since you will be only consumer - and that is fine to be clear.Even though you do not know every law in the book like professional lawyer you still know few of your basic rights so why not learn some basics of computer programming?As a commerce student I expect that you will be working with a bunch of numbers and if you have repetitive tasks having them automated can save you a bunch of time.Last but not least you should never turn down opportunity to learn s Continue ReadingFirst of all in couple of years everything will be programmable so it will be useful thing to know. But you might not care about that since you will be only consumer - and that is fine to be clear.Even though you do not know every law in the book like professional lawyer you still know few of your basic rights so why not learn some basics of computer programming?As a commerce student I expect that you will be working with a bunch of numbers and if you have repetitive tasks having them automated can save you a bunch of time.Last but not least you should never turn down opportunity to learn something new: be it playing instrument, new language or just good old programming.

Could someone help me understand what could possible go wrong here

It could be you topic character limit. You might be exceeding the limit

Hi @IAmGav,

I have kept the topic character limit to the maximum.
I have increase the max post length to 150000.
Max Topic Title Length to 255.
Title max word length to 2000000000
Any other possible reason.

The Number of 500 Errors have been increasing considerably. Not able to identify the exact reason. This is severely affecting my forum. Could you someone please help me here.

I went ahead and took your article and posted it on one of my discourse server without even touching any limits.

It posted fine.

You might want to look at your server errors.

This is not a discourse related error

Thank You Gavin.
Not sure why all of a sudden this has started to happen

Visit the /logs page on your forum and check for errors.

/logs page does not exist in the domain. (mpl.co/logs)
Could you please help me understand how to access.

You must be logged in as the forum admin.

I am a forum Admin. Do we have to configure it?

Is it true that this might be caused due to similar body content, as mentioned here,

If yes, how to disable this feature. I’m comfortable having a Check for duplicate titles. But, I don’t want Discourse to throw and error for similar body

you could try these

settings > posting

We can not really help much without seeing the /logs visit YOURSITENAME.COM/logs after triggering the issue, copy the error you get and paste it here.

2 Likes

Error Message:

ActiveRecord::ValueTooLong (PG::StringDataRightTruncation: ERROR: value too long for type character varying(1000) ) lib/post_creator.rb:496:in `update_topic_stats' lib/post_creator.rb:199:in `block i

Error Info:

ActiveRecord::ValueTooLong (PG::StringDataRightTruncation: ERROR:  value too long for type character varying(1000)
)
lib/post_creator.rb:496:in `update_topic_stats'
lib/post_creator.rb:199:in `block in create'
lib/post_creator.rb:375:in `block in transaction'
lib/post_creator.rb:374:in `transaction'
lib/post_creator.rb:191:in `create'
lib/new_post_manager.rb:271:in `perform_create_post'
lib/new_post_manager.rb:209:in `perform'
app/controllers/posts_controller.rb:173:in `block in create'
lib/distributed_memoizer.rb:30:in `memoize'
app/controllers/posts_controller.rb:172:in `create'
app/controllers/application_controller.rb:340:in `block in with_resolved_locale'
app/controllers/application_controller.rb:340:in `with_resolved_locale'
lib/middleware/omniauth_bypass_middleware.rb:68:in `call'
lib/content_security_policy/middleware.rb:12:in `call'
lib/middleware/anonymous_cache.rb:328:in `call'
config/initializers/100-quiet_logger.rb:19:in `call'
config/initializers/100-silence_logger.rb:31:in `call'
lib/middleware/enforce_hostname.rb:22:in `call'
lib/middleware/request_tracker.rb:176:in `call'

Error Back Trace:
rack-mini-profiler (2.0.3) lib/patches/db/pg.rb:69:in `exec_params'

rack-mini-profiler (2.0.3) lib/patches/db/pg.rb:69:in `exec_params'

activerecord (6.0.3.2) lib/active_record/connection_adapters/postgresql_adapter.rb:675:in `block (2 levels) in exec_no_cache'

activesupport (6.0.3.2) lib/active_support/dependencies/interlock.rb:48:in `block in permit_concurrent_loads'

activesupport (6.0.3.2) lib/active_support/concurrency/share_lock.rb:187:in `yield_shares'

activesupport (6.0.3.2) lib/active_support/dependencies/interlock.rb:47:in `permit_concurrent_loads'

activerecord (6.0.3.2) lib/active_record/connection_adapters/postgresql_adapter.rb:674:in `block in exec_no_cache'

activerecord (6.0.3.2) lib/active_record/connection_adapters/abstract_adapter.rb:722:in `block (2 levels) in log'

activesupport (6.0.3.2) lib/active_support/concurrency/load_interlock_aware_monitor.rb:26:in `block (2 levels) in synchronize'

activesupport (6.0.3.2) lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `handle_interrupt'

activesupport (6.0.3.2) lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `block in synchronize'

activesupport (6.0.3.2) lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `handle_interrupt'

activesupport (6.0.3.2) lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `synchronize'

activerecord (6.0.3.2) lib/active_record/connection_adapters/abstract_adapter.rb:721:in `block in log'

activesupport (6.0.3.2) lib/active_support/notifications/instrumenter.rb:24:in `instrument'

activerecord (6.0.3.2) lib/active_record/connection_adapters/abstract_adapter.rb:712:in `log'

activerecord (6.0.3.2) lib/active_record/connection_adapters/postgresql_adapter.rb:673:in `exec_no_cache'

activerecord (6.0.3.2) lib/active_record/connection_adapters/postgresql_adapter.rb:654:in `execute_and_clear'

activerecord (6.0.3.2) lib/active_record/connection_adapters/postgresql/database_statements.rb:111:in `exec_delete'

activerecord (6.0.3.2) lib/active_record/connection_adapters/abstract/database_statements.rb:174:in `update'

activerecord (6.0.3.2) lib/active_record/connection_adapters/abstract/query_cache.rb:22:in `update'

activerecord (6.0.3.2) lib/active_record/persistence.rb:385:in `_update_record'

activerecord (6.0.3.2) lib/active_record/persistence.rb:681:in `update_columns'

lib/post_creator.rb:496:in `update_topic_stats'

lib/post_creator.rb:199:in `block in create'

lib/post_creator.rb:375:in `block in transaction'

activerecord (6.0.3.2) lib/active_record/connection_adapters/abstract/database_statements.rb:280:in `block in transaction'

activerecord (6.0.3.2) lib/active_record/connection_adapters/abstract/transaction.rb:280:in `block in within_new_transaction'

activesupport (6.0.3.2) lib/active_support/concurrency/load_interlock_aware_monitor.rb:26:in `block (2 levels) in synchronize'

activesupport (6.0.3.2) lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `handle_interrupt'

activesupport (6.0.3.2) lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `block in synchronize'

activesupport (6.0.3.2) lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `handle_interrupt'

activesupport (6.0.3.2) lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `synchronize'

activerecord (6.0.3.2) lib/active_record/connection_adapters/abstract/transaction.rb:278:in `within_new_transaction'

activerecord (6.0.3.2) lib/active_record/connection_adapters/abstract/database_statements.rb:280:in `transaction'

activerecord (6.0.3.2) lib/active_record/transactions.rb:212:in `transaction'

lib/post_creator.rb:374:in `transaction'

lib/post_creator.rb:191:in `create'

lib/new_post_manager.rb:271:in `perform_create_post'

lib/new_post_manager.rb:209:in `perform'

app/controllers/posts_controller.rb:173:in `block in create'

lib/distributed_memoizer.rb:30:in `memoize'

app/controllers/posts_controller.rb:172:in `create'

actionpack (6.0.3.2) lib/action_controller/metal/basic_implicit_render.rb:6:in `send_action'

actionpack (6.0.3.2) lib/abstract_controller/base.rb:195:in `process_action'

actionpack (6.0.3.2) lib/action_controller/metal/rendering.rb:30:in `process_action'

actionpack (6.0.3.2) lib/abstract_controller/callbacks.rb:42:in `block in process_action'

activesupport (6.0.3.2) lib/active_support/callbacks.rb:112:in `block in run_callbacks'

app/controllers/application_controller.rb:340:in `block in with_resolved_locale'

i18n (1.8.3) lib/i18n.rb:313:in `with_locale'

app/controllers/application_controller.rb:340:in `with_resolved_locale'

activesupport (6.0.3.2) lib/active_support/callbacks.rb:121:in `block in run_callbacks'

activesupport (6.0.3.2) lib/active_support/callbacks.rb:139:in `run_callbacks'

actionpack (6.0.3.2) lib/abstract_controller/callbacks.rb:41:in `process_action'

actionpack (6.0.3.2) lib/action_controller/metal/rescue.rb:22:in `process_action'

actionpack (6.0.3.2) lib/action_controller/metal/instrumentation.rb:33:in `block in process_action'

activesupport (6.0.3.2) lib/active_support/notifications.rb:180:in `block in instrument'

activesupport (6.0.3.2) lib/active_support/notifications/instrumenter.rb:24:in `instrument'

activesupport (6.0.3.2) lib/active_support/notifications.rb:180:in `instrument'

actionpack (6.0.3.2) lib/action_controller/metal/instrumentation.rb:32:in `process_action'

actionpack (6.0.3.2) lib/action_controller/metal/params_wrapper.rb:245:in `process_action'

activerecord (6.0.3.2) lib/active_record/railties/controller_runtime.rb:27:in `process_action'

actionpack (6.0.3.2) lib/abstract_controller/base.rb:136:in `process'

actionview (6.0.3.2) lib/action_view/rendering.rb:39:in `process'

rack-mini-profiler (2.0.3) lib/mini_profiler/profiling_methods.rb:78:in `block in profile_method'

actionpack (6.0.3.2) lib/action_controller/metal.rb:190:in `dispatch'

actionpack (6.0.3.2) lib/action_controller/metal.rb:254:in `dispatch'

actionpack (6.0.3.2) lib/action_dispatch/routing/route_set.rb:50:in `dispatch'

actionpack (6.0.3.2) lib/action_dispatch/routing/route_set.rb:33:in `serve'

actionpack (6.0.3.2) lib/action_dispatch/journey/router.rb:49:in `block in serve'

actionpack (6.0.3.2) lib/action_dispatch/journey/router.rb:32:in `each'

actionpack (6.0.3.2) lib/action_dispatch/journey/router.rb:32:in `serve'

actionpack (6.0.3.2) lib/action_dispatch/routing/route_set.rb:834:in `call'

lib/middleware/omniauth_bypass_middleware.rb:68:in `call'

rack (2.2.3) lib/rack/tempfile_reaper.rb:15:in `call'

rack (2.2.3) lib/rack/conditional_get.rb:40:in `call'

rack (2.2.3) lib/rack/head.rb:12:in `call'

lib/content_security_policy/middleware.rb:12:in `call'

lib/middleware/anonymous_cache.rb:328:in `call'

rack (2.2.3) lib/rack/session/abstract/id.rb:266:in `context'

rack (2.2.3) lib/rack/session/abstract/id.rb:260:in `call'

actionpack (6.0.3.2) lib/action_dispatch/middleware/cookies.rb:648:in `call'

actionpack (6.0.3.2) lib/action_dispatch/middleware/callbacks.rb:27:in `block in call'

activesupport (6.0.3.2) lib/active_support/callbacks.rb:101:in `run_callbacks'

actionpack (6.0.3.2) lib/action_dispatch/middleware/callbacks.rb:26:in `call'

actionpack (6.0.3.2) lib/action_dispatch/middleware/actionable_exceptions.rb:17:in `call'

actionpack (6.0.3.2) lib/action_dispatch/middleware/debug_exceptions.rb:32:in `call'

actionpack (6.0.3.2) lib/action_dispatch/middleware/show_exceptions.rb:33:in `call'

logster (2.9.1) lib/logster/middleware/reporter.rb:43:in `call'

railties (6.0.3.2) lib/rails/rack/logger.rb:37:in `call_app'

railties (6.0.3.2) lib/rails/rack/logger.rb:28:in `call'

config/initializers/100-quiet_logger.rb:19:in `call'

config/initializers/100-silence_logger.rb:31:in `call'

actionpack (6.0.3.2) lib/action_dispatch/middleware/remote_ip.rb:81:in `call'

actionpack (6.0.3.2) lib/action_dispatch/middleware/request_id.rb:27:in `call'

lib/middleware/enforce_hostname.rb:22:in `call'

rack (2.2.3) lib/rack/method_override.rb:24:in `call'

actionpack (6.0.3.2) lib/action_dispatch/middleware/executor.rb:14:in `call'

rack (2.2.3) lib/rack/sendfile.rb:110:in `call'

actionpack (6.0.3.2) lib/action_dispatch/middleware/host_authorization.rb:76:in `call'

rack-mini-profiler (2.0.3) lib/mini_profiler/profiler.rb:200:in `call'

message_bus (3.3.1) lib/message_bus/rack/middleware.rb:61:in `call'

lib/middleware/request_tracker.rb:176:in `call'

railties (6.0.3.2) lib/rails/engine.rb:527:in `call'

railties (6.0.3.2) lib/rails/railtie.rb:190:in `public_send'

railties (6.0.3.2) lib/rails/railtie.rb:190:in `method_missing'

rack (2.2.3) lib/rack/urlmap.rb:74:in `block in call'

rack (2.2.

Error Env:

hostname discourse-app
process_id 21623
application_version 8a9e4504fea9edd693ceecf314308cd08e99f0ca
HTTP_HOST mpl.co
REQUEST_URI /posts.json
REQUEST_METHOD POST
HTTP_USER_AGENT python-requests/2.22.0
HTTP_ACCEPT application/json
HTTP_X_FORWARDED_FOR 183.82.159.193
HTTP_X_REAL_IP 183.82.159.193
username Nideesh
time 11:41 am

Please suggest next steps.

This is happening due to excerpts.

Please change the Site Setting topic_excerpt_maxlength to 999.

https://github.com/discourse/discourse/commit/ee10002e207344106e90240fb46811e92aef45a8

8 Likes

Thanks @sam…Issue got resolved

1 Like

This topic was automatically closed after 25 hours. New replies are no longer allowed.