Repository navigation
gwp troubleshooting
Use this section to diagnose common GWP startup, authentication, CORS, library-loading, and browser-debugging issues.
You might see these symptoms:
- Browser shows security warning or blocks connection
- "Your connection is not private" or "NET::ERR_CERT_AUTHORITY_INVALID" error
- Unable to load
gwp.jsor connect to Media Gateway - Console shows certificate errors
If the browser reports that the Media Gateway's self-signed SSL certificate is untrusted, use one of these fixes:
-
Accept the certificate in the browser for development or testing. Go directly to the Media Gateway URL in your browser:
https://<MediaGatewayAddress>. When the browser shows the security warning, click Advanced, then click Proceed to [site] or the equivalent browser option. This adds a temporary exception for the certificate. This option only works for testing and must be done in each browser and device. -
Install a valid SSL certificate for production. Obtain an SSL certificate from a trusted Certificate Authority (CA), install the certificate on the Media Gateway server, and configure Media Gateway to use the valid certificate. This is the recommended approach for production environments.
-
Install the self-signed certificate in the operating system for development. Export the self-signed certificate from the Media Gateway, install it in the operating system's trusted root certificate store, and restart the browser after installation. This is more permanent than a browser exception but still not recommended for production.
Important
Self-signed certificates should only be used in development and testing environments. Production environments should always use certificates from trusted Certificate Authorities.
You might see these symptoms:
- HTTP 401 Unauthorized error when retrieving token
- Error code 16 (InsufficientPrivilege)
- Video player fails to start or shows permission error
- "Access denied" messages
Token retrieval failed. For HTTP 401 responses, Media Gateway returns the authentication result in the response body. Use that value to choose the next check instead of relying only on the HTTP status text.
Common 401 response bodies:
| Response body | What to check |
|---|---|
BadCredentials |
Verify the user name, password, and Basic <Base64(username;sdkCertificate:password)> header format. |
InsufficientPrivileges |
Verify the user has the Web App application privilege and at least one of View live video or View playback on the requested camera. |
MissingSdkCertificate |
Add the SDK certificate to the user name part of the Basic credential string: username;sdkCertificate. |
InvalidSdkCertificate |
Verify that the SDK certificate string matches the Security Center license. |
MissingMediaSdkLicense |
Verify that the Security Center system has a Media SDK license. |
Unknown |
Verify that the request includes a supported authentication header. |
- Verify the username and password.
- Verify the SDK certificate string.
- Check the Authorization header format:
Basic <Base64(username;sdkCertificate:password)>. - Ensure no extra spaces or special characters in credentials.
- Test logging on to Security Center Config Tool to confirm that the credentials work.
Required access for GWP camera streaming:
- A valid Security Center user name and password, or another supported authentication method.
- A valid SDK certificate.
- A Security Center system with a Media SDK license.
- The Web App application privilege.
- At least one of View live video or View playback on the requested camera.
Additional privileges depending on features used:
- For PTZ, check PTZ motor privileges. The parent View live video privilege must be granted first.
See the complete Security Center privileges section for details.
- In Security Center Config Tool, go to User management.
- Select the user.
- Open the Access rights tab.
- Verify that the user has access to the camera's partition.
Privileges alone do not grant access to the camera's partition.
- Verify the camera GUID is correct.
- Ensure the camera exists and is online in Security Center.
- Check that the camera is assigned to a partition the user can access.
Test token retrieval with this pattern:
// Test token retrieval
const testToken = async () => {
try {
const response = await fetch(`${mediaGatewayEndpoint}/v2/token/${cameraId}`, {
credentials: 'include',
headers: {
'Authorization': `Basic ${btoa(username + ";" + sdkCertificate + ":" + password)}`
}
});
const responseText = await response.text();
console.log('Status:', response.status);
if (response.ok) {
console.log('Token retrieved successfully');
} else {
console.error('Failed:', response.status, responseText || response.statusText);
}
} catch (error) {
console.error('Error:', error);
}
};You might see these symptoms:
- Browser console shows CORS errors
- "Access to fetch/XMLHttpRequest blocked by CORS policy" error
- "No 'Access-Control-Allow-Origin' header is present"
- Token retrieval or WebSocket connection fails
The browser is rejecting the cross-origin request. GWP endpoint paths are handled by Media Gateway's GWP endpoint CORS behavior, so first verify the request URL and origin. If your application calls endpoints that are subject to strict origin checks, verify that the configured policy includes your web application's exact origin.
-
Verify the GWP endpoint URL.
Make sure your application calls the GWP endpoints exposed by Media Gateway under the configured application path, such as
/media/v2/token/{cameraId},/media/v2/files/gwp.js, and/media/v2/wswhen the application path ismedia. -
Configure Media Gateway CORS settings if your application calls endpoints that require an explicit origin policy.
Modify the
MediaGateway.gconfigfile located in theConfigurationFilesdirectory:C:\Program Files (x86)\Genetec Security Center X.X\ConfigurationFiles\MediaGateway.gconfigOption A: Allow specific origins (recommended)
<?xml version="1.0" encoding="UTF-8"?> <configuration> <MediaGateway EnforceStrictCrossOrigin="true"> <AllowedOrigin Origin="https://yourapp.example.com" /> <AllowedOrigin Origin="http://localhost:3000" /> </MediaGateway> </configuration>
Option B: Allow all origins (development only, not recommended for production)
<?xml version="1.0" encoding="UTF-8"?> <configuration> <MediaGateway EnforceStrictCrossOrigin="false"/> </configuration>
-
Restart the Media Gateway role after modifying the configuration file.
-
Verify your application's origin.
- Origin includes protocol, domain, and port.
- Examples:
https://app.example.com,http://localhost:3000,https://192.168.1.100:8080 - Make sure the exact origin is listed in the configuration.
-
Check for multiple origins. If testing from multiple locations (localhost, staging, production), add all origins.
Common CORS mistakes include:
- Calling a non-GWP endpoint by mistake
- Forgetting to restart Media Gateway after config change
- Origin mismatch (for example,
httpvshttps, different port numbers) - Trailing slashes in origin URLs
- Using IP address in code but domain name in CORS config (or vice versa)
See Cross-origin resource sharing (CORS) for more details.
You might see these symptoms:
- Unexpected errors or exceptions
- Missing methods or properties
- Features not working as documented
- "undefined is not a function" errors
- Inconsistent behavior
Check whether the browser is using a stale gwp.js file or a library version that differs from the one served by the connected Media Gateway. Switching endpoints during failover retains the loaded library; using a different endpoint alone does not establish a version mismatch. Compatibility between different versions is not guaranteed.
-
Always load
gwp.jsfrom Media Gateway.Correct approach:
<script src="https://<MediaGatewayAddress>/media/v2/files/gwp.js"></script>
Incorrect approaches:
- Using a downloaded or cached copy from a different Security Center version
- Hosting
gwp.json your own server
-
Record the GWP library version.
// Check GWP version console.log('GWP Version:', gwp.version());
-
Clear the browser cache. The browser may be caching an old version of
gwp.js. Hard refresh with Ctrl+F5 on Windows or Cmd+Shift+R on macOS, clear the browser cache completely, or try in incognito/private browsing mode. -
Check for multiple script tags. Ensure you're not loading
gwp.jsmultiple times. Check that no other libraries are loading an older version. -
After a Security Center upgrade, account for browser-cached files.
-
If Security Center was upgraded, the
gwp.jsfile changes automatically -
Users with cached versions have mismatches
-
Consider cache-busting strategies:
<script src="https://<MediaGatewayAddress>/media/v2/files/gwp.js?v=<cache-version>"></script>
-
To prevent source mismatches:
- Always reference
gwp.jsfrom the Media Gateway server. - Do not download and host
gwp.jsseparately. - Document the GWP library version and Security Center version your application is tested with.
- Test thoroughly after Security Center upgrades.
See the Installation section for more details.
Enable GWP logs and use browser developer tools to diagnose issues:
// Enable detailed GWP logging
gwp.enableLogs(true);- Press F12 to open browser developer tools.
- Go to the Console tab.
- Look for error messages, warnings, or GWP logs.
- Note error codes and descriptions.
In Chrome, Edge, or Firefox, use these steps to inspect token requests and the WebSocket connection to Media Gateway:
- Open browser developer tools.
- Go to the Network tab.
- Clear the network filters before inspecting token requests. Check for failed requests or CORS errors.
- Filter for WebSocket connections to inspect the connection to Media Gateway.
If your application retrieves tokens through a backend, the browser shows the request to that backend. Check the backend's request to Media Gateway separately.
// Show diagnostic overlay on the player
webPlayer.showDebugOverlay(true);The debug overlay displays real-time information about:
- Connection status
- Stream statistics
- Frame rate and codec information
- Buffering status
If issues persist after trying the solutions above:
-
Enable verbose logging:
gwp.enableLogs(true); // Enable intense logging
-
Gather diagnostic information:
- GWP version:
gwp.version() - Security Center version
- Browser and OS version
- Error codes from console
- Network tab screenshots showing failed requests
- GWP version:
-
Contact Genetec Support with the diagnostic information
Before contacting support, also confirm these points:
-
Use logs: Enable GWP logs to gather detailed information:
gwp.enableLogs();
-
Check network accessibility: Ensure the Media Gateway is reachable from your network.
-
Validate configuration: Confirm the Media Gateway role and permissions are properly configured in Security Center.
- GWP developer guide: Setup, authentication, playback, and recovery guidance.
- Overview
- Connecting to Security Center
- SDK certificates
- Referencing SDK assemblies
- ASP.NET hosting
- SDK compatibility
- Migrating to modern .NET
- Entities
- Entity cache
- Entity loading, cache, and query options
- Detecting entity changes
- Entity change event reference
- Transactions
- Security Center events
- Actions
- Security Desk
- Custom events
- Event-to-actions
- Managing macros
- ReportManager
- ReportManager query reference
- Access control raw events
- DownloadAllRelatedData and StrictResults
- Privileges
- Partitions
- Entity write restrictions
- About custom fields
- About video
- About cameras
- Enrolling a video unit
- Ingesting third-party video
- Archiver and auxiliary archiver roles
- Archive transfer
- About access control
- About cardholders and credentials
- About doors, areas, elevators, and access points
- About access rules and schedules
- About access control units and interface modules
- Enrolling an access control unit
- Door templates
- Visitors
- Mobile credentials
- About threat levels
- About alarms
- About incidents
- Maps
- Logging
- Overview
- Localization
- Certificates
- Lifecycle
- Threading
- State management
- Configuration
- Restricted configuration
- Events
- Queries
- Request manager
- Database
- Entity ownership
- Engine extensions
- Entity mappings
- Server management
- Custom privileges
- Custom entity types
- Resolving non-SDK assemblies
- Deploying plugins
- Modern .NET support
- Overview
- Localization
- Certificates
- Creating modules
- Tasks
- Pages
- Components
- Tile extensions
- Services
- Contextual actions
- Custom actions
- Options extensions
- Configuration pages
- Monitors
- Shared components
- Commands
- Extending events
- Map extensions
- Timeline providers
- Image extractors
- Credential encoders
- Credential readers
- Cardholder fields extractors
- Badge printers
- Content builders
- Dashboard widgets
- Incidents
- Logon providers
- Pinnable content builders
- Custom report pages
- Overview
- Getting started
- Media file formats
- MediaPlayer
- VideoSourceFilter
- MediaExporter
- MediaFile
- G64 converters
- FileCryptingManager
- PlaybackSequenceQuerier
- PlaybackStreamReader
- OverlayFactory
- PtzCoordinatesManager
- AudioTransmitter
- AudioRecorder
- AnalogMonitorController
- Camera blocking
- Overview
- Getting started
- Referencing entities
- Entity operations
- About access control in the Web SDK
- About video in the Web SDK
- Users and user groups
- Partitions
- Custom fields
- Custom card formats
- Actions
- Events and alarms
- Incidents
- Reports
- Tasks
- Macros
- Custom entity types
- System endpoints
- Performance guide
- Reference
- Endpoints
- Constants
- Enumerations
- Under the hood
- Troubleshooting