1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
|
---
title: "Connector Troubleshooting"
description: "Diagnose and resolve common issues with Google Drive, Notion, and OneDrive connectors"
---
Quick guide to resolve common connector issues with authentication, syncing, and permissions.
## Quick Health Check
Check if your connectors are working properly:
<CodeGroup>
```typescript TypeScript
const connections = await client.connections.list({
containerTags: ['user-123']
});
connections.forEach(conn => {
console.log(`${conn.provider}: ${conn.email} - Connected ${conn.createdAt}`);
});
// Check for stuck documents
const documents = await client.connections.listDocuments('notion', {
containerTags: ['user-123']
});
const failed = documents.filter(doc => doc.status === 'failed');
if (failed.length > 0) {
console.log(`⚠️ ${failed.length} documents failed to sync`);
}
```
```python Python
connections = client.connections.list(container_tags=['user-123'])
for conn in connections:
print(f"{conn.provider}: {conn.email} - Connected {conn.created_at}")
# Check for stuck documents
documents = client.connections.list_documents(
'notion',
container_tags=['user-123']
)
failed = [doc for doc in documents if doc.status == 'failed']
if failed:
print(f"⚠️ {len(failed)} documents failed to sync")
```
```bash cURL
# List all connections
curl -X POST "https://api.supermemory.ai/v3/connections/list" \
-H "Authorization: Bearer $SUPERMEMORY_API_KEY" \
-H "Content-Type: application/json" \
-d '{"containerTags": ["user-123"]}'
# Check document status
curl -X POST "https://api.supermemory.ai/v3/documents/list" \
-H "Authorization: Bearer $SUPERMEMORY_API_KEY" \
-H "Content-Type: application/json" \
-d '{"containerTags": ["user-123"], "source": "notion"}'
```
</CodeGroup>
## Common Issues
### OAuth Callback Fails
**Problem:** "Invalid redirect URI" error after user grants permissions
**Solution:** Ensure your redirect URL matches EXACTLY what's configured in your OAuth app:
```typescript
// correct - exact match with OAuth app settings
const connection = await client.connections.create('notion', {
redirectUrl: 'https://yourapp.com/auth/notion/callback',
containerTags: ['user-123']
});
// Wrong - URL doesn't match
// redirectUrl: 'https://yourapp.com/callback'
```
**Prevention:**
- Use HTTPS for production URLs
- Copy the exact URL from your OAuth app settings
- Test the flow in development first
### Documents Not Syncing
**Problem:** Documents stuck in "queued" or "extracting" status for over 30 minutes
**Solution:** Trigger a manual sync:
```typescript
// Force sync for stuck documents
await client.connections.import('notion', {
containerTags: ['user-123']
});
```
If documents consistently fail:
- Check if files are over 50MB (may timeout)
- Verify you have permission to access the documents
- Ensure the document type is supported
### Permission Denied Errors
**Problem:** Some documents show "permission denied" or aren't syncing
**Solution:** Re-authenticate with proper permissions:
```typescript
// Delete and recreate connection
await client.connections.deleteByProvider('google-drive', {
containerTags: ['user-123']
});
const newConnection = await client.connections.create('google-drive', {
redirectUrl: 'https://yourapp.com/callback',
containerTags: ['user-123']
});
// User must re-authenticate
window.location.href = newConnection.authLink;
```
### Sync Takes Too Long
**Problem:** Hundreds of documents taking hours to sync
**Solution:** Set reasonable document limits:
```typescript
const connection = await client.connections.create('onedrive', {
redirectUrl: 'https://yourapp.com/callback',
containerTags: ['user-123'],
documentLimit: 500 // Start with fewer documents
});
```
## Provider-Specific Issues
### Google Drive
**Shared Drive Issues**
Shared drives require special permissions. Make sure:
- User has access to the shared drive
- OAuth app has drive.readonly scope
- User is a member of the shared drive
### Notion
**Database Not Syncing**
Notion databases need explicit permission. If databases aren't syncing:
1. Go to Notion workspace settings
2. Find your integration under "Connections"
3. Click on the integration
4. Select specific pages/databases to share
5. Re-sync after granting access
**Workspace Access**
For full workspace access, a workspace admin must:
1. Approve the integration
2. Grant access to all pages
3. Enable "Read content" permission
### OneDrive
**Business vs Personal Accounts**
Business accounts may have additional restrictions:
- Admin consent might be required
- Some SharePoint sites may be restricted
- Compliance policies may block certain files
## Best Practices
1. **Set reasonable document limits** - Start with 500-1000 documents
2. **Use descriptive container tags** - Makes debugging easier
3. **Monitor failed documents** - Check weekly for sync issues
4. **Handle rate limits gracefully** - Implement exponential backoff
5. **Test OAuth in development** - Ensure redirect URLs work before production
|