Unable to Send SMS from DHIS2 Despite Working in Postman

Details of the Issue:

  • I have configured SMS settings in DHIS2 using the URL provided by the service provider.
  • I tested the URL in Postman to send SMS, and it works successfully.
  • However, when I try sending SMS through DHIS2, it fails.

What I Have Done So Far:

  1. Configured the SMS settings in DHIS2 as shown in the attached screenshot.


  1. Verified the URL and parameters in Postman, where it sends SMS successfully.
  • Is there any additional configuration or troubleshooting step required in DHIS2 to make the SMS gateway work?
  • How can I verify if DHIS2 is correctly communicating with the SMS service?
  • Does the SMS service require specific headers or authentication that may need additional configuration in DHIS2?

Hi

If I understand correctly, the gateway is being added as one of the gateways successfully? (API get /api/gateways returns the gateway in the list)

How are you sending the SMS? How do you know it fails? Does it show you any error messages?

Please check the Catalina.out log for any errors and share here.

I think the issue lies in the gateway configuration setup, where I am missing some required attributes.

  • INFO 2024-11-27T12:45:17,032 Gateway configuration found: [SmsGatewayConfig(uid=mXhDvRysPc, name=Amakomaya Gateway SMS, username=null, password=null, sendUrlParameters=false, urlTemplate=https://sms.#########.com/api/sms, maxSmsLength=null, isDefault=true)] (DefaultGatewayAdministrationService.java [http-nio-8080-exec-481]) ID//YBlr/rumtu/Zmb/WUL21HaoIpgoTIAZqUTO1g9ayM=
  • INFO 2024-11-27T12:45:39,681 Tracker Rule-engine side effects completed (NotificationLoggerUtil.java [taskScheduler-3])
  • INFO 2024-11-27T12:45:50,539 Tracker Rule-engine side effects completed (NotificationLoggerUtil.java [taskScheduler-5])
  • INFO 2024-11-27T12:46:08,022 Tracker Rule-engine side effects completed (NotificationLoggerUtil.java [taskScheduler-1])
  • INFO 2024-11-27T12:46:14,150 (admin) Export:Start (DefaultMetadataExportService.java [http-nio-8080-exec-477]) ID//YBlr/rumtu/Zmb/WUL21HaoIpgoTIAZqUTO1g9ayM=
  • INFO 2024-11-27T12:46:14,164 (admin) Exported 182 objects of type TrackedEntityAttribute (DefaultMetadataExportService.java [http-nio-8080-exec-477]) ID//YBlr/rumtu/Zmb/WUL21HaoIpgoTIAZqUTO1g9ayM=
  • INFO 2024-11-27T12:46:14,253 (admin) Exported 1214 objects of type DataElement (DefaultMetadataExportService.java [http-nio-8080-exec-477]) ID//YBlr/rumtu/Zmb/WUL21HaoIpgoTIAZqUTO1g9ayM=
  • INFO 2024-11-27T12:46:14,257 (admin) Exported 1 objects of type Program (DefaultMetadataExportService.java [http-nio-8080-exec-477]) ID//YBlr/rumtu/Zmb/WUL21HaoIpgoTIAZqUTO1g9ayM=
  • INFO 2024-11-27T12:46:14,257 (admin) Export:Done took 0.107081 sec. (DefaultMetadataExportService.java [http-nio-8080-exec-477]) ID//YBlr/rumtu/Zmb/WUL21HaoIpgoTIAZqUTO1g9ayM=
  • INFO 2024-11-27T12:46:14,546 Tracker Rule-engine side effects completed (NotificationLoggerUtil.java [taskScheduler-9])
  • INFO 2024-11-27T12:46:52,734 Tracker Rule-engine side effects completed (NotificationLoggerUtil.java [taskScheduler-7])
  • INFO 2024-11-27T12:48:39,061 Tracker Rule-engine side effects completed (NotificationLoggerUtil.java [taskScheduler-10])
  • INFO 2024-11-27T12:48:39,611 (admin) Import:Preheat[REFERENCE] took 0.021446 sec. (DefaultPreheatService.java [http-nio-8080-exec-479]) ID//YBlr/rumtu/Zmb/WUL21HaoIpgoTIAZqUTO1g9ayM=
  • INFO 2024-11-27T12:48:39,618 (admin) Import:Validation took 0.004648 sec. (DefaultObjectBundleValidationService.java [http-nio-8080-exec-479]) ID//YBlr/rumtu/Zmb/WUL21HaoIpgoTIAZqUTO1g9ayM=
  • INFO 2024-11-27T12:48:39,650 Hibernate caches cleared (DefaultHibernateCacheManager.java [http-nio-8080-exec-479]) ID//YBlr/rumtu/Zmb/WUL21HaoIpgoTIAZqUTO1g9ayM=
  • INFO 2024-11-27T12:48:39,650 (admin) Import:Commit took 0.032418 sec. (DefaultMetadataImportService.java [http-nio-8080-exec-479]) ID//YBlr/rumtu/Zmb/WUL21HaoIpgoTIAZqUTO1g9ayM=
  • INFO 2024-11-27T12:48:50,470 Tracker Rule-engine side effects completed (NotificationLoggerUtil.java [taskScheduler-6])
  • INFO 2024-11-27T12:49:10,102 Tracker Rule-engine side effects completed (NotificationLoggerUtil.java [taskScheduler-8])
  • INFO 2024-11-27T12:49:16,130 Tracker Rule-engine side effects completed (NotificationLoggerUtil.java [taskScheduler-19])
  • INFO 2024-11-27T12:49:47,346 Tracker Rule-engine side effects completed (NotificationLoggerUtil.java [taskScheduler-16])
  • INFO 2024-11-27T12:49:56,240 Tracker Rule-engine side effects completed (NotificationLoggerUtil.java [taskScheduler-19])
  • INFO 2024-11-27T12:50:03,741 Tracker Rule-engine side effects completed (NotificationLoggerUtil.java [taskScheduler-9])
  • ERROR 2024-11-27T12:50:03,773 Error null (SimplisticHttpGetGateWay.java [SimpleAsyncTaskExecutor-525479])
  • ERROR 2024-11-27T12:50:03,773 SMS failed, failure cause: failed (SmsMessageSender.java [SimpleAsyncTaskExecutor-525479])
  • INFO 2024-11-27T12:50:03,916 Sending email to user: sansuwa with email address: s***********@gmail.com (EmailMessageSender.java [SimpleAsyncTaskExecutor-525478])
  • INFO 2024-11-27T12:50:04,459 Email sent using host: mail.dhis2mis.org:587 with TLS: true (EmailMessageSender.java [SimpleAsyncTaskExecutor-525478])

Okay, thanks! Forgot to ask you about the DHIS2 version you are using? Please consider using the latest versions.

Hopefully that will help for a start. I see these errors:

However, these remain generic errors which simply indicate that it’s failing but doesn’t specify what exactly isn’t working. So I want to ask you some of the questions usually asked by @zubair which will help us gather more info to resolve this.

Please get the whole list of gateways configured in the system. Get the complete JSON shared from the api/gateways endpoint.

Good, this is also recommended by @zubair, and it means you will need to check the configuration:

I think you might also need to share the API document for the SMS service you are using…