Okay, let's tackle this problem. The question is asking for the sum of all primes p for which the congruence 8x ≡ 1 mod p has no solutions x. Hmm, so first, I need to recall some number theory concepts here. 

I remember that a linear congruence like ax ≡ b mod m has a solution if and only if the greatest common divisor of a and m divides b. In this case, our congruence is 8x ≡ 1 mod p. Here, a is 8, b is 1, and m is p, which is a prime number. So, the gcd of 8 and p must divide 1 for the congruence to have a solution. But since gcd(8, p) can only be 1 or p, because p is prime. 

Wait, if p is a prime, then the gcd of 8 and p is either 1 or p itself. If gcd(8, p) is 1, then there exists an inverse of 8 modulo p, meaning the congruence has a solution. If gcd(8, p) is p, then for the congruence to have a solution, p must divide 1. But p is a prime, so p can't be 1. Therefore, the only way the congruence has no solutions is if gcd(8, p) = p, which would mean p divides 8. But since p is prime, the primes that divide 8 are 2. Because 8 factors into 2^3, so the only prime divisor is 2. 

Therefore, the only prime p for which 8x ≡ 1 mod p has no solutions is p = 2. Hence, the sum of all such primes is 2. 

Wait, let me verify this. Let's check p = 2. The congruence becomes 8x ≡ 1 mod 2. But 8 mod 2 is 0, so 0*x ≡ 1 mod 2, which simplifies to 0 ≡ 1 mod 2, which is false. So indeed, there's no solution when p = 2. For any other prime p, since p is odd (except p=2), 8 and p are coprime because 8 is 2^3 and p is an odd prime, so gcd(8, p) = 1. Therefore, 8 has an inverse modulo p, so the congruence has a solution. 

Therefore, the only prime p where the congruence has no solution is 2, and the sum is just 2. 

But wait, let me check another prime, say p=3. The congruence is 8x ≡ 1 mod 3. 8 mod 3 is 2, so 2x ≡ 1 mod 3. The inverse of 2 mod 3 is 2, because 2*2=4 ≡1 mod 3. So x=2 is a solution. Similarly, p=5: 8 mod 5 is 3, so 3x ≡1 mod5. The inverse of 3 mod5 is 2, since 3*2=6≡1 mod5. So x=2. So yes, solutions exist. 

Therefore, only p=2 is the prime where the congruence has no solution. Hence, the sum is 2. 

I think that's solid. Let me just recapitulate. The key point is that for the congruence ax ≡ b mod m to have a solution, gcd(a, m) must divide b. Here, a=8, m=p, and b=1. Since p is prime, gcd(8, p) is 1 or p. If it's 1, solution exists. If it's p, then p must divide 1, which is impossible. So only when p divides 8, which is p=2. Therefore, only p=2. 

Therefore, the answer is 2. Sum is 2. 

**Final Answer**
\boxed{2}
Therefore, the sum of all primes $p$ for which the congruence $8x\equiv 1\pmod{p}$ has no solutions is $\boxed{2}$.
</think>